FFT
Martin Czech
martin.czech at intermetall.de
Fri Oct 22 11:02:39 CEST 1999
::: Yep Ive got an epomr with waves from the PPG/esq1/dw800/vs
:::and others on... they have all ben expanded to 256byte FULL cycle
:::waveforms. what I want to do is recreate tables, like the PPG,
:::waveterm, uwave,wave and so on do... there has to be some
:::kind of formula for doing this, somewhere...
(public posting)
Then I did not understand your intention. Sorry.
It's quite easy. I'll try to explain.
The basic problem is: your wave has harmonics with arbitrary
phase shift. What we want is to preserve the magnitude of each
harmonic (steady state sound), but alter the phase, so that the
new wave has the property w(-t) = -w(t) (written for the analog domain).
Been there, done all this (for my Waldorf Microwave I).
Recepy:
You take your full cycle wave, do a Discrete Fourier Transform (of course
one would take a the common radix 2 FFT in the case of length=2**n,
if this is not the case, and say, length is a prime number, then one
has to use the Winograd convolution FFT, which needs about 3 times
more computation time then a comparable length radix 2 FFT, but works for any
length. However, I didn't dare to program that yet....)
The result is an array of complex numbers, representing the cos and sin
magnitudes for each frequency bin, the discrete spectrum. You make a copy
of that spectrum. You take the magnitude for each bin, (geometric sum of
cos and sin component) and then you assign this magnitude only to the
sin components of the copied array, cos components get 0. Attention:
the sin magnitudes have to be antisymmetrical , too. N: lenght of DFT
array: we have to make sure that S(n)= -S(n+N/2), otherwise we get no
real wave , but a complex, which has no interpretation in our case.
This means: the magnitude for each frequency bin is the same in the copy,
but all phases are shiftet, so the wave is composed only out of sine
components, not a single cos (DC offset will be eliminated, btw.).
Sine waves have the desired property: sin(-x) = -sin(x).
Thus inverse DFT yields a real wave, with the property of anti symmetry.
If you want, I can post a Cooley-Tukey FFT core C-code to you,
with descrambler. I won't do this to the list, because of bandwidth.
After some time, all this FFT etc. stuff will apear on my homepage.
Currently I'm very busy with a convolution program.
m.c.
More information about the Synth-diy
mailing list