1
$\begingroup$

The question is to design a Low Pass Butterworth IIR Digital filter. The following code below has the specifications with $A_p$ being the passband attenuation, $A_s$ the stop band attenuation, $f_{pb}$ is the passband frequency and $f_{sb}$ is the stop band frequency. $f_s$ is the sampling frequency all in Hz.

I do not understand what formulas are used to calculate the cutoff frequency. I normalised the frequencies using:

$$\omega_{pb} = \frac{f_{pb}}{f_s/2}$$ $$\omega_{sb} = \frac{f_{sb}}{f_s/2}$$

I could successfully calculate order using:

$$N = \frac{\log_{10}\left(\frac{10^{0.1\cdot A_p}-1}{10^{0.1\cdot As}-1}\right)}{2\log_{10}(f_p/f_s)}$$

but when I calculated cutoff frequency using :

$$\omega_c = \frac{\omega_{pb}}{\left(10^{0.1\cdot Ap}-1\right)^{1/(2N)}}$$

I am getting the result as $\omega_c = 0.21916$

**MATLAB CODE:**
Ap=1.25;    As=15;  fpb=200;    fsb=300;    fs=2000; 

[N,fc]=buttord(200/(fs/2),300/(fs/2),Ap,As)

[b,a]=butter(N ,fc) % fc = 0.2329, N = 6

So how are the frequency calculations done ?


EDIT: FOUND THE SOLUTION

I looked into buttord.m in MATLAB and found out that it converts the normalised frequencies given to it by pre-warping those frequencies and converts it into analog domain. It finds the normalised Low pass filter design with the required cut off. So all the intermediate calculation is done in the analog domain frequency and for the resultant cutoff it shows, it again warps the frequency in order to obtain the digital frequency.

Also the bi-linear transform is used to obtain the transfer function of the digital filter.

$\endgroup$
6
  • $\begingroup$ I have converted you mathematical expressions into MathJax (edit may be pending). Please check I have done so correctly and consider using MathJax in the future. $\endgroup$ Feb 13, 2022 at 11:13
  • $\begingroup$ I'm not sure how we can help you, other than by doing what you yourself could also do: check the code in buttord.m. I suppose it has to do with frequency warping. $\endgroup$
    – Matt L.
    Feb 13, 2022 at 11:24
  • $\begingroup$ @MattL. This tip was really helpful, I found out the internal working of the code. $\endgroup$ Feb 13, 2022 at 14:21
  • $\begingroup$ @Circuit_Breaker0.7, can you share what you have found as an answer to your question? $\endgroup$ Feb 15, 2022 at 2:01
  • $\begingroup$ I have made the edit @GrapefruitIsAwesome $\endgroup$ Feb 15, 2022 at 11:50

1 Answer 1

1
$\begingroup$

EDIT: FOUND THE SOLUTION

I looked into buttord.m in MATLAB and found out that it converts the normalised frequencies given to it by pre-warping those frequencies and converts it into analog domain. It finds the normalised Low pass filter design with the required cut off. So all the intermediate calculation is done in the analog domain frequency and for the resultant cutoff it shows, it again warps the frequency in order to obtain the digital frequency.

Pre-warping: $$\Omega_{pb} = {tan(w.pi/2)}{}$$ where w is the normalised frequency.

Similarly, while displaying the cutoff frequency, MATLAB warps the frequency again to show it in the original digital domain as: $$\omega_{c} = 2.{arctan(\Omega_c)}/pi$$

Also the bi-linear transformation is used to obtain the transfer function of the digital filter.

$\endgroup$

Your Answer

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

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