SV: Re: [sdiy] Simulating SW?

Magnus Danielson cfmd at bredband.net
Sat Nov 19 15:25:59 CET 2005


From: René Schmitz <uzs159 at uni-bonn.de>
Subject: Re: SV: Re: [sdiy] Simulating SW?
Date: Sat, 19 Nov 2005 15:36:47 +0100
Message-ID: <437F387F.6040303 at uni-bonn.de>

> Hi Magnus and all,
> 
> The cause for these problems is that often the FFT algorithms are just
> used with transform lengths which are a power of 2 (since that is the
> easiest, but infact the FFT algo isn't limited to that).

Well, not quite... you are correct in the sense that one really should attempt
to match the window length to an integer number of periods, however this will
always be difficult to do in real life, but if you can come close to it and
use propper windowing you are probably going to get the best result.

The FFT algorithm is not limited to powers of 2, I agree, but it is the easiest
to implement. You can acheive practically any length, but if you have prime-
number lengths you have problems. Powers of 2 is quite nice...

> And if the actual sample length is different from the transform length they
> merely padd with zeros (ugh!),

Indeed. Some transforms instead mirrors the samples on each end of the sample
window to quasi-extend the waveform. This is better, but not good.

> or as you suggest, use windowing, both of which create artefacts.

Yes, indeed.

> Resultant spectra are that of a sinewave with
> an inserted piece of silence after each wave. Or broadened spectral
> side lobes in case of the windowing function.

The choice of window function greatly affect the broadening, but it improves
relative to non-windowed data.

> A broadened spectral lobe at the fundamental would already be considered
> THD, if one just subtracts the ideal line spectrum from the result, so
> you should thrive for a line spectrum.
> For the best results your sample length should be equal to your
> transform length and also a whole number multiple of periods of your
> signal should fit in there. The easiest interpretation is of course when
> you have a single period. Then the resulting spectrum is that of your
> signal continued smoothly in time toward +-inf, then you don't need
> windowing.

The longer window, the less will the artifacts at the ends of the window
apply. There is no absolute truth in Fourier analysis, since the artifacts by
its missuse cripples the data. For the FFT to make good data, you must have a
true integer multiples of waveform in the window and when the window is
extended to represent the signal from -inf to +inf it shall be the same signal,
i.e. transient signals or non-covered amplitude changes may not apply.
The curse with FFTs is that people don't understand the basic limitations of
the tool and learns to trim their setups accordingly.

Cheers,
Magnus




More information about the Synth-diy mailing list