LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems using Express Filter

I am trying to use the filter express vi and having some difficulties.

Attached is the the vi that I am working on and the data file that contains the points of a sampled sinewave.

I continously get a nyquist band error but am not sure how to correct it.

Thanks in advance,

Matt Kniller
0 Kudos
Message 1 of 4
(2,869 Views)
Matt,

The reason you get the Nyquist error is that the Filter.VI does not know what the time scale is. It assumes (I think) a sampling frequency of 1 sample per second. The time scale on your waveform graph shows values from 0 to 2047. That calculates to a frequency of approximately 4 milliHertz for your test data. I am not sure how to tell the Express VIs about the sampling rate.

I rewrote your program using standard (not Express) VIs. I assumed a sampling rate of 100 kHz as that puts your data at approximately 400 Hz. I based this on the 300 and 500 Hz cutoff frequencies you had set for the filter. I also changed the processing of your string slightly and used an alternative (not necessarily better or worse) method of centering the data about zero.

Lynn
0 Kudos
Message 2 of 4
(2,856 Views)
Lynn,

Thank you for the help. That is exactly what I wanted to do. I was wondering if you could explain some of the changes for me in a little more detail? Such as:

1. What is the added case structure in the for loop for
2. How did you get the Xscale to be in Hz without using a multiplication factor
3. Is the Filter express vi that is used necessary or can it be removed and repleace the input of the spectral measurements vi with the output of the butterworth filter
4. Why does the for loop not need to be initialized to amount of times to run

I think that about does it.

Again I appreciate you help.

Matt Kniller
0 Kudos
Message 3 of 4
(2,841 Views)
Glad it was of some value to you.

1. The case structure is an alternate way of calculating the array values. If you put another indicator on it, the result should be identical to Array 2. I was simply demonstrating that there are often muliple ways of solving a problem.
2. The multiplication is built into the graph. Notice the cluster bundle functions feeding the graph. If you look at the Context Help for the graph, it shows the bundle with xo, delta x, and y array inputs. The waveform graph is fed the sample period, delta t. The spectrum function produces a delta f output which is fed to the frequency response graphs.
3. The Express filter and spectrum VIs are not used. I just left them on the diagram so you could easily compare the original to my modifications.
4. A for loop can be controlled two ways. The one you already know is to wire the N terminal. The other is to connect an autoindexing array to the loop. The loop will run one iteration for each element in the array (1-D array) or once for each subarray indexed by the first index of multidimensional arrays. If more than one array is autoindexed at the input of a loop, the shorter loop will control the number of iterations.

Lynn
0 Kudos
Message 4 of 4
(2,827 Views)