It's my first post and so I've searched some topics about fftw, trying not
to ask something alredy answered and I didn't find anything about it, so
I'd like to ask your help about using fftw...
I'm a borland c++ builder user (bc++ 5) and fftw runs smooth and fast
calculating the fft of my real data (audio data) ... but I get problems
when I try to deallocate the fft output buffer I created with fftw_malloc
Here is some of the code I'm using...
// Dados que ser�o utilizados pela FFTW
BufferEntradaFFT = (double *) calloc (TamanhoBufferFFT,
BufferDadosRetirados = (short *) calloc (TamanhoBufferFFT)
BufferResultadoFFT = (fftw_complex *) fftw_malloc(sizeof(fftw_complex) *
planoExecFFT = fftw_plan_dft_r2c_1d(TamanhoBufferFFT, BufferEntradaFFT,
for (x=0; (x+(TamanhoBufferFFT*arquivoWAV.getNCanais())) <
x+=(TamanhoBufferFFT*(arquivoWAV.getNCanais()*0.5))) //Window 50% overlap
//Here I feed BufferEntradaFFT with my audio data windowed with
// Here I call my stuff to use the fft data I got from fftw_execute
// ----------desalocar recursos!
fftw_free(BufferResultadoFFT); // Here I get the problem ...
The message I get from my executable file is :
"Access violation at address 784AC8E1 in module "ntdll.dll". Write of
But the funny part is, if I comment the line
I get no exception and the rotine works fine.
I do not know what I should do make this go away ... so I'm here asking
for your help...
And yes! I know it's not a programming forum, but many of you guys use
fftw without any trouble, so maybe you could point me into a direction.
Reply by ●November 9, 20052005-11-09
Finally I discovered the problem!
The FFT vector in a real to complex FFT should have n/2+1 bins, and I only
Thanks to the ones who at least took a look at that thread and sorry for
such a stupid doubt! hehehe
Reply by Richard Owlett●November 9, 20052005-11-09
Gabriel Sim�es wrote:
> Finally I discovered the problem!
> The FFT vector in a real to complex FFT should have n/2+1 bins, and I only
> allocated n/2!
> Thanks to the ones who at least took a look at that thread and sorry for
> such a stupid doubt! hehehe
"The only *DUMB* question is the one you do not ask" :)