[LAD] Help with frequency domain filtering basics

Olivier Guilyardi list at samalyse.com
Wed Nov 25 17:52:00 UTC 2009


Hi,

I'm trying to do a simple effect in the frequency domain, nothing extraordinary.
I need to apply various gains to specific frequencies.

For this purpose, I want to process a 16bit audio input stream, block by block,
apply a hanning window, do a fft, now apply my effect, and then an inverse fft,
followed by overlap and add buffering.

For now, I'm simply trying to do all of this without applying any effect, just
to see if my time to frequency and back conversion is correct.

I managed to do this in Octave. Now, I'm trying to do it in C with fftw and the
sound I obtain is like "shivering". It's recognizable but severely altered. I've
spent hours on this, it just won't work.

Attached :
- freqfilter.m: my working octave version
- transform.h and transform.c: time -> frequency -> time routines
- transformtest.c: test program

Could anyone tell me what's wrong with this C code?

Thanks in advance

--
  Olivier
-------------- next part --------------
A non-text attachment was scrubbed...
Name: freqfilter.m
Type: text/x-objcsrc
Size: 1316 bytes
Desc: not available
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20091125/f46bf803/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transform.h
Type: text/x-chdr
Size: 584 bytes
Desc: not available
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20091125/f46bf803/attachment.h>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transform.c
Type: text/x-csrc
Size: 3295 bytes
Desc: not available
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20091125/f46bf803/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: transformtest.c
Type: text/x-csrc
Size: 1350 bytes
Desc: not available
URL: <http://lists.linuxaudio.org/pipermail/linux-audio-dev/attachments/20091125/f46bf803/attachment-0001.c>


More information about the Linux-audio-dev mailing list