title: MATLAB - Hamming window, overlap 50%
body: <p>So I have wrote some code which takes an audio file and splits into frames of 320 samples for the 16000hz.</p>
  
  <p>I have took the hamming window of each frame as shown by the code:</p>
  
  <pre><code>fs=16000;
  [x,fs] = audioread('01.wav');
  
  %Pre-emphasis filter (Y[n]=X [n]-0.95x[n - 1])
  b = [1 -0.95];
  y = filter(b,1,x);
  
  %windowing
  numSamples = length(y);
  frameLength = 320;
  numFrames = floor(numSamples/frameLength);
  for frame = 1:numFrames,
     firstSample = (frame * frameLength) - (frameLength - 1);
     lastSample = (frame * frameLength);
  
     shortTimeFrame = y(firstSample:lastSample);
     h = hamming(320);
  
     hs = h.*shortTimeFrame;
     plot(hs, 'r');
  end
  </code></pre>
  
  <p>How would I then overlap the hamming windows by 50%?
  I have seen other questions on SO and seen answers such as this:</p>
  
  <pre><code>y = buffer(h, 1, floor(64 * 0.5));
  </code></pre>
  
  <p>But have had no luck with it</p>