Bode plot from transfer function looks wrong
11 views (last 30 days)
Show older comments
I'm trying to create a Bode plot for the transfer function for a Multiple Feedback Filter. It's a frequency sensitive filter.
The problem is, my bode plot does not have the correct resonant/midfrequency which should be 1000Hz.
I know my transfer function is right because it can be found elsewhere online and using online bode plotters spits out my own transfer function and the correct Bode plot.
My code:
% Bode plot for 1000Hz
R_1 = 1500;
R_2 = 3300;
R_3 = 12000;
C = .047*10^-6;
s_numerator = -1/(R_1*C);
s2_denom = 1;
s1_denom = 2/(R_3*C);
s0_denom = (1+(R_1/R_2))/(R_1*R_3*(C^2));
H1 = tf ([s_numerator 0],[s2_denom s1_denom s0_denom])% "tf' Creates object representing
bode(H1)
grid on
I know H1 gives me the right transfer function but then when I use the bode operation on H1 the plot is all messed up.
MATLAB transfer function and Bode plot:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/236933/image.png)
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/236934/image.png)
As you can see, the Bode plot is not centered at
as it should be.
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/236935/image.png)
Graphed online using OKAWA Electrical Design:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/236936/image.png)
As you can see, the band pass is centered at 1kHz as it should be and its transfer function is nearly the same transfer function as MATLAB gave me:
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/236937/image.png)
What is wrong with my MATLAB code?
0 Comments
Accepted Answer
Raj
on 4 Sep 2019
"What is wrong with my MATLAB code?" - Absolutely nothing!
Your Bode plot 'x' axis in in rad/sec and the online graph is in Hz. Right click on your bode plot go to property, under 'units' change frequency to Hz. Cheers!
More Answers (0)
See Also
Categories
Find more on Get Started with Control System Toolbox 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!