1
\$\begingroup\$

I'm using C language to implepement a simple 4th order lowpass IIR filter. I used ellip on matlab to get my coefficients,more specifically ellip(4,0.25,10,0.25). This is the frequency response on matlab.enter image description here

Since my sampling rate is at 48KHz the filter should cut off frequencies above 6KHz.

Now, I know that something might be wrong with my code, which I will upload if necessary, but this is the output and input for some sounds:enter image description hereenter image description hereenter image description hereenter image description here

Low frequencies seem to pass with mild decrease while frequencies above 6 KHz are not completely cut off until about 11KHz although there is a sensible decrease above 6KHz. Is this to be expected or should I start looking at my code?

UPDATE: I haven't heard about passband ripple and stopband attenuation before. I just had a look at this question : what's the pass band ripple and stop band attenuation of a digital filter?

So now my main focus is to understand ellip. We have 0.25 dB passband so the small decrease in frequencies below 6 KHz makes sense( if I'm connecting this right). We also have 10dB stopband attenuation which justifies the high values for high frequencies. But why does the stopband attenuation stop at very high frequencies? Do passband and stopband ripple apply for frequencies only close to the 'cut-off' frequency?

\$\endgroup\$
0

1 Answer 1

3
\$\begingroup\$

You should start looking at your filter. Judging from the frequency response, the outputs look like expected.

You have designed a filter with a lowly 10 dB attenuation in the stop band. I would not call that a "cutoff", more like subtle equalizing. The stop band is everything after your cutoff frequency, including the very far edge. An elliptic filter doesn't necessary keep "falling off".

You should be able to get much better than that with a 4th order elliptic filter, if you just want a 6 kHz lowpass filter. Try pumping the dB up to 11 60 or so. 10 dB attenuation is hardly anything.

\$\endgroup\$
2
  • \$\begingroup\$ That has clarified a lot, thank you.But why is it so 'playful' close to the "cut-off" and then it stabilizes? Shouldn't it follow the same attenuation across all the frequencies above the "cut off"? \$\endgroup\$ Commented Dec 15, 2017 at 12:09
  • 1
    \$\begingroup\$ @JohnKatsantas That's what you get with an elliptic filter. It optimizes the width of the transition from the passband to the stopband. If you want a filter that looks nicer you can compare with a Butterworth or Chebyshev design. \$\endgroup\$
    – pipe
    Commented Dec 15, 2017 at 12:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.