fft moving window problem

3 visualizaciones (últimos 30 días)
Katarzyna
Katarzyna el 7 de Ag. de 2012
Comentada: Pengxiang Huang el 12 de Jun. de 2020
I'd like to perform moving window fft on my signal. I'd like to use hamming window first, and then try hanning. I started writing the code, however I dont know how to save and merge data from each fft in the loop. I'll be very grateful to any suggestions. The code is:
x = sig; % my signal
nx = length(x); % size of signal
w = hamming(32); % hamming window
nw = length(w); % size of window
pos=1;
while (pos+nw <= nx) % while enough signal left
y = x(pos:pos+nw-1).*w; % make window y
%%%%process window y %%%%
yy = fft(y,32);
pos = pos + nw/2; % next window
end
thanks in advance, KK

Respuestas (2)

Daniel Shub
Daniel Shub el 7 de Ag. de 2012
You should have a look at SPECTROGRAM.
  1 comentario
Pengxiang Huang
Pengxiang Huang el 12 de Jun. de 2020
spectrogram doe not fit for his purpose totally, you may miss a lot of consideration such as computation burden.

Iniciar sesión para comentar.


Katarzyna
Katarzyna el 8 de Ag. de 2012
I am analysing spectrogram too, but in this case I would like to perform fft n times on the m parts of the signal. I can see in my head a moving window of 64samples with increment e.g 32samples (50% overlap). I dont know how to save and merge fft results from each step.
  2 comentarios
Daniel Shub
Daniel Shub el 8 de Ag. de 2012
This should be a comment on my answer, and not a new answer. Have you read the documentation of SPECTROGRAM. This is exactly what the function does.
Pengxiang Huang
Pengxiang Huang el 12 de Jun. de 2020
did you finally solve it

Iniciar sesión para comentar.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by