フィルターのクリア

how can i get my code to produce FFT graph.

2 ビュー (過去 30 日間)
morris konadu
morris konadu 2019 年 7 月 29 日
回答済み: Vimal Rathod 2019 年 8 月 1 日
This is my code below but doesnt work
L = length(signal);
Y = fft(signal);
Y1 = abs(Y);
% onlys show one sided FFT so multiply by 2, divide by Fs to scale.
Py = (2*Y1(1:L/2) / Fs);
% create frequency vector to plot against
freq = Fs/L*(0:L/2-1);
% plot the figure
figure
plot(freq,Py);
title('Amplitude Spectral Density');
xlabel('Frequency Hz');
ylabel('Amplitude');
grid on;
end
  1 件のコメント
dpb
dpb 2019 年 7 月 29 日
Please edit code to remove superfluous linefeeds and then select and use the "Code" button to format it...

サインインしてコメントする。

回答 (1 件)

Vimal Rathod
Vimal Rathod 2019 年 8 月 1 日
The code which you have given works perfectly fine, I suspect that you are not passing an appropriate signal to the fft function.
For more information refer to the link:

カテゴリ

Help Center および File ExchangeDiscrete Fourier and Cosine Transforms についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by