How do I hanning window a signal before FFT, inside of for loop?

1 Ansicht (letzte 30 Tage)
Gerald Boddie
Gerald Boddie am 12 Aug. 2020
I am attempting to hanning window a signal extracted from different software. I have been able to sucessfully plot the signal and a FFT of the signal. However, I would also like to use the hanning function to window the signal before I plot the FFT. I reviewed how to do so, but have not encountered examplees similar to mine, in which I am using a for loop. I have attached the code I am running. Any adivce would be greatly appreciated. Thanks.
  1 Kommentar
hosein Javan
hosein Javan am 12 Aug. 2020
Hi. from what I understood from your code, you are trying to shift the window and calculate the fft of the windowed signal. if it is the case, is there any problem you have encountered?

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Sulaymon Eshkabilov
Sulaymon Eshkabilov am 12 Aug. 2020
Hi,
You can insert your anticipated hanning window command on line 81 of your script, i.e.,
hold on; WIN_Hann=hann(length(Displacement(:,i))); % Hanning window: line 81
F = fft(Displacement(:,i)'.*WIN_Hann); % Hanning window applied: line 82
Good luck

Kategorien

Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by