recreating in matlab Butterworth Filter filter response
Show older comments
There is a manual which presents a filter response. In the video they present a formula and a plot of the response. However when I tried to implement it in MATLAB I get a totally different plot. Where did I go wrong implementing this formula?
plots and code of the blog and my impelentation are attached.
Thanks.
clc
clear all
s=0:0.01:50;
H=1./((s/20.01).^4+2.6131*(s/20.01).^3+3.4142*(s/20.01).^2+2.6131*(s/20.01)+1);
plot(s,20*log10(abs(H)))
Accepted Answer
More Answers (1)
It seems that there is a confusion in s-domain and omega domain.
The following is the Laplace Transform in s-domain. The plotting is for real value of s.
s=(0:0.01:2*pi)*20.01;
H=1./((s/20.01).^4+2.6131*(s/20.01).^3+3.4142*(s/20.01).^2+2.6131*(s/20.01)+1);
plot(s,20*log10(abs(H)));
xlabel("s")
ylabel("20*log10(abs(H(s))");
The following is in omega domain (
) which is related to the frequency response and it is what one would expect.
omega = (0:0.01:2*pi)*20.01;
s = 1i*omega;
H=1./((s/20.01).^4+2.6131*(s/20.01).^3+3.4142*(s/20.01).^2+2.6131*(s/20.01)+1);
plot(omega, 20*log10(abs(H)));
xlabel("\omega")
ylabel("20*log10(abs(H(j\omega))")
Categories
Find more on Filter Analysis in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!



