How to generate a Bode plot using two sample time signals ?

12 views (last 30 days)
Hello,
I have an input and output signal coming from my driving dynamics simulation. The Input signal is the steer angle with a increasing frequency from 0,1 to 2 Hz. The output signal is the yaw rate.
I have to generate a bode Diagram showing the phase and amplitude of the transfer function.
Now, I tried to use the function tfest applied to an iddata. I can generate an iddata using the fft of the two signals but I have to give a frequency as a property, so that the function tfest works. Which frequency should I apply ?
In tfest, i have also to give a number of poles. I have no idea, what could it be.
My software is doing that automatically but no code is given. They give that in the Help menu : "Software estimates the frequency response function by performing a Fast Fourier Transform of the two signals and computing a complex ratio of the two frequency domain series. The gain and the phase shift in the Bode plot are the real and imaginary parts of this ratio"
Thank you for your help, Romain

Answers (1)

Arkadiy Turevskiy
Arkadiy Turevskiy on 30 Sep 2013
Do you have the data in time domain (steer angle and yaw rate as functions of time)? If you do, you can create time-domain iddata object and use tfest on that.
DAT = iddata(Y,U,Ts)
where Y is yaw rate, U is steering angle, Ts is sampling time for data.
As for the number of poles, you can try a few different values and see how well the model matches the data.
Alternatively, you can use ssest with an array of orders and the select the best order.
This is explained here (see the example "Determine Optimal Estimated Model Order" towards the bottom of the page.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!