Electronics Forums > FFT Windowing Functions in LT Spice

# FFT Windowing Functions in LT Spice

D from BC
Guest
Posts: n/a

 01-07-2008, 09:28 AM
Got a homework question, but not in school.

FFT windowing functions in LTSpice.
None
Welch
Bartlett
Hamming
Hann
Blackman
Lanczos
Parzen
Kaiser Bessel

I no idea when each are applied.

Looked at
http://en.wikipedia.org/wiki/Window_function
Geezz Not exactly easy late night reading.

Saw the audio slide show tutorial on
http://www.ni.com/swf/presentation/us/windowing/

Type of Signal | Window
------------------+------------
Sine waves | Hanning
Spectral analysis Hanning (for random excitation)

Transients longer
than length of window Hanning
Unknown content Hanning

Two tone
with close f Kaiser Bessel

Transients duration
longer than the length
of the window Rectangular

The 'none' (no window) choice in LTSpice means rectangular.

Who uses Welch?

D from BC
British Columbia

john jardine
Guest
Posts: n/a

 01-07-2008, 02:22 PM

"D from BC" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Got a homework question, but not in school.
>
> FFT windowing functions in LTSpice.
> None
> Welch
> Bartlett
> Hamming
> Hann
> Blackman
> Lanczos
> Parzen
> Kaiser Bessel
>
> I no idea when each are applied.
>
> Looked at
> http://en.wikipedia.org/wiki/Window_function
> Geezz Not exactly easy late night reading.
>
> Saw the audio slide show tutorial on
> http://www.ni.com/swf/presentation/us/windowing/
>
> Type of Signal | Window
> ------------------+------------
> Sine waves | Hanning
> Spectral analysis Hanning (for random excitation)
>
> Transients longer
> than length of window Hanning
> Unknown content Hanning
>
> Two tone
> with close f Kaiser Bessel
>
> Transients duration
> longer than the length
> of the window Rectangular
>
> The 'none' (no window) choice in LTSpice means rectangular.
>
> Who uses Welch?
>
>
> D from BC
> British Columbia

I don't use 'em, more trouble than they're worth and all much of a muchness.
Perhaps useful on limited data sets but what's the point of doing a sim in
the first place?.
I FFT the raw data with no window but do it over say 100 cycles. The start
and stop discontinuities automatically lose themselves in the noise.
More relevant to a worthwhile FFT is getting the number of data points up.
If pushed I'd use the Blackman window.

redbelly
Guest
Posts: n/a

 01-08-2008, 03:52 AM
On Jan 7, 9:22 am, "john jardine" <(E-Mail Removed)> wrote:
> "D from BC" <(E-Mail Removed)> wrote in messagenews:1go3o35nobptkttckeb5tqf2b8bl1ssl9r@4ax .com...
>
>
>
> > Got a homework question, but not in school.

>
> > FFT windowing functions in LTSpice.
> > None
> > Welch
> > Bartlett
> > Hamming
> > Hann
> > Blackman
> > Lanczos
> > Parzen
> > Kaiser Bessel

>
> > I no idea when each are applied.

>
> > Looked at
> >http://en.wikipedia.org/wiki/Window_function
> > Geezz Not exactly easy late night reading.

>
> > Saw the audio slide show tutorial on
> >http://www.ni.com/swf/presentation/us/windowing/

>
> > Type of Signal | Window
> > ------------------+------------
> > Sine waves | Hanning
> > Spectral analysis Hanning (for random excitation)

>
> > Transients longer
> > than length of window Hanning
> > Unknown content Hanning

>
> > Two tone
> > with close f Kaiser Bessel

>
> > Transients duration
> > longer than the length
> > of the window Rectangular

>
> > The 'none' (no window) choice in LTSpice means rectangular.

>
> > Who uses Welch?

>
> > D from BC
> > British Columbia

>
> I don't use 'em, more trouble than they're worth and all much of a muchness.
> Perhaps useful on limited data sets but what's the point of doing a sim in
> the first place?.
> I FFT the raw data with no window but do it over say 100 cycles. The start
> and stop discontinuities automatically lose themselves in the noise.
> More relevant to a worthwhile FFT is getting the number of data points up.
> If pushed I'd use the Blackman window.

If your waveform is periodic, and the sampling time is an integer
multiple of the period, no windowing is necessary.

If the waveform is not periodic, OR if the sampling time is not an
integer multiple of the period, then one should use a window.

Mark

D from BC
Guest
Posts: n/a

 01-08-2008, 05:03 AM
On Mon, 7 Jan 2008 19:52:39 -0800 (PST), redbelly
<(E-Mail Removed)> wrote:

>On Jan 7, 9:22 am, "john jardine" <(E-Mail Removed)> wrote:
>> "D from BC" <(E-Mail Removed)> wrote in messagenews:1go3o35nobptkttckeb5tqf2b8bl1ssl9r@4ax .com...
>>
>>
>>
>> > Got a homework question, but not in school.

>>
>> > FFT windowing functions in LTSpice.
>> > None
>> > Welch
>> > Bartlett
>> > Hamming
>> > Hann
>> > Blackman
>> > Lanczos
>> > Parzen
>> > Kaiser Bessel

>>
>> > I no idea when each are applied.

>>
>> > Looked at
>> >http://en.wikipedia.org/wiki/Window_function
>> > Geezz Not exactly easy late night reading.

>>
>> > Saw the audio slide show tutorial on
>> >http://www.ni.com/swf/presentation/us/windowing/

>>
>> > Type of Signal | Window
>> > ------------------+------------
>> > Sine waves | Hanning
>> > Spectral analysis Hanning (for random excitation)

>>
>> > Transients longer
>> > than length of window Hanning
>> > Unknown content Hanning

>>
>> > Two tone
>> > with close f Kaiser Bessel

>>
>> > Transients duration
>> > longer than the length
>> > of the window Rectangular

>>
>> > The 'none' (no window) choice in LTSpice means rectangular.

>>
>> > Who uses Welch?

>>
>> > D from BC
>> > British Columbia

>>
>> I don't use 'em, more trouble than they're worth and all much of a muchness.
>> Perhaps useful on limited data sets but what's the point of doing a sim in
>> the first place?.
>> I FFT the raw data with no window but do it over say 100 cycles. The start
>> and stop discontinuities automatically lose themselves in the noise.
>> More relevant to a worthwhile FFT is getting the number of data points up.
>> If pushed I'd use the Blackman window.

>
>If your waveform is periodic, and the sampling time is an integer
>multiple of the period, no windowing is necessary.
>
>If the waveform is not periodic, OR if the sampling time is not an
>integer multiple of the period, then one should use a window.
>
>Mark

Interesting...
I don't think I can get LT Spice data points that are an integer
multiple of the period..

Here's the wave (time domain) that I'm trying out spectrum analysis
on.
Among the crazy modulation, one can see a main frequency.
http://www.members.shaw.ca/chainsaw/SED/Crazywave.wmf
328Kb

D from BC
British Columbia

redbelly
Guest
Posts: n/a

 01-08-2008, 01:15 PM
On Jan 8, 12:03 am, D from BC <(E-Mail Removed)> wrote:
> On Mon, 7 Jan 2008 19:52:39 -0800 (PST), redbelly
>
>
>
> <(E-Mail Removed)> wrote:
> >On Jan 7, 9:22 am, "john jardine" <(E-Mail Removed)> wrote:
> >> "D from BC" <(E-Mail Removed)> wrote in messagenews:1go3o35nobptkttckeb5tqf2b8bl1ssl9r@4ax .com...

>
> >> > Got a homework question, but not in school.

>
> >> > FFT windowing functions in LTSpice.
> >> > None
> >> > Welch
> >> > Bartlett
> >> > Hamming
> >> > Hann
> >> > Blackman
> >> > Lanczos
> >> > Parzen
> >> > Kaiser Bessel

>
> >> > I no idea when each are applied.

>
> >> > Looked at
> >> >http://en.wikipedia.org/wiki/Window_function
> >> > Geezz Not exactly easy late night reading.

>
> >> > Saw the audio slide show tutorial on
> >> >http://www.ni.com/swf/presentation/us/windowing/

>
> >> > Type of Signal | Window
> >> > ------------------+------------
> >> > Sine waves | Hanning
> >> > Spectral analysis Hanning (for random excitation)

>
> >> > Transients longer
> >> > than length of window Hanning
> >> > Unknown content Hanning

>
> >> > Two tone
> >> > with close f Kaiser Bessel

>
> >> > Transients duration
> >> > longer than the length
> >> > of the window Rectangular

>
> >> > The 'none' (no window) choice in LTSpice means rectangular.

>
> >> > Who uses Welch?

>
> >> > D from BC
> >> > British Columbia

>
> >> I don't use 'em, more trouble than they're worth and all much of a muchness.
> >> Perhaps useful on limited data sets but what's the point of doing a sim in
> >> the first place?.
> >> I FFT the raw data with no window but do it over say 100 cycles. The start
> >> and stop discontinuities automatically lose themselves in the noise.
> >> More relevant to a worthwhile FFT is getting the number of data points up.
> >> If pushed I'd use the Blackman window.

>
> >If your waveform is periodic, and the sampling time is an integer
> >multiple of the period, no windowing is necessary.

>
> >If the waveform is not periodic, OR if the sampling time is not an
> >integer multiple of the period, then one should use a window.

>
> >Mark

>
> Interesting...
> I don't think I can get LT Spice data points that are an integer
> multiple of the period..
>
> Here's the wave (time domain) that I'm trying out spectrum analysis
> on.
> Among the crazy modulation, one can see a main frequency.http://www.members.shaw.ca/chainsaw/SED/Crazywave.wmf
> 328Kb
>
> D from BC
> British Columbia

Okay, looks like windowing would be a really good idea for that
waveform. The "slow drift" during the scan is from low frequencies
that:
1. are impossible to get an accurate spectrum for, given your sample
time, and
2. will "leak" into frequencies you would like to have an accurate
spectrum for.

I'd try a Hamming, as well as either Hann, Gauss, or Blackman. You
may or may not see a significant difference between them, but you'll
be better off than not using any window.

Mark

p.s. Many people say "Hanning" to refer to the Hann window. It was
named for Julius von Hann.

Martin Brown
Guest
Posts: n/a

 01-08-2008, 01:57 PM
On Jan 8, 5:03*am, D from BC <(E-Mail Removed)> wrote:
> On Mon, 7 Jan 2008 19:52:39 -0800 (PST), redbelly
>
> <(E-Mail Removed)> wrote:
> >On Jan 7, 9:22 am, "john jardine" <(E-Mail Removed)> wrote:
> >> "D from BC" <(E-Mail Removed)> wrote in messagenews:1go3o35nobptkttckeb5tqf2b8bl1ssl9r@4ax .com...

>
> >> > Got a homework question, but not in school.

>
> >> > FFT windowing functions in LTSpice.
> >> > None
> >> > Welch
> >> > Bartlett
> >> > Hamming
> >> > Hann
> >> > Blackman
> >> > Lanczos
> >> > Parzen
> >> > Kaiser Bessel

>
> >> > I no idea when each are applied.

>
> >> > Looked at
> >> >http://en.wikipedia.org/wiki/Window_function
> >> > Geezz Not exactly easy late night reading.

>
> >> > Saw the audio slide show tutorial on
> >> >http://www.ni.com/swf/presentation/us/windowing/

>
> >> > Type of Signal * *| * *Window
> >> > ------------------+------------
> >> > Sine waves * * * *| * *Hanning
> >> > Spectral analysis * * *Hanning (for random excitation)

>
> >> > Transients longer
> >> > than length of window *Hanning
> >> > Unknown content * * * *Hanning

>
> >> > Two tone
> >> > with close f * * * * *Kaiser Bessel

In your case this might be a good choice. There are clear hints of (at
least) two close frequencies (~10% different) beating mostly visible
between 273us and 282us. If you can manage it create a data record
that is at least piecewise continuous across the start and end
boundary before applying any windowing.

It is implicit in the FFT that the time series is tiled periodically
so if you have a big difference between the first and last samples as
in this case you get roughly the FFT of an unwanted sawtooth wave
>
> >> > The 'none' (no window) choice in LTSpice means rectangular.

Crude but gives you the highest resolution as well as the worst
artefacts. Each window allows you to trade resolution in frequency
against signal to noise in the transform. These days maximum entropy
methods can be used to compute the spectrum of a time series without

> >> I don't use 'em, more trouble than they're worth and all much of a muchness.
> >> Perhaps useful on limited data sets but what's the point of doing a simin
> >> the first place?.
> >> I FFT the raw data with no window but do it over say 100 cycles. The start
> >> and stop discontinuities automatically lose themselves in the noise.
> >> More relevant to a worthwhile FFT is getting the number of data points up.
> >> If pushed I'd use the Blackman window.

>
> >If your waveform is periodic, and the sampling time is an integer
> >multiple of the period, no windowing is necessary.

>
> >If the waveform is not periodic, OR if the sampling time is not an
> >integer multiple of the period, then one should use a window.

>
> >Mark

>
> Interesting...
> I don't think I can get LT Spice data points that are an integer
> multiple of the period..

But you should try to get the function sampled over a period that
makes it continuous. If that low frequency is real then it should
longer the continuous run of the time series you can feed into the FFT
>
> Here's the wave (time domain) that I'm trying out spectrum analysis
> on.
> Among the crazy modulation, one can see a main frequency.http://www.members.shaw.ca/chainsaw/SED/Crazywave.wmf
> 328Kb

Regards,
Martin Brown

D from BC
Guest
Posts: n/a

 01-08-2008, 06:58 PM
On Tue, 8 Jan 2008 05:15:11 -0800 (PST), redbelly
<(E-Mail Removed)> wrote:

>On Jan 8, 12:03 am, D from BC <(E-Mail Removed)> wrote:
>> On Mon, 7 Jan 2008 19:52:39 -0800 (PST), redbelly
>>
>>
>>
>> <(E-Mail Removed)> wrote:
>> >On Jan 7, 9:22 am, "john jardine" <(E-Mail Removed)> wrote:
>> >> "D from BC" <(E-Mail Removed)> wrote in messagenews:1go3o35nobptkttckeb5tqf2b8bl1ssl9r@4ax .com...

>>
>> >> > Got a homework question, but not in school.

>>
>> >> > FFT windowing functions in LTSpice.
>> >> > None
>> >> > Welch
>> >> > Bartlett
>> >> > Hamming
>> >> > Hann
>> >> > Blackman
>> >> > Lanczos
>> >> > Parzen
>> >> > Kaiser Bessel

>>
>> >> > I no idea when each are applied.

>>
>> >> > Looked at
>> >> >http://en.wikipedia.org/wiki/Window_function
>> >> > Geezz Not exactly easy late night reading.

>>
>> >> > Saw the audio slide show tutorial on
>> >> >http://www.ni.com/swf/presentation/us/windowing/

>>
>> >> > Type of Signal | Window
>> >> > ------------------+------------
>> >> > Sine waves | Hanning
>> >> > Spectral analysis Hanning (for random excitation)

>>
>> >> > Transients longer
>> >> > than length of window Hanning
>> >> > Unknown content Hanning

>>
>> >> > Two tone
>> >> > with close f Kaiser Bessel

>>
>> >> > Transients duration
>> >> > longer than the length
>> >> > of the window Rectangular

>>
>> >> > The 'none' (no window) choice in LTSpice means rectangular.

>>
>> >> > Who uses Welch?

>>
>> >> > D from BC
>> >> > British Columbia

>>
>> >> I don't use 'em, more trouble than they're worth and all much of a muchness.
>> >> Perhaps useful on limited data sets but what's the point of doing a sim in
>> >> the first place?.
>> >> I FFT the raw data with no window but do it over say 100 cycles. The start
>> >> and stop discontinuities automatically lose themselves in the noise.
>> >> More relevant to a worthwhile FFT is getting the number of data points up.
>> >> If pushed I'd use the Blackman window.

>>
>> >If your waveform is periodic, and the sampling time is an integer
>> >multiple of the period, no windowing is necessary.

>>
>> >If the waveform is not periodic, OR if the sampling time is not an
>> >integer multiple of the period, then one should use a window.

>>
>> >Mark

>>
>> Interesting...
>> I don't think I can get LT Spice data points that are an integer
>> multiple of the period..
>>
>> Here's the wave (time domain) that I'm trying out spectrum analysis
>> on.
>> Among the crazy modulation, one can see a main frequency.http://www.members.shaw.ca/chainsaw/SED/Crazywave.wmf
>> 328Kb
>>
>> D from BC
>> British Columbia

>
>Okay, looks like windowing would be a really good idea for that
>waveform. The "slow drift" during the scan is from low frequencies
>that:
>1. are impossible to get an accurate spectrum for, given your sample
>time, and
>2. will "leak" into frequencies you would like to have an accurate
>spectrum for.
>
>I'd try a Hamming, as well as either Hann, Gauss, or Blackman. You
>may or may not see a significant difference between them, but you'll
>be better off than not using any window.
>
>Mark
>
>p.s. Many people say "Hanning" to refer to the Hann window. It was
>named for Julius von Hann.

Yup.. That pic is <100uS ..
The >1mS oscillograph had hard to see HF detail.
I zoomed in to show the HF detail.

I'll use more time data for better spectral LF accuracy.
I'm just learning about spectral leakage. (Do I need a diaper? :P )
However...
I'm learning EMI sim'ing with spice.
Perhaps I should high pass filter at ~1Mhz prior to FFT ?

Note:
These two could be mistaken:
Hanning
Hamming

I suspect that's why it's listed 'Hann' and not Hanning in LTSpice.

D from BC
British Columbia

D from BC
Guest
Posts: n/a

 01-08-2008, 07:27 PM
On Tue, 8 Jan 2008 05:57:12 -0800 (PST), Martin Brown
<|||newspam|||@nezumi.demon.co.uk> wrote:

>On Jan 8, 5:03*am, D from BC <(E-Mail Removed)> wrote:
>> On Mon, 7 Jan 2008 19:52:39 -0800 (PST), redbelly
>>
>> <(E-Mail Removed)> wrote:
>> >On Jan 7, 9:22 am, "john jardine" <(E-Mail Removed)> wrote:
>> >> "D from BC" <(E-Mail Removed)> wrote in messagenews:1go3o35nobptkttckeb5tqf2b8bl1ssl9r@4ax .com...

>>
>> >> > Got a homework question, but not in school.

>>
>> >> > FFT windowing functions in LTSpice.
>> >> > None
>> >> > Welch
>> >> > Bartlett
>> >> > Hamming
>> >> > Hann
>> >> > Blackman
>> >> > Lanczos
>> >> > Parzen
>> >> > Kaiser Bessel

>>
>> >> > I no idea when each are applied.

>>
>> >> > Looked at
>> >> >http://en.wikipedia.org/wiki/Window_function
>> >> > Geezz Not exactly easy late night reading.

>>
>> >> > Saw the audio slide show tutorial on
>> >> >http://www.ni.com/swf/presentation/us/windowing/

>>
>> >> > Type of Signal * *| * *Window
>> >> > ------------------+------------
>> >> > Sine waves * * * *| * *Hanning
>> >> > Spectral analysis * * *Hanning (for random excitation)

>>
>> >> > Transients longer
>> >> > than length of window *Hanning
>> >> > Unknown content * * * *Hanning

>>
>> >> > Two tone
>> >> > with close f * * * * *Kaiser Bessel

>
>In your case this might be a good choice. There are clear hints of (at
>least) two close frequencies (~10% different) beating mostly visible
>between 273us and 282us. If you can manage it create a data record
>that is at least piecewise continuous across the start and end
>boundary before applying any windowing.

Neato I'll try that. .
That 'clicks in' from what I recall from that slide show tutorial

>
>It is implicit in the FFT that the time series is tiled periodically
>so if you have a big difference between the first and last samples as
>in this case you get roughly the FFT of an unwanted sawtooth wave
>>
>> >> > The 'none' (no window) choice in LTSpice means rectangular.

>
>Crude but gives you the highest resolution as well as the worst
>artefacts. Each window allows you to trade resolution in frequency
>against signal to noise in the transform. These days maximum entropy
>methods can be used to compute the spectrum of a time series without

Maximum entropy methods??
Huhh... that doesn't sound like light reading..
http://cmm.cit.nih.gov/maxent/cos.html
??? Wow looks like MEM is better than FFT.
Now I'm wondering why it's not included in LTSpice... (D)

>
>> >> I don't use 'em, more trouble than they're worth and all much of a muchness.
>> >> Perhaps useful on limited data sets but what's the point of doing a sim in
>> >> the first place?.
>> >> I FFT the raw data with no window but do it over say 100 cycles. The start
>> >> and stop discontinuities automatically lose themselves in the noise.
>> >> More relevant to a worthwhile FFT is getting the number of data points up.
>> >> If pushed I'd use the Blackman window.

>>
>> >If your waveform is periodic, and the sampling time is an integer
>> >multiple of the period, no windowing is necessary.

>>
>> >If the waveform is not periodic, OR if the sampling time is not an
>> >integer multiple of the period, then one should use a window.

>>
>> >Mark

>>
>> Interesting...
>> I don't think I can get LT Spice data points that are an integer
>> multiple of the period..

>
>But you should try to get the function sampled over a period that
>makes it continuous. If that low frequency is real then it should
>longer the continuous run of the time series you can feed into the FFT

Ahhhh... Thanks..

>>
>> Here's the wave (time domain) that I'm trying out spectrum analysis
>> on.
>> Among the crazy modulation, one can see a main frequency.http://www.members.shaw.ca/chainsaw/SED/Crazywave.wmf
>> 328Kb

>
>Regards,
>Martin Brown

D from BC
British Columbia