FFT Windowing Functions in LT Spice

Discussion in 'Electronic Design' started by D from BC, Jan 7, 2008.

  1. D from BC

    D from BC Guest

    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
    Canada.
     
    D from BC, Jan 7, 2008
    #1
    1. Advertising

  2. D from BC

    john jardine Guest

    "D from BC" <> wrote in message
    news:...
    > 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
    > Canada.


    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.
     
    john jardine, Jan 7, 2008
    #2
    1. Advertising

  3. D from BC

    redbelly Guest

    On Jan 7, 9:22 am, "john jardine" <> wrote:
    > "D from BC" <> wrote in messagenews:...
    >
    >
    >
    > > 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
    > > Canada.

    >
    > 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
     
    redbelly, Jan 8, 2008
    #3
  4. D from BC

    D from BC Guest

    On Mon, 7 Jan 2008 19:52:39 -0800 (PST), redbelly
    <> wrote:

    >On Jan 7, 9:22 am, "john jardine" <> wrote:
    >> "D from BC" <> wrote in messagenews:...
    >>
    >>
    >>
    >> > 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
    >> > Canada.

    >>
    >> 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
    Canada.
     
    D from BC, Jan 8, 2008
    #4
  5. D from BC

    redbelly Guest

    On Jan 8, 12:03 am, D from BC <> wrote:
    > On Mon, 7 Jan 2008 19:52:39 -0800 (PST), redbelly
    >
    >
    >
    > <> wrote:
    > >On Jan 7, 9:22 am, "john jardine" <> wrote:
    > >> "D from BC" <> wrote in messagenews:...

    >
    > >> > 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
    > >> > Canada.

    >
    > >> 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
    > Canada.


    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.
     
    redbelly, Jan 8, 2008
    #5
  6. D from BC

    Martin Brown Guest

    On Jan 8, 5:03 am, D from BC <> wrote:
    > On Mon, 7 Jan 2008 19:52:39 -0800 (PST), redbelly
    >
    > <> wrote:
    > >On Jan 7, 9:22 am, "john jardine" <> wrote:
    > >> "D from BC" <> wrote in messagenews:...

    >
    > >> > 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
    added to your wanted signal.
    >
    > >> > 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
    having to trade resolution quite so badly.

    > >> 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
    return to near the start value after about 2x the time shown. The
    longer the continuous run of the time series you can feed into the FFT
    the less effect the edge discontinuity has on your answer.
    >
    > 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
     
    Martin Brown, Jan 8, 2008
    #6
  7. D from BC

    D from BC Guest

    On Tue, 8 Jan 2008 05:15:11 -0800 (PST), redbelly
    <> wrote:

    >On Jan 8, 12:03 am, D from BC <> wrote:
    >> On Mon, 7 Jan 2008 19:52:39 -0800 (PST), redbelly
    >>
    >>
    >>
    >> <> wrote:
    >> >On Jan 7, 9:22 am, "john jardine" <> wrote:
    >> >> "D from BC" <> wrote in messagenews:...

    >>
    >> >> > 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
    >> >> > Canada.

    >>
    >> >> 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
    >> Canada.

    >
    >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
    Canada.
     
    D from BC, Jan 8, 2008
    #7
  8. D from BC

    D from BC Guest

    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 <> wrote:
    >> On Mon, 7 Jan 2008 19:52:39 -0800 (PST), redbelly
    >>
    >> <> wrote:
    >> >On Jan 7, 9:22 am, "john jardine" <> wrote:
    >> >> "D from BC" <> wrote in messagenews:...

    >>
    >> >> > 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
    link.. (D)

    >
    >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
    >added to your wanted signal.
    >>
    >> >> > 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
    >having to trade resolution quite so badly.


    Maximum entropy methods??
    Huhh... that doesn't sound like light reading.. :)
    Googled and found
    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
    >return to near the start value after about 2x the time shown. The
    >longer the continuous run of the time series you can feed into the FFT
    >the less effect the edge discontinuity has on your answer.


    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
    Canada.
     
    D from BC, Jan 8, 2008
    #8
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. AB
    Replies:
    18
    Views:
    2,828
    Chaos Master
    Sep 4, 2003
  2. Active8
    Replies:
    9
    Views:
    1,784
    Mike Engelhardt
    Jan 7, 2004
  3. beta
    Replies:
    0
    Views:
    1,468
  4. Maxwell

    LT Spice or Visual Spice?

    Maxwell, Feb 11, 2007, in forum: Electronic Basics
    Replies:
    3
    Views:
    677
    Puckdropper
    Feb 12, 2007
  5. Spectrum analyzer: windowing

    , May 29, 2007, in forum: Electronic Equipment
    Replies:
    1
    Views:
    285
    Fred Bartoli
    May 30, 2007
Loading...

Share This Page