The calculation of single sinusoidal components in the time domain can be very inefficient for a large number of partials: Every partial has to be added individually for every sample - and the instantaneous amplitude has to be calculatd for every sample. IFFT synthesis can be used to compose spectra in the frequency domain, resulting in significantly less operations for many partials.
The IFFT synthesis algorithm can be used to synthesize any kind of additive sound (composed ov partials). For a known set of partial trajectories, the algorithm follows these steps:
- 1: Create empty spectrum (half).
- 2: Calculate partial positions.
- 3: Calculate partials' phases.
- 3: Place complex kernels in spectum.
- 4: Crate second half (complex conjugate mirror image).
- 5: Calculate IFFT.
- 6: Concatenate frames by either:
- a: OLA (overlap-add)
- b: NOLA (non-overlap-add)
Spectral Kernels¶
The spectral kernels $K$ in the IFFT synthesis represent truncated versions of the Fourier transform of a windowed sine. A kernel can (must) be calculated for every frequeny and phase of a sine wave. The following example shows how a kernel is generated from a time-domain template for a single frequuency and phase.
Time-Domain Template¶
The time-domain template for a sine wave $x_i[n]$, multiplied with a hann window $w[n]$. $2[n]$ is referred to as the analysis window.
Transform¶
Taking the Fourier transform of the windowed sine shown above, the spectrum results in the well-known complex sinc-like structure. We can see in the plot below that - even without truncation - the transform has less than 10 significant bins.
Many Kernels¶
Frequency Offset¶
The kernel changes in relation to its position between two neighboring FFT bins. In the following interactive plot, the kernel is moved from one bin to the other:
Phase Offset¶
For every relative phase $\varphi_i$, the kernel will have a different structure, specifically in respect to the real and imaginary parts. The following interactive plot shows how the kernel changes when shifting the phase from $0$ to $\pi$:
Overlap-Add¶
In the OLA approach, neighboring frames are stitched together with an overlap to avoid discontinuities between frames. These time-domain windows - or synthesis windows - have to overlap to result in a constant gain of $1$. The triangular window is perfect for this:
After getting our time-domain frames by IFFT, they need to be multiplied with the triangular window before overlap-adding them.
Phase Matching¶
When using OLA IFFT synthesis with the triangular windows above, we need to make sure that the phases of overlapping windows align when both frames are contributing equally.