Zero Meaning a Hamming Window in Matlab I am still relatively new to signal processing and MATLAB and am working on a short-time fourier transform of some data using a prexisting code. Within the code a Hamming window is produced and multiplied by the signal prior to an fft.
The function itself works correctly, however I want the peak of the Hamming window to be over the first sample, rather than the midpoint (i.e shifting the Hamming window back by (no of samples/2)). What would be the simplest way to achieve this zero meaning?
This is the current generation and application of the Hamming window, where ncol is the number of time windows being used in the stft.
y = window(:,ones(1,ncol)).*y;

Any help is greatly appreciated.
Method1:
w = w([(end/2+1):end 1:end/2]);

Method#2:
w = circshift(w, ncol/2);