Hi
You are trying the code in C, I suggest you the write the code in MATLAB. It is hard to write a program of Bode plot in C, but if you are going to use MATLAB you can do it easily. here is an example of a MATLAB code
Code:
e.g
F(s)= (s^2 + 6s + 7)/(s^3 + 5s^2 + 8 )
bode plot can be generated by simple commands
Code:
num=[0 1 6 7];
den=[1 5 0 8];
bode(tf(num,den))
When you are done with this code the magnitude vs frequency and phase vs frequency plot graph will appear. And if you try to write the same in C it will take a long time. It is just another option for you to make your work fast.
Bookmarks