[PD] help with rfft~

thewade pdman at aproximation.org
Tue Nov 29 19:42:27 CET 2005

Guten abend,

Georg Holzmann wrote:

>> There is probably some nifty trignometric relation that quickly solves:
>> Rsin(2 pi f t + arctan(B/A))=Asin(2 pi f t)+Bcos(2 pi f t)
> the relation is easy:
> from fft or rfft you get for each bin a complex number, let's say (a + 
> b*i) - so a is the left outlet, b the right one ...
> if you want polar notation:
> magnitude = r = sqrt(a^2+b^2)
> phase = phi = arctan2(a/b)
> and:
> (a+b*i) = r*e^(i*phi) = r*(cos(phi) + i*sin(phi))
> and you have r and phi now ...

Wait, (a+b*i) = frequency? If so that makes more sense as to why even 
use imaginary numbers. I don't really understand imaginary numbers - 
there more difficult for me then when I learned about inclusion in jr. high.
So if I want to solve for frequency I need to know what sqrt(-1) = i is?

>> convert to polar, multiply the frequencies, divide by niquist (I have no 
> you don't have to divide by nyquist, you have to divide by the 
> blocksize, only to normalize it ...
> and you will also need a window (hanning or so) for your signal, if 
> you want to avoid artifacts ...

It seems like if I multiply the two signals frequencies togeather all 
the frequencies would shift way up, so I have to scale them back down 
somehow, right?
Isin't convolution freq(sig1)*freq(sig2) and 
freq-mag(sig1)*freq-mag(sig2)? Maybe I just don't understand what 
convolution is trying to achieve.

Thanks again for all the help!

More information about the Pd-list mailing list