필터 지우기
필터 지우기

FFT - Return vector and Frequency display

조회 수: 2 (최근 30일)
Anmol Pardeshi
Anmol Pardeshi 2019년 4월 15일
편집: kholoud salameh 2019년 5월 31일
fft function - it returns a vector, same length as the signal, but if we plot the abs(signalFFT), the x axis does not quite depict the exact frequency, although it is very close. I would want to know how does this fft function works, what it exacts returns & how and what do I do to fix this.

답변 (1개)

kholoud salameh
kholoud salameh 2019년 5월 31일
편집: kholoud salameh 2019년 5월 31일
hi , if you try this code :
f = abs(fft(y));
plot(f)
it will plot y by sample at x-axis which is the length of f ! to get y by the exact frequency try this one :
f = abs(fft(y)); % calculate the magnitude of fft
index = 1:length(f);
index = index ./length(f) ;
index = index * fs ;
figure
plot(index,f); % plot frequency spectrum

카테고리

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