# Windowed fft: how windowing is practically applied at overall data?

#### micdisav

Joined Dec 20, 2017
2
Hi, please, somebody tell me: how windowing is practically applied at overall data?

Look to attached image.

In the upper plot there is the plot of ALL SIGNAL SAMPLES.

In the lower plot there are many WINDOW SAMPLES (separated by vertical lines); thus for every sample in window width, we compute SIGNAL SAMPLES .* WINDOW SAMPLES.

Then we JOIN all previous products and get the FULL WINDOWED SIGNAL; on this finally signal we calculate Y = fft(FULL WINDOWED SIGNAL, N fft points)

Is the (although raw) procedure correct?

Thanks, Michele Di Savino

#### MrChips

Joined Oct 2, 2009
19,280
Am I to assume that you are using a rectangular window?

You apply a window in time-space by multiplying the data set with the window. The result is a convolution of the transform of the window with the transform of the data set in fourier-space. This results in a spreading of your fourier peaks.

You may want to try dividing your data sets into shorter chunks and performing the fft on the reduced data set.

Why do you not want to perform the fft on the entire data set all at once?

#### micdisav

Joined Dec 20, 2017
2

--start code
cls; clear;
%test hamming
t = 0: 0.0001: 1-0.00;
x = cos(2*pi*100*t);%+randn(size(t));

figure('Name','Windowing Effects','NumberTitle','on');

subplot(2,1,1)
xdft1 = fft(x);
plot(abs(xdft1(80:120)))
title('Not Windowing');

subplot(2,1,2)
winvec = hamming(length(x), 'periodic'); %blackmanharris(length(x));%rectwin(length(x)); %hann(length(x)); %hamming(length(x));
xdft2 = fft(x' .* winvec * (length(winvec)/sum(winvec)));
plot(abs(xdft2(80:120)))
title('with Hamming Windowing: Bottom Enlarged, But Less Spectral Leakage');
--end code

Nodal step: >>winvec = hamming(length(x), 'periodic');
Thus, the dimension of hamming window "MUST BE" equal the signal time dimension?

Regards,
Michele Di Savino