how to apply Short-time fourier transform to code in matlab
this is very simplistic, but it 


inputs a wav file and uses only one channel of it
breaks it up into windowed frames,
transforms it to the frequency domain,
does nothing to it in the frequency domain,
transforms back to the time domain, 
overlap-adds that frame back into a time-domain array, and 
eventually writes it back out to a different .wave file.


try it out.  can't guarantee there ain't typos.


if ~exist('inFile')
    inFile = 'input.wav';
end

if ~exist('outFile')
    outFile = 'output.wav';
end

if ~exist('frameWidth')
    frameWidth = 4096;          % size of FFT frame, better be a power of 2
end
frameHop = frameWidth/2;

analWindow = hanning(frameWidth);

[inBuffer, Fs] = wavread(inFile);

x = [inBuffer(:,1); linspace(0, 0, frameWidth)'];                   % use left channel only, zeropad one frame at the end

clear inBuffer;

numSamples = length(x);

numFrames = floor((numSamples-frameWidth)/frameHop);

y = linspace(0, 0, numSamples)';


n = 0;                              % init sample pointer.  unlike MATLAB, i like counting from 0

for frameIndex = 1:numFrames

     xWindowed = x(n+1:n+frameWidth) .* analWindow;     % get and window the input audio frame

     X = fft(fftshift(xWindowed));              % do the FFT

     Y = X;                         % copy the input spectrum to output

                                % do whatever processing to Y that you like

     yWindowed = fftshift(real(ifft(Y)));           % convert back to time domain, toss the imaginary part

     y(n+1:n+frameWidth) = y(n+1:n+frameWidth) + yWindowed;

     n = n + frameHop;
end

wavwrite(y, Fs, outFile);