LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Frequency response at low frequency

I'm working on a bandpass filter, and I'd like to get the frequency response showing that the frequencies outside the lower and higher cutoff frequencies are being cut off. However, the correct plot is shown only when my cutoff frequencies are high (roughly from 1000-8000 hertz). When I use low cutoff frequences(roughly 4-5 hertz), the plot is incorrect. So how can I get the frequency response to my low cutoff frequencies? Thanks.

P.S. In the code, some parts are irrelevent. In the front panel, the only relevent part is the frequency response plot at the lower right corner, and the specs above it; in the block diagram, only the upper half(with IIR and FRF) is relevent. Thanks.
0 Kudos
Message 1 of 6
(3,245 Views)
Hi Manson

There is a bug in your diagram since you connected the number of samples where you should have connected the sampling frequency.

The sampling frequency is related to the pace at which you take the measurement.

Usually, Fs = 1 / dT
where Fs is the sampling frequency and dT is the time interval.

It should work better.

In any case, to have a better resolution in the low frequency range of your spectrum computations, you have to increase the number of points of your data because there exist the following relationship between dF (space between 2 points in you spectrum), dT, and N (number of data points) :

dF = 1 / (2 x dT x N)

Doc-Doc
Doc-Doc
http://www.machinevision.ch
http://visionindustrielle.ch
Please take time to rate this answer
0 Kudos
Message 2 of 6
(3,245 Views)
Oh I'm sorry. The number that I put is already the sampling frequency. I just mistakenly labeled it as number of samples.

But I don't see any bug in my upper part of the block diagram, which corresponds to the lower right corner frequency response plot. So I wonder why it doesn't work in low frequency. Do you see a bug by any chance? Thanks again.
0 Kudos
Message 3 of 6
(3,245 Views)
Manson,

If you are simulating data you may want to use a impulse signal to get the filter response. You don't need to have a FRF with noise. Here is a small example on how you can do this with a single FFT, it will be much faster.

I hope this helps.

Regards,

Juan Carlos
N.I.
0 Kudos
Message 4 of 6
(3,245 Views)
Thanks. But I've a question regarding the filter response. Since you used FFT in your code, the plot is in frequency domain. Thus, should the x-axis be frequency instead of time? Also, how come the cutoff points on the curve do not correspond to the cutoff frequencies input by the user?
Thanks again.
0 Kudos
Message 5 of 6
(3,245 Views)
Manson,

You are right, the x-axis should be frequency. the values do not correspond because I'm not creating the waveform with the appropiate values. You would need to build a cluster with the initial frequency, dF, and the data. This will cause the grapf to update properly. I defined a constant to be the sampling rate to 64.

Here is a more complete version of the example.

I hope this helps.

Juan Carlos
0 Kudos
Message 6 of 6
(3,245 Views)