LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bandpass Filter does not filter as expected

I have an audio signal which I'm trying to analyze. One of the steps needed is a bandpass filter, which returns results that (in my opinion) don't make any sense. Here is what I do:

 

- FFT signal and identify frequency peaks (lets say I identify a peak at 8000 Hz)

- Configure a bandpass filter for the input signal (Equi-Ripple-Bandpass-VI).

    - I chose the passband to be 8000 ± 5 Hz

    - Low blocking freq. is 7980, High blocking freq. is 8020

    - Sample frequency 40 kHz

 

To check if my configuration was correct, I FFT'd the filtered signal. I'd expect only one peak at 8000 Hz. However, all the peaks from the original signal are there too. It seems like not much has changed, except the amplitude has been shifted.

 

Am I missing something?

0 Kudos
Message 1 of 8
(4,438 Views)

Hi freijon,

 

atleast you missed to provide an example VI demonstrating your problems…

 

Using that bandpass function clearly shows a bandpass behaviour on some white noise:

check.png

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 2 of 8
(4,426 Views)

I created a simplified demo VI:

I'd expect the FFT after the filter (bottom right graph) to only show the peak at 10272 Hz, as I limit the passband to ±5 Hz around the peak.

 

2014-05-15 14_34_10-d20041 - Remotedesktopverbindung.png

0 Kudos
Message 3 of 8
(4,417 Views)

Hi freijon,

 

well, your filtered waveform shows frequency amplitudes around -120db, where the original waveform has -20db. So the bandpass filtered quite a lot…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 4 of 8
(4,412 Views)

It shouldn't filter around 10 kHz though...

0 Kudos
Message 5 of 8
(4,407 Views)

Hi freijon,

 

maybe your filter frequency settings are too "strict"? Using a wider band works fine:

check.png

Combining a passing band of 10Hz with a stopband of 30Hz needs a very high-order bandpass. Maybe you reached some limits in that bandpass function?

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 6 of 8
(4,401 Views)

Hey GerdW,

 

Maybe I don't understand the bandpass filter correctly, I assumed that the filter works as follows:

 

0 < f_block_low < f_pass_low < f_pass_high < f_block_high < infinity

 

- The frequencies below f_block_low are being blocked (in my example: (0...10252)

- The frequencies between f_pass_low and f_pass_high are being passed (in my example: (10267...10277)

- The frequencies above f_pass_high are being blocked (10272...)

 

So regarding your statement that my stopband is 30 Hz, I'd rather say its the entire frequency spectrum except for the passband. If thats not the case, then my assumptions have been wrong from the beginning.

0 Kudos
Message 7 of 8
(4,392 Views)

Hi freijon,

 

i wanted to say: you have a "passband" of 10Hz, a "suppression band" of 30Hz width, and everything outside those bands should be filtered. Your assumption is correct.

 

But still your frequency limits are very demanding for a filter and requires a high-order filter (if even possible). Try your VI with some less demanding settings…

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 8 of 8
(4,387 Views)