LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Passband IIR filter does not have correct cutoff

I am trying to implement a bandpass filter using the digital IIR filter vi. The input comes from a signal generator and the output is displayed as a waveform on the screen of my PC. When I test it out by varying the frequency of my input, the cutoff is always not where I programmed. Does anyone know what could be wrong? Is there some limitations of the software filter which could explain this phenomenon?
 
Thanks
hlseck
0 Kudos
Message 1 of 14
(4,149 Views)
Several possibilites come to mind. Are you violating the Nyquist criterion? Is the filter aware of the sampling rate? Did you give it enough data? Did the transients settle before you made your measurements?

Please give some details of your problem. What are the desired filter parameters? What frequencies of input signals produce the problems you are seeing? Describe the problem as quantitatively as you can. What DAQ hardwqare are you using? What is the sampling rate? How many samples? If you can post an example which demonstrates the problem with data saved as default in a control (we may not have your hardware), someone will probably be able to help you.

Lynn
0 Kudos
Message 2 of 14
(4,141 Views)
I am using a scan rate 10000 on only one channel and the signal that I am expecting is around 1Khz. So the sampling condition should be okay. The digital IIR filter that I am using does not have an input for the sampling frequency.
 
I am using PCI-MIO-16E4 to collect the data. The signal obtained seem to be correct as I have displayed the signal on an oscilloscope. I have the following settings
 
Lower PB=990 Hz
Upper PB=1010 Hz
Lower SB=980 Hz
Upper SB=1020 Hz.
 
The gains I have left them as default.
 
Is there a problem with my settings?
0 Kudos
Message 3 of 14
(4,126 Views)
Hello hlseck:

What are the values that you placed on "IIR filter specifications" (Type, Topology, Order) input?


0 Kudos
Message 4 of 14
(4,123 Views)
That is a very narrow filter and you will need a high order filter implementation to get it. Also, the filter has a transient at the beginning. For example a 6th order filter with 60 dB of stopband attenuation has noticeable transient decay beyond 1/2 second. The narrower the filter, the longer the transient. It appears to me that the filter VI is working properly. As Debonair asked, please post the entire filter and sample specifications.

Lynn
0 Kudos
Message 5 of 14
(4,112 Views)
I am thinking of using a lowpass filter cascaded with a highpass filter. This seems to work but I'm not sure if it is a good idea.
Download All
0 Kudos
Message 6 of 14
(4,091 Views)
Please give us the complete specs on the filter youu want: You have specified the frequencies but not the attenuation at each frequency. You need both to design a filter. The spec should be something like this: Maximum attenuation in Passband = x1, Maximum passband ripple = x2, Minimum stopband attenuation = x3 (if upper and lower stopbands are different, specify them separately). Don't overspecify. If 3 dB of passband attenuation will work, do not specify 1 dB. Doing so will make the filter more complex and more likely to have a longer transient period.

Lynn
0 Kudos
Message 7 of 14
(4,092 Views)
Hi Lynn

I'm don't really have a specification. My only concern is to obtain the signal at the particular frequency, in my case is 1kHz, and make use of it to drive a external circuit. So I guess a suitability filtered signal for me would be one with as much stopband attenuation as possible without changing the passband component much. Thank you for being so patient with me. Look forward for your advice.

hlseck
0 Kudos
Message 8 of 14
(4,075 Views)
You cannot design a filter without specifying the parameters. If you were not given a specification, then one will need to be created. Let me see if I can help.

What is the amplitude of the desired signal (the 1 kHz signal)? Can it change frequency? If so, how much?

What is the nature of the undesired signal(s)? Single tone interference? Multiple interfering tones? Broad band noise?

What are the amplitude(s) and frequency(ies) of the interferring signal(s)?

How much attenuation of the desired signal is acceptable? Can you amplify it after the filter? Is the phase of the signal important? If so, how much phase shift can be tolerated?

How much of the interfering signal can the system tolerate after the filter? Or, How large must the output signal to interference or noise ratio be?

Answer these questions to the best of your ability. Put in estimates or describe the source or useage if you do not have solid numbers. If you estimate, please indicate which values are estimates.

With this information we can probably determine a filter spec and then a filter design.

Lynn
0 Kudos
Message 9 of 14
(4,072 Views)
What is the amplitude of the desired signal (the 1 kHz signal)? Can it change frequency? If so, how much?
The amplitude of the desired signal is around 0.5V.The frequency can change by around 20Hz.

What is the nature of the undesired signal(s)? Single tone interference? Multiple interfering tones? Broad band noise?
The noise is broadband noise from electronics circuit.

What are the amplitude(s) and frequency(ies) of the interferring signal(s)?
I am not aware of the amplitude of the interfering signal but the frequency would be broadband.


How much attenuation of the desired signal is acceptable? Can you amplify it after the filter? Is the phase of the signal important? If so, how much phase shift can be tolerated?

The attenuation of the signal is not so crucial as it can be amplified but the phase is important. As the filter signal will eventually be used to drive an external circuit, any phase shift would reduce the accuracy. My computer is acting as the feedback since I am not using any hardware, my pc is actually filter the input signal and feeding it back to the system. So any delay or phase shift would not be undesireable.

How much of the interfering signal can the system tolerate after the filter? Or, How large must the output signal to interference or noise ratio be?
My estimate is that the interfering signal  be -10dB  below the desired signal.
0 Kudos
Message 10 of 14
(4,046 Views)