How to plot fft outputs in frequency domain?

41 次查看(过去 30 天)
Hi all,
I have attached the m-file for information about my question.
I have time-history acceleration data named BodyAccel_y in the workspace. I converted it to frequency domain by using fft in MATLAB.
However, as I noticed, the outputs are complex numbers.
I would like to plot the output data on Y-axis against their individual frequencies in X-axis.
I am new to this subject. I would appreciate any guidance/suggestion/instruction provided for this matter.
Thank you.

采纳的回答

KSSV
KSSV 2020-7-3
You have to generate the frequency values based on the sampling you have and use abs of the result of fft.

更多回答(1 个)

Arham jain
Arham jain 2020-7-3
if you want to plot the magnitude use
Y = abs(fft(BodyAccel_y));
if you want to plot phase use
Y = angle(fft(BodyAccel_y));

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

产品


版本

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by