LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IIR filter Nyquist cut off

I am trying to reproduce a simple RC low-pass filter response for audio processing. A first-order Butterworth filter works except at high frequency where, as the Nyquist frequency is approached, there is an additional fall off. This behaviour is reproduced by the Digital IIR Filter VI: filter information output (below) so it appears to be a theoretical limitation.

 Filter fall off.JPG

I have tried other implementations, including the IIR cascade filter, and the response is the same. I haven't tried a wideband FIR filter as it looks over-complicated - even a "Butterworth" seems overkill for such a simple response.

 

Oversampling reduces the error but doesn't eliminate it.

It is crucial that the filter also has the correct phase response (satisfying the Kramers-Kronig relation, as the Butterworth filter does). Is there a solution?

 

Thanks, David

 

LabVIEW 18.0

0 Kudos
Message 1 of 14
(4,387 Views)

I never took a formal course in digital signal theory, but I do know that "funny things happen near the Nyquist Frequency", which is why (digital or analog) filters are designed to attenuate signal frequencies being digitally sampled to be very low near the Nyquist Frequency.  A first-order filter (such as you have) probably wants to have its corner frequency rather lower (maybe a tenth?) than the Nyquist.

 

There are some real experts on filtering (Lynn -- are you there?) on the Forums -- they may be able to shed more light.

 

Bob Schor

0 Kudos
Message 2 of 14
(4,364 Views)

Thanks for replying Bob

In fact there are digital filters that give the correct response all the way up to the Nyquist frequency so it can be done, but I skipped that course too so I have no idea how they work. I did some more digging but haven't found a solution so I will have to abandon LV for this.

Best wishes, D.

0 Kudos
Message 3 of 14
(4,332 Views)

An Nth-order analog Butterworth filter has N zeros at 'infinity' frequency.

The magnitude response has to be 'zero' at the frequency where you have a zero. So in the case of an analog RC filter, this happens at infinity. As the number of zeros at infinity increase (i.e., higher the filter order), the higher attenuation at higher frequency. 

 

However, in a digital Nth-order Butterworth filter, the N zeros are at fs/2. This means that the magnitude response has to be zero at fNyq and you see a sharper fall-off near fNyq. 

 

Not sure what you mean by 'reproduce' a simple RC lowpass filter response but, no matter what you use (MATLAB, LabVIEW etc), there is no workaround from the sharp fall in magnitude response at fNyq if you use a digital Butterworth filter. 

 

 

BR
Message 4 of 14
(4,324 Views)

Hi David

 

What did you set the cut-off frequency to?

 

Paul

0 Kudos
Message 5 of 14
(4,316 Views)

Hi Kallis

Thanks for the clear explanation.

By 'reproduce' an RC filter response, I meant to match the magnitude and phase response of the RC filter up to fNyq (or very close). Below is the magnitude response I measured from a third-party digital filter (that the designer claims has also the correct phase response). I hoped I could replicate this in LabVIEW.

Eq response.png

I should have asked: If this is not possible using the standard Butterworth filter can anyone suggest an alternative solution?

0 Kudos
Message 6 of 14
(4,305 Views)

Hi Paul

The cut-off frequency is about 2 kHz

0 Kudos
Message 7 of 14
(4,304 Views)

Perhaps they upsample the signal internally?

By the way, what signal are you using as the input in order to determine the frequency response. Is it a delta?

Message 8 of 14
(4,292 Views)

Paul

I think the accuracy is too high to be oversampling - otherwise the computational expense would be too high.

I didn't think of using a delta function (I'd been tediously averaging noise) brilliant! It does seem to give slightly different results up near fNyq though, especially with respect to downsampling, but that might be instructive.

Thanks, D.

Message 9 of 14
(4,281 Views)

Hi David

 

Whose filter is it that you are trying to match?

 

I would say that the sampling rate is not too high to be over/up-sampled (they are different things). You also need to consider a couple of things:

  • Any signal above the Nyquist frequency will be aliased, so either you need to sample at a greater rate (over-sample) to avoid aliasing those frequencies or you need to have an appropriate low-pass filter before your A/D conversion.
  • A first-order butterworth filter has a slow transition above the cutoff. In the analog world, you would not have the Nyquist issue, but when doing digital processing, you do, so you need to work around it, and if oversampling is not an option, up-sampling the data post A/D is another option to preserve the frequency response right up until your original Nyquist frequency. Note however, that those frequencies are not well sampled so close to the Nyquist frequency (and indeed they may be already aliased higher frequencies) so the drop-off you observe is probably not a bad thing anyway.  If you really want to sample 48kHz then you should definitely sample higher than 96kHz.
Message 10 of 14
(4,275 Views)