DSPRelated.com
Forums

Overlap-Add Question

Started by stau...@gmail.com July 3, 2005
Hi,

I have a question about the overlap-add technique. I am taking some raw
audio data and I'm windowing it with 4096 point FFTs (and throwing away
the data that is reflected so I get 2047 points for each window). The
windows are non-overlapping. In the frequency domain, I set some
frequency bins to zero and then I do an IFFT with each window (making
sure to put back the reflected data) which gives me 4096 samples back.
Since the original windows were non-overlapping, I should be able to
just paste the IFFT'ed windows back contiguously without overlap,
right? I seem to be getting some weird clipping noise after the
reconstruction, presumably at the borders. Is there something that I'm
misunderstanding?

I've read the online DSP book that people on this group refer to and it
hasn't really helped me solve this problem.

Thanks!

-Salil

I of course meant that I get 2049 points for each window after the FFT
:)

-Salil

staufman@gmail.com wrote:
> Hi, > > I have a question about the overlap-add technique. I am taking some raw > audio data and I'm windowing it with 4096 point FFTs (and throwing away > the data that is reflected so I get 2047 points for each window). The > windows are non-overlapping. In the frequency domain, I set some > frequency bins to zero and then I do an IFFT with each window (making > sure to put back the reflected data) which gives me 4096 samples back. > Since the original windows were non-overlapping, I should be able to > just paste the IFFT'ed windows back contiguously without overlap, > right?
Wrong. Instead of showing point by point why it's wrong, just forget it and start over. > I seem to be getting some weird clipping noise after the
> reconstruction, presumably at the borders. Is there something that I'm > misunderstanding?
Look at the description of FFT filtering at http://www.musicdsp.org/phpWiki/index.php/filtering%20in%20the%20frequency%20domain
> I've read the online DSP book that people on this group refer to and it > hasn't really helped me solve this problem.
You call it "overlap-add", but there's no overlap and you don't add. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
staufman@gmail.com wrote:
> Hi, > > I have a question about the overlap-add technique. I am taking some raw > audio data and I'm windowing it with 4096 point FFTs (and throwing away > the data that is reflected so I get 2047 points for each window). The > windows are non-overlapping. In the frequency domain, I set some > frequency bins to zero and then I do an IFFT with each window (making > sure to put back the reflected data) which gives me 4096 samples back. > Since the original windows were non-overlapping, I should be able to > just paste the IFFT'ed windows back contiguously without overlap, > right?
Wrong. Instead of showing point by point why it's wrong, just forget it and start over.
> I seem to be getting some weird clipping noise after the > reconstruction, presumably at the borders. Is there something that I'm > misunderstanding?
Look at the description of FFT filtering at http://www.musicdsp.org/phpWiki/index.php/filtering%20in%20the%20frequency%20domain
> I've read the online DSP book that people on this group refer to and it > hasn't really helped me solve this problem. > > Thanks! > > -Salil >
-- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Ok, I understand what you mean about this not being overlap-add but
shouldn't my algorithm work nonetheless? In my case, I don't want to
run a filter over my signal. Instead, in the frequency domain, I
seriously just need to zero out certain frequency bins and change the
magnitude of others. Does zero'ing certain bins cause the problem I am
seeing? Is there anyway around this?

staufman@gmail.com wrote:
> Ok, I understand what you mean about this not being overlap-add but > shouldn't my algorithm work nonetheless?
No. If it worked, nobody would bother to do overlap-add.
> In my case, I don't want to > run a filter over my signal. Instead, in the frequency domain, I > seriously just need to zero out certain frequency bins
That never works. Infinitely sharp filters in the frequency domain introduce unacceptable artifacts into the frequency domain.
> and change the > magnitude of others. Does zero'ing certain bins cause the problem I am > seeing?
Partly, as explained above. The other part comes from the end effects that you introduced by discarding the end effects.
> Is there anyway around this?
Yes. Use a reasonable and realizable filter to do what you want. Read your on-line book or ask about filters. There's no free lunch. Jerry -- Engineering is the art of making what you want from things you can get. �����������������������������������������������������������������������
Thanks for the help thus far. I'm a bit of a newbie if you didn't
notice already. :)

The other question I have is that the clipping I see is very regular
and while the amplitude of the clipping samples change, the clipping is
clearly periodic. In fact, its periodic with the window borders. So at
every window border, there is a group of samples which are just
completely out of the range from the rest of the neighboring samples.
There must be a way to get rid of this noise cleanly. I'm going to try
running a mean filter on it but assuming this can be fixed, really
there is no other problem with the signal so while theoretically, sharp
filters don't work in the FD, in practice they seem to be fine.

Thanks!

-Salil

<staufman@gmail.com> wrote in message 
news:1120432234.744816.82470@f14g2000cwb.googlegroups.com...
> Thanks for the help thus far. I'm a bit of a newbie if you didn't > notice already. :) > > The other question I have is that the clipping I see is very regular > and while the amplitude of the clipping samples change, the clipping is > clearly periodic. In fact, its periodic with the window borders. So at > every window border, there is a group of samples which are just > completely out of the range from the rest of the neighboring samples. > There must be a way to get rid of this noise cleanly. I'm going to try > running a mean filter on it but assuming this can be fixed, really > there is no other problem with the signal so while theoretically, sharp > filters don't work in the FD, in practice they seem to be fine.
To begin, I would suggest you eliminate the filter operation (or as you say zeroing some components, changing the magnitude of others--which is exactly what filtering is). Just process your signal through the FFT and IFFT without making any changes to the frequency data. That way you can separate problems that may be caused by your FFT/IFFT process from those that are caused by the frequency-domain processing. Once you get it so the result of the FFT/IFFT sounds just like the original, then add the frequency-domain processing back in.
I've got the FFT/IFFT process working fine so I'm sure its the
frequency tweaking that is causing this. Oh yea, the reason I keep on
saying frequency zero'ing is so people don't refer me to overlap-add
because I don't think it applies to my case. I'm not filtering using a
kernel.

Thanks!

-Salil

staufman@gmail.com wrote:
> I've got the FFT/IFFT process working fine so I'm sure its the > frequency tweaking that is causing this. Oh yea, the reason I keep on > saying frequency zero'ing is so people don't refer me to overlap-add > because I don't think it applies to my case. I'm not filtering using a > kernel.
You are using a kernel; a weird one, that's all. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;