[chuck-users] overlap factor amplify input signal

Aylon Eduard eduard.aylon at gmail.com
Wed Nov 21 10:36:05 EST 2007


Hi there,

In the following code ifft.last() is sometimes larger than 1, but when the
input signal has unity gain, it shouldn't be like this. Actually, what
happens, I think, is that the amplification is proportional to the overlap
factor. So should setting ifft.gain to hopsize/fftsize be the correct way to
handle this?

thanks

eduard


SinOsc s => FFT fft => IFFT ifft => dac; //blackhole;
1024 => int fftsize => fft.size;
fftsize/4 => int hopsize;
fftsize/2 => int specsize;
Windowing.blackmanHarris(fftsize) => fft.window => ifft.window;
complex spec[ specsize ];
fun void transform()
{
    fft.upchuck();
    fft.spectrum( spec );
    ifft.transform( spec );
    hopsize::samp => now;
}

while( true )
{
    if( Std.fabs(ifft.last() > 1) )
        <<< ifft.last() >>>;
    transform();
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.cs.princeton.edu/pipermail/chuck-users/attachments/20071121/845f2bf0/attachment.htm 


More information about the chuck-users mailing list