# How to create Bode plot from measured data

58 Ansichten (letzte 30 Tage)
Windell am 19 Apr. 2016
Bearbeitet: Windell am 23 Mai 2016
Aloha, I have a *.csv file containing three columuns, time, input signal and output signal. The input signal is a sine wave with a continuously increasing frequency and the output signal is the open loop response for my system. I would like to create a bode plot of the data. How would I do this? I know that I need to fit the data somehow so that I can extract the magnitudes and phase, but i'm not sure where to start.
thanks, windell
##### 2 KommentareKeine anzeigenKeine ausblenden
Azzi Abdelmalek am 19 Apr. 2016
can you post a sample of your Data? Or attach your csv file
Windell am 23 Mai 2016
Bearbeitet: Windell am 23 Mai 2016
Sure Azzi. The input is the blue and the green is the output.
-For magnitude response would I just divide the amplitude of the output by the input point by point and convert to dB?
-Also for phase delay would I find the peaks and subtract the input peak from the output peak position?
If i'm wrong, would you be able to show an example?

Melden Sie sich an, um zu kommentieren.

### Antworten (1)

Star Strider am 19 Apr. 2016
If you already have a state-space or transfer function representation of your system, then just cut to the chase, use the transfer function representation (or the ss2tf function if necessary), and use the numerator and denominator polynomials with the bode, bodeplot, freqs or freqz functions to create the Bode plot.
----------------------
Otherwise, if your input is a sine of increasing frequency (and that frequency spans the frequency response of your system, essentially a ‘chirp’ signal), you have the magnitude response of your system, so the magnitude part of a Bode plot.
Getting the phase might be a bit more challenging. Taking a wild guess as to your data, I would use the invfreqz function to create a transfer function representation of your system, and then use the bode, bodeplot, or freqz functions to create the Bode plot.
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Plot Customization finden Sie in Help Center und File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by