09-24-2012 04:25 AM
I would like to "stack" a DSP filter on a LabVIEW Waveform. By "stack", I simply mean run it twice, but with different cutoff frequencies; I'm trying to simulate real hardware.
I'm using a basic built-in LabVIEW DSP filter: \vi.lib\Analysis\3filter.llb\Butterworth Filter.vi
This is very straightforward if I run it on a Waveform, produce an intermediate Waveform, change the cutoff frequencies, then run it again on that intermediate Waveform.
But here's where things get tricky; I want to run it live, or on a point-by-point basis....
Since that Butterworth Filter is re-entrant, it has an "init/cont" input which makes it pretty easy to run if I don't stack the filter; I just set the VI's "init/cont" input to false on my first point, true on following points, and my resulting Waveform is the same as if I ran it on the entire Waveform. But since I'm relying on the internal state of that re-entrant VI, I can't really run stack it on the point-by-point scenario because the internal state would get confused by which set of cutoff frequencies I'm using.
My best solution for the point-by-point analysis is to make a copy of that Butterworth filter, and for every point, use LabVIEW's original Butterworth Filter with one set of cutoff frequencies, then the copy of the Butterworth filter for the second set of cutoff frequencies. Although it works, it seems wrong to make a copy of a built-in LabVIEW function. If I upgrade LabVIEW, then I'd be using two versions of the Butterworth filter.
Is there a better way to do this?
Solved! Go to Solution.
09-25-2012 03:05 PM
Hello bmihura,
I am a little bit confused on what you are trying to accomplish. Would it be possible for you to attach code examples of the scenarios that you are describing so that the community is better able to assist you?
What do you mean by "it seems wrong to make a copy of a built-in LabVIEW function. If I upgrade LabVIEW, then I'd be using two versions of the Butterworth filter."
Is "LabVIEW's original Butterworth Filter" the one found in the vi.lib you referenced? Are there two different Butterworth Filter VIs you are asking about?
This sounds like something you might be able to use a For Loop for, but it's hard to say without seeing your code.
Thank you,
Joel C.
National Instruments
09-25-2012 05:27 PM
Sorry, I double posted when I saw that this post didn't show up for an hour. At any rate, the answer was posted in this thread:
http://forums.ni.com/t5/LabVIEW/stacking-reentrant-DSP-filters-point-by-point-problem/td-p/2165186
In summary, when I tried to stack two filters I needed to have them as separate objects in the block diagram instead of one object in a loop; that way their internal memory is not confused.