# Fourier Synthesis With Varying Frequencies Over Time

I'm doing some fourier synthesis by making bins of complex numbers, filling them out with the amplitude and phase information and using IFFT to turn that into time domain samples.

I'm able to make sine, saw, triangle and square waves, and other more exotic periodic wave forms.

My question is, how do you do fourier synth for sounds that have frequency amplitudes that change over time?

Do you do it in small windows and append them together? If so, how do you make sure the phase's line up for each frequency from window to window?

Thanks so much for any info!

You might want to have a look at the overlap-add (http://en.wikipedia.org/wiki/Overlap%E2%80%93add_method) and overlap-save (http://en.wikipedia.org/wiki/Overlap%E2%80%93save_method) methods. But, if all you are trying to do is additive synthesis, you don't absolutely have to use the IFFT to generate your signal.

You can set up a bank of $M \in {[1 \ldots N_{Osc}]}$ elementary oscilators of the form $x_m(n)=\alpha_m \times sin(\frac{2 \times \pi \times f_m \times n}{Fs}+\phi_m)$ where $m \in M, N_{Osc} \in \mathbb{N}$, $\alpha_m, \phi_m, F_s, f_m \in \mathbb{R}$ and final output $y(n) = \sum_{m \in M}{x_m(n)}$.

In this case, $\alpha_m, \phi_m$ are amplitude and phase coefficients for each oscillator at frequency $f_m$ and to make them variable in time, all you have to do is turn them to $\alpha_m(n), \phi_m(n)$, i.e. to make them dependent on time sample $n$. This can be an absolute definition, by actually defining a varying waveform or by using some form of interpolation to provide initial and final values for these quantities and let the intermediate values be calculated automatically.

This would work both for generating one sample at a time or a frame of samples at a time (by iteration) and would not have any problems with continuity.

When you search for Fourier transform pairs you can find quite a few functions in the time and frequency domain which are each others (inverse)Fourier transform. Some of these pairs also contain time domain functions, which are sinusoidal with changing amplitude over time. For example exponential decay can be written as,

$$\mathcal{L}\{e^{-at}x(t)\}=X(s+a),$$

where $\mathcal{L}\{x(t)\}=X(s)=\int_0^\infty x(t)e^{-st}dt$ and $x(t)=0$ for $t<0$. Another example would be multiplying by time,

$$\mathcal{L}\{tx(t)\}=-\frac{d}{ds}X(s),$$

by using the fact that $\mathcal{L}\{\alpha x_1(t)+\beta x_2(t)\}=\alpha X_1(s)+\beta X_2(s)$, then this can be used to construct a variable amplitude over time using a polynomial.

• I wish I could accept your answer as well as A_A's. Thanks so much for the info, I'm going to have to play with the info in both answers and see what is most practical in my usage case. Thanks!! – Alan Wolfe Mar 29 '15 at 0:11
• i surprized you accepted either. i don't think either got to the issue of using the iFFT to synthesize sound. better look into sinusoidal modeling and phase vocoder. (other references can be found.) especially to answer the question: "how do you make sure the phase's line up for each frequency from window to window?" and i gotta paper too that you can get. – robert bristow-johnson Mar 30 '15 at 2:36