How to plot fft outputs in frequency domain?

조회 수: 118 (최근 30일)
Chutiphon Moranon
Chutiphon Moranon 2020년 7월 3일
댓글: Chutiphon Moranon 2020년 7월 3일
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
Chutiphon Moranon
Chutiphon Moranon 2020년 7월 3일
Thank so much. I have followed the instructions in that link. It is really helpful.

댓글을 달려면 로그인하십시오.

추가 답변 (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));

제품


릴리스

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by