SV: Re: [sdiy] Simulating SW?
Magnus Danielson
cfmd at bredband.net
Sat Nov 19 13:24:25 CET 2005
From: James Patchell <patchell at cox.net>
Subject: Re: SV: Re: [sdiy] Simulating SW?
Date: Fri, 18 Nov 2005 13:59:43 -0800
Message-ID: <5.2.1.1.2.20051118135514.020e6c30 at pop.west.cox.net>
Hi!
> At 10:20 PM 11/18/2005 +0100, karl dalen wrote:
> >Thanks for the spice sugestion Jim!
> >I downloaded it and now trying to use it properly!:)
> >
> >However i havent simulated before!
> >(oh, that was a bad one) :)
> >
> >When i run the FFT on a single sine wave i get spurious harmonics, first harmo
> >are displayed 60db below fundamental
> >and so on.
> >
> >Is this due to the number of samples in the AC sine
> >model or the number of FFT points or what?
> >
> >The more FFT sample points i use the worser the result gets!
> >Im used to get one spike in the diagram showing the fundamental
> >and spurious noise a 140db below! And no harmonics!!
> >
> >And the signal floor are constantly changing due
> >to number of FFT sample points set? Really wierd!
>
> I have never used the FFT feature. I generally avoid them because there
> are a lot of variables that need to be considered. This is probably a good
> question to be answered by the more mathematically inclined people on the
> list (hint..hint...Magnus...:-)
Ok, James, I'll give you a hint... ;O)
What you see is a classic problem, what happends is that the sine is not a
perfect multiple of the FFT window-size. This is a drawback of the Fourier
Transformation itself (and not only the Fast Fourier Transformation, just to be
picky). Only frequencies being perfect multiples of the FFT window (thus the
lowest frequency in the FFT window) will be represented without distorsion.
The reason is that the two ends of the waveform does not match up if you extend
the window with itself, you get a jump in level since you does not have the
same phase. There is however a semi-scientifical cure for this, the use of a
windowing function. What you do is that you multiply each sample with a
suitable weighing value, which the weighing function calculate for that sample.
Weiging functions is typical symmetrical around the mid of the window, has
higest gain in the middle and then weighs the start and end samples very low,
so that the extention of the windows occur at zero amplitude. You have
basically changed the envelope of the whole signal. You have affected the
signal, but it through a distorsion, but on the other hand you gained the
reduction (and only reduction, not removal) of the spurious parts due to
non-multiple waveforms. The result will lye a little too you, but it works
well enought. A popular windowing function is the Hanning-window, but others
such as the Kaiser-window and raised cosine window exists. I have not cared to
remember all the details about these, but I do have a classic article about it
lying around in hardprint somewhere. However, a search for FFT and Windowing
functions should get you on the right track.
I hope that made some sense...
As for being a mathematical thing... windowing functions are a mathematical
wart sitting on the ugly head of the Fourier Transformation beast. It takes
some of the uglyness out of the ugly head, but it is still a wart. It is just
very practical spot to hit when you need to have the ugly beast behave properly
for a little while...
But then again, Fourier Transformation is so limited... with LaPlace/Z
Transformation however... ;O)
Cheers,
Magnus
More information about the Synth-diy
mailing list