So I have wrote some code which takes an audio file and splits into frames of 320 samples for the 16000hz.
I have took the hamming window of each frame as shown by the 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
How would I then overlap the hamming windows by 50%? I have seen other questions on SO and seen answers such as this:
y = buffer(h, 1, floor(64 * 0.5));
But have had no luck with it