LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Bessel low pass filter and sampling frequency

I have a 20 kHz sine wave signal, use the Bessel LowPass filter.
The input parameters for the filter are as followings: sampling freq: 204800, Order: 8, low cutoff freq: 30000.
The filtered X has a much lower amplitudue compared to to the input signal.
If I change the sampling frequency to 80000, it seems the filtered X is better.
Can you please explain the behavior of the filter?
 
0 Kudos
Message 1 of 5
(4,359 Views)
If you set the cutoff frequency as 80000, it will work.   Besel filte is maximally flat response in both magnitude and phase.  However, the transition band of Besel filter is very wide.  Setting higher the cutoff frequency will make the gain for the lower frequency equals 1.
 
See the attached VI about how the cutoff frequency affects the gains. 
 
0 Kudos
Message 2 of 5
(4,348 Views)
Thank you for the reply!
 
I attached a test vi, which generates a sine wave and calculate its RMS (basic DC/RMS). The sine wave is then passed to a low pass filter, a new RMS is calculated from the filtered signal.
 
Test case 1:
Frequency = 10 kHz, Amplitude = 4, Sampling Info: Fs = 80 k, #s = 1000; Low pass cutoff frequency = 30 k; Filter sampling frequency = 80k.
The signal RMS  = 2.8284; Filtered signal RMS = 2.71.
 
Test case 2:
Same setup as case 1, change the Filter sampling frequency to 204800.
The signal RMS  = 2.8284; Filtered signal RMS = 2.4688.
 
Test case 3:
Frequency = 20 kHz, Amplitude = 4, Sampling Info: Fs = 80 k, #s = 8000; Low pass cutoff frequency = 30 k; Filter sampling frequency = 80k.
The signal RMS  = 2.8284; Filtered signal RMS = 2.21.
 
Test case 4:
same setup as case 3, change the sampling frequency to 204800.
The signal RMS  = 2.8284; Filtered signal RMS = 1.5369
 
 
Can you please why increasing the sampling frequency will get lower RMS value?
Thanks.  
 
 
 
0 Kudos
Message 3 of 5
(4,334 Views)

Sorry, not near a LV box to look at or try your code. 

Can you please [explain] why increasing the sampling frequency will get lower RMS value?

Because you're lying to the filter function.  You actually sampled at 80 kHz, but you told the filter function that you sampled at 204.8 kHz.  That's the meaning of the "sample frequency" input -- you identify the sample rate used to digitize the signal.

With a 10 kHz sine wave, you have 8 samples per cycle.  When the filter function sees those 8 samples per cycle, and is told by you that the sample rate was 204.8 kHz, it has to treat that as a sine wave at 204.8 / 8 ~= 26 kHz.  Surely a 26 kHz sine wave will be attenuated more than a 10 kHz sine wave.

Trouble is, comparing your test cases 2 and 3, I would expect more attenuation for case 2 than for 3.  *That* part I don't understand.  But the comparisons from 1-->2,  1-->3,  and 3-->4 all seem reasonable.  Additional attenuation should be expected.

-Kevin P.

ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.
0 Kudos
Message 4 of 5
(4,330 Views)
Thanks Kevin.
 
Sorry for the confusion.
In the Test case 2 and 4, both Fs (for the sine wave generation) and the Filter sampling frequency are changed to 204800.
 
When I ran the Besel Filter.vi posted by Nann, it clarily shows that how the sampling frequency affected the amlitude and the frequency response when I set the cut off frequency to 30000.
 
0 Kudos
Message 5 of 5
(4,319 Views)