01-26-2019 05:27 AM
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.
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
01-26-2019 01:15 PM
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
01-29-2019 01:35 PM
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.
01-29-2019 05:37 PM
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.
01-30-2019 12:15 AM
Hi David
What did you set the cut-off frequency to?
Paul
01-30-2019 11:40 AM
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.
I should have asked: If this is not possible using the standard Butterworth filter can anyone suggest an alternative solution?
01-30-2019 11:41 AM
Hi Paul
The cut-off frequency is about 2 kHz
01-30-2019 07:21 PM
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?
01-31-2019 12:19 PM
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.
01-31-2019 06:28 PM
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: