0
$\begingroup$

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

https://www.youtube.com/watch?v=3yyp5JRqNXs&list=PLdciPPorsHunK-nh9PyXcA8rTy4m-TuOV&index=4 enter image description here

enter image description here

enter image description here

$\endgroup$

1 Answer 1

0
$\begingroup$

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;

enter image description here

$\endgroup$
2
  • $\begingroup$ 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)))' $\endgroup$
    – user70731
    Commented Dec 30, 2023 at 9:20
  • $\begingroup$ Code can be rendered with ` before and after. Your last line should have $\omega$ for the x-axis: plot(w, 20*log10(abs(H))). $\endgroup$
    – Jdip
    Commented Dec 30, 2023 at 9:25

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.