How can i Plot the amplitude spectrum

5 ビュー (過去 30 日間)
Batuhan Samet Demirci
Batuhan Samet Demirci 2022 年 4 月 24 日
回答済み: Raghava S N 2025 年 4 月 8 日
Hi. I have given to me a vector data file which is data.mat on matlab. And i know how to get fft of it. My question is how can i plot the amplitude spectrum centered at the zeroth frequency for this. The code i wrote is in below. What should i add to my code for plotting the amplitude spectrum centered at the zeroth frequency? My code; load data.mat X = fft(x)

回答 (1 件)

Raghava S N
Raghava S N 2025 年 4 月 8 日
This MATLAB Answer post gives a comprehensive solution to your query- https://www.mathworks.com/matlabcentral/answers/800831-amplitude-and-phase-spectrum. What you are essentially trying to plot is a double-sided amplitude spectrum. You can do this by passing the result of the "fft" function to the "fftshift" function. Refer to this link for more details about the "fftshift" function - https://www.mathworks.com/help/matlab/ref/fftshift.html.

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by