| This code may be buggy:
if (!(fftsize & (fftsize - 1))){
csound->RealFFT(csound, signal, fftsize);
csound->RealFFT(csound, diffsig, fftsize);
} else {
csound->RealFFTnp2(csound, signal, fftsize);
csound->RealFFTnp2(csound, diffsig, fftsize);
}
The problem is that csoundRealFFT() and csoundRealFFTnp2() have
different output formats.
csound->RealFFT(csound, buf, N);
this requires 'buf' to have enough space for N elements, and
stores the real part of the Nyquist frequency bin in buf[1]
csound->RealFFTnp2(csound, buf, N);
'buf' should have enough space for N + 2 elements, and this
time the Nyquist frequency component is stored in buf[N];
buf[1] and buf[N+1] will be zero.
-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Csound-devel mailing list
Csound-devel@lists.sourceforge.net |