First off: I'm really new in the signal processing department and MatLab as well, so please bear with me here.

What I want to achieve is to split my audio signal into smaller 25ms frames, where the frames overlap with 50%, apply a window function, thus the overlapping (probably Hamming or Hann), and then add it together again (write out a new sound file), so that I basically get the original signal back. Someone mentioned overlap-add, but I'm not quite sure if convolution is correct here, as mentioned, I'm new to all this.

So I have a sound file that I read like this:

function output = readSoundFile(filename, channels)

if isscalar(channels)

[output, elementCount] = fread(fid,[chN,inf], '*int16');

for i=chN:-1:1
    if channels(i) == 0


In another MatLab file, I use the readSoundFile function:

fileUrl = 'whatever/file.format';
sound = readSoundFile(file);
soundsc(double(sound), 16000); % sound is sampled with 16kHz. Don't know, if this information is needed

How do I split the resulting data into 25ms frames with an overlap of 50%, apply a window function, and write out a new file?

Should it help, I can convert the file into a wav file, if wavread/audioread would be any easier.

  • $\begingroup$ Difficult to answer without a specific idea of what your goal is. If you want to do any frequency domain filtering, overlap-add is the way to go. If you want to do any other kind of frequency domain processing, things get a lot more complicated. Just recreating the file seems kind of pointless. $\endgroup$
    – Hilmar
    Commented Oct 8, 2013 at 11:40
  • $\begingroup$ Yes, later on, I want to do frequency domain filtering on the frames, but for now I just need to know how to divide the received signal into 25ms frames. What I do with the frames later on, shouldn't matter now, right? $\endgroup$ Commented Oct 8, 2013 at 12:30
  • $\begingroup$ Actually what you want to do with the frames matters a LOT. Choice of analysis window, synthesis window, window length, FFT size, step size, etc. are all heavily dependent on the application. The easiest application would probably be linear time invariant filtering for which overlap-add or overlap-save work well and are fairly simple and straight forward. $\endgroup$
    – Hilmar
    Commented Oct 8, 2013 at 14:42
  • $\begingroup$ @Hilmar Alright. Then I'll probably start with that. Could you point me to some good documentary or give me a simple example? $\endgroup$ Commented Oct 8, 2013 at 16:29

2 Answers 2


Von Hann (but not Hamming) windows with a 50% overlap sum to unity (except possibly at the very start or end of a file). If you do any processing, rather than just analysis, in the frequency domain, you may find overlap add or overlap save with a rectangular window to be more appropriate.

  • $\begingroup$ Could you give any code examples? $\endgroup$ Commented Oct 9, 2013 at 13:26

Segmenting signal into overlaping frames is called "enframe" operation. A simple example is here:


You might then filter (convolve) your signal with any kernel using for example "conv" command. Then apply the inverse operation of enframe.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.