05-17-2011 05:22 PM
Hi I'm a labview 8.5 user working in the field of aerodynamics - namely laminar to turbulent boundary layer transition.
I want to take a high pass filtered signal, rectify it, then place a window around the remaining signal (equivalent to 10% of the unfiltered signal mean) and count the number of points inside and outside the window. I can use a histogram for this as in the attached vi but I need to do a point by point analysis because things transiting through the window faster than a residence time criteria should be deemed as turbulent instead of laminar.
To say this more explicitly any points greater than 10%mean get digitally assigned 1, anything less 0, but let's say that at one section of the signal less than 10 consecutive zero points are sandwiched between two 1's then they should be assigned as 1 also. Where 10 consecutive points at my sampling frequency is equivalent to my critical residence time.
I hope I've given an adequate description of what I'm trying to achieve, could someone help direct me to achieve this please? I'm not too concerned with which filters, frequency settings etc. are used at the moment.
Thank you.
Solved! Go to Solution.
05-18-2011 11:06 AM
Ok maybe this attachment can help.
Anything in the rectified signal which is greater than 0.3 leads to logic high. However, I want the gap highlighted by the arrow to also be logic high as it's time-span is less than my residence time criteria. Any suggestions for how to tackle this problem?
Thanks.
05-19-2011 10:13 AM
I get the feeling I may be the only one interested in this problem ha.
Example Signal
1
1
1
0 ***
0
0
0
1
0
0
1
The logic I wish to implement:
Let’s say for the above example signal with NRES = 3 then effectively I want to ignore the first street of 0’s but not the second so that the signal ends up as (1 1 1 0 0 0 0 1 1 1 1).
So far I have been able to update my dynamic data type signal by using shift registers and adding arrays which have been initialised with 1’s, however being able to automatically establish the size of the substitute array and determine its placement, based on the intended logic, is something I haven’t been able to achieve yet. This isn't a blog, sorry to keep bumping the post up!
05-19-2011 12:24 PM
Solved. Yeeha!
I'd like to thank my family, friends (if I have any) and sponsors...
05-19-2011 01:17 PM - edited 05-19-2011 01:21 PM
You are kidding, right? Your code seems way to complicated. (Also, your sequence structure is not necessary because execution order is uniquely determined by dataflow already. Why clutter the diagram?)
Here's what I would probably do. Plase check for errors. 😉
Many improvements are still possible...
05-19-2011 01:45 PM
Thanks! My lax use of the word "solved" was somewhat controversial but I wasn't too concerned since I was mostly talking to myself! I've been looking for a way to achieve it first and then incorporate it in the rest of my code.
I'll get back to you soon when I have another chance to look at this in more detail and perhaps talk more about the wider problem.
Thanks very much!
05-19-2011 01:58 PM
There are also many input arrays that cause your code to run forever without producing a result. (Try e.g. an empty array, an array with only one gap, an array without gaps, etc.).
05-20-2011 11:36 AM
Ok, your solution appears to have been successfully implemented in the rest of my code and as you say what I had written was something of a one trick pony.
Now what I need to be able to do, in order to determine my high-pass filter frequency and nres, is to ascertain what's termed the boundary layer thickness, delta, and freestream velocity, U. The nomenclature is pictorially represented in the attached figure.
Source for figure: http://www.cortana.com/Drag_Description.htm
I've knocked together a quick (attached) vi which calculates a theoretical local velocity profile (Pohlhausen) through the boundary layer where I wish to seek the y location where u (the local velocity) = 0.99*U, where in this case U = 1 m/s.
So from the wall (where y = 0) I need to traverse out until I reach the first point where u > 0.99*U and then perform linear interpolation for 0.99*U with the previous y location. The reason it has to be this way is because of the experimental scatter that will be involved when not dealing with idealised profiles and infact I may have to use 0.95*U but I can arrive at that decision later. Now I can use the search 1D array function to find where u > 0.99*U but how do I efficiently obtain y?
As for U, that will probably just be a case of using the point furthest from the plate at the end of the traverse.
05-20-2011 12:33 PM
The attached is what I came up with for a linear interpolation algorithm suited to this problem. It seems to work as planned.
Any comments as to how it could be improved? Thanks.
05-20-2011 01:16 PM - edited 05-20-2011 01:17 PM
You still have way too much garbage code and inefficiencies.
Assuming that the polynomial u is non-descending, all you need is the following code.
There are probably even better ways, but this should get you started.