Differences
This shows you the differences between two versions of the page.
Both sides previous revision
Previous revision
|
|
sarah_oscillator_details [2017/09/05 23:38] shane [Format of frequency-domain coefficient tables] |
sarah_oscillator_details [2017/09/05 23:42] (current) shane [The resulting code] |
* The ''for'' loop runs through the harmonic indices 1 through ''maxHarmonicToRetain'', copies both the positive and negative-frequency coefficients out of the master table (a pointer to which is returned by //SynthOscillatorBase::getFourierTable(waveform)//, and then scales the resulting copies by a factor ''fv'' computed by an expression which models the response curve of a simple low-pass filter with a given cutoff frequency (expressed in cycles per sample) and slope (expressed in dB per octave). | * The ''for'' loop runs through the harmonic indices 1 through ''maxHarmonicToRetain'', copies both the positive and negative-frequency coefficients out of the master table (a pointer to which is returned by //SynthOscillatorBase::getFourierTable(waveform)//, and then scales the resulting copies by a factor ''fv'' computed by an expression which models the response curve of a simple low-pass filter with a given cutoff frequency (expressed in cycles per sample) and slope (expressed in dB per octave). |
* Finally, we request an inverse FFT on the ''waveTable[]'' array. | * Finally, we request an inverse FFT on the ''waveTable[]'' array. |
| |
| The astute reader will have noted that the ''for'' loop skips the 0th harmonic. The 0th harmonic of an digitized AC signal represents the //DC component// (net offset from zero) which is neither audible nor desirable in a digital signal processing system. Ensuring that the 0th-harmonic coefficient is always zero results in output waveforms which are guaranteed to be symmetric about zero---yet another free gift from the FFT. |
| |
===== "Real-Only" FFT ===== | ===== "Real-Only" FFT ===== |