Compute FFT consecutively in Matlab

I have an array of numbers in variable "filter". I wanted to compute Fourier Transform (fft) on every 32 data consecutively using matlab. But the codes below doesn't seems to work. Anyone have a better solution?
for aa=1:length(filter)-32 %scans every row of numbers
output(aa) = fft(filter(aa + (0:31))); % compute fft every 32 data continuously
end

답변 (2개)

Youssef  Khmou
Youssef Khmou 2014년 3월 18일

0 개 추천

hi, First remark is the name of the variable "filter" is built-in function, this will lead to ambiguity, the other problem is you are iterating with a step of 32 points but you expect to store 32 points in 1 element, the partition in the right must be the same in the left :
for aa=1:length(X)-32 %scans every row of numbers
output(aa+(0:31)) = fft(X(aa + (0:31)));
end
output is complex vector.
Greg Heath
Greg Heath 2014년 3월 18일

0 개 추천

output(aa) is a scalar
output(aa,:) is a row vector
Hope this helps.
Thank you for formally accepting my answer
Greg

댓글 수: 1

Youssef  Khmou
Youssef Khmou 2014년 3월 18일
this is another option to store nx32 matrix like a spectrogram.

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

카테고리

도움말 센터File Exchange에서 Time-Frequency Analysis에 대해 자세히 알아보기

질문:

2014년 3월 18일

댓글:

2014년 3월 18일

Community Treasure Hunt

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

Start Hunting!

Translated by