# recreating in matlab Butterworth Filter filter response

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? 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)))


I was hesitant to answer your question because it shows that you need to review the basics. However, hopefully this will encourage you to do just that!

The $$s$$ in $$H(s)$$ is a complex number $$s = \sigma + j\omega$$ where $$\sigma$$, the real part, represents a damping factor and $$j\omega$$, the imaginary part, represents an oscillatory component (for which $$\omega$$ is the angular frequency).

For sinusoidal steady-state analysis, we are interested in the behavior of the system at different frequencies but without the damping effect ($$\sigma = 0$$).

With that said, you only need minimal changes to your script:

omega = 0:0.01:50;
s = 1i * omega;


• Hello, i have attached the updated code ,however its not giving the result. also ,i am new to he forum ,how do i put code in comment? 'clc clear all w=0:0.01:50; s=1i*w; 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)))' Dec 30, 2023 at 9:20
• Code can be rendered with  before and after. Your last line should have $\omega$ for the x-axis: plot(w, 20*log10(abs(H)))`.
– Jdip
Dec 30, 2023 at 9:25