필터 지우기
필터 지우기

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 CenterFile Exchange에서 Discrete 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