Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > sci.electronics.design > #510801

Re: LT Spice FFT scaling

From Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net>
Newsgroups sci.electronics.design
Subject Re: LT Spice FFT scaling
Date 2018-07-13 04:37 -0400
Organization A noiseless patient Spider
Message-ID <pi9oc2$c59$1@dont-email.me> (permalink)
References <vmb7kdtber3b9oebufudaatvgkqsl2siiq@4ax.com> <hZy1D.191200$bJ2.178507@fx15.iad>

Show all headers | View raw


On 07/11/18 22:24, bitrex wrote:
> On 07/09/2018 03:00 PM, John Larkin wrote:
>>
>>
>> Suppose I create a current source that's a sine wave, amplitude 1,
>> frequency 1, and then run a transient response. Then plot current and
>> FFT. On a linear scale, it has some harmonics (no surprise) but the
>> amplitude of the fundamental is 690 mA.
>>
>> Why 690? Is that a bad approximation of 707?
>>
>> Update: if I set the time step to 10 us, it runs slow but the FFT
>> amplitude is 706.9 mA. So the FFT reports RMS.
>>
>>
>>
> 
> 
> After some research here is a quick guide on how to get very low 
> spurious harmonic energy FFT plots in LTSpice:
> 
> 1. Turn off simulation data compression using the directive on the 
> schematic ".options plotwinsize=0"
> 
> 2. Make the maximum timestep under "Edit Simulation Command" an 
> appropriate reciprocal power of two e.g. 1/65536.
> 
> 3. Simulate for an integer number of cycles at least 8x reciprocal of 
> Nyquist frequency for given signal.
> 
> 4. In the FFT setup make "Number of data point samples in time" the same 
> power of two as above e.g. 65536.
> 
> 5. Turn off "quadratic interpolate uncompressed data."
> 
> 6. Select windowing function "Blackman."
> 
> Using that setup here's what I get for a linear-scale FFT of 100 cycles 
> of 1 Hz 2 amp p2p sine wave:
> 
> <https://imgur.com/a/natdJhq>

The trouble is that you don't know to do that when you're simulating 
something more complicated, so you can get snookered.

How important was each item?  I can well believe that turning off 
compression helped a lot, but I doubt that the window did anything 
except smear out the spectrum by a few samples.

Cheers

Phil Hobbs

-- 
Dr Philip C D Hobbs
Principal Consultant
ElectroOptical Innovations LLC / Hobbs ElectroOptics
Optics, Electro-optics, Photonics, Analog Electronics
Briarcliff Manor NY 10510

http://electrooptical.net
http://hobbs-eo.com

Back to sci.electronics.design | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

LT Spice FFT scaling John Larkin <jjlarkin@highland_snip_technology.com> - 2018-07-09 12:00 -0700
  Re: LT Spice FFT scaling Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2018-07-09 12:54 -0700
    Re: LT Spice FFT scaling John Larkin <jjlarkin@highland_snip_technology.com> - 2018-07-09 15:52 -0700
    Re: LT Spice FFT scaling Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2018-07-10 08:13 +0100
      Re: LT Spice FFT scaling Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2018-07-10 09:14 -0400
  Re: LT Spice FFT scaling boB <boB@K7IQ.com> - 2018-07-09 13:06 -0700
    Re: LT Spice FFT scaling Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2018-07-09 15:14 -0700
      Re: LT Spice FFT scaling Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2018-07-10 09:24 -0400
    Re: LT Spice FFT scaling John Larkin <jjlarkin@highland_snip_technology.com> - 2018-07-09 16:03 -0700
      Re: LT Spice FFT scaling Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2018-07-09 16:47 -0700
        Re: LT Spice FFT scaling John Larkin <jjlarkin@highland_snip_technology.com> - 2018-07-09 17:00 -0700
          Re: LT Spice FFT scaling Jim Thompson <To-Email-Use-The-Envelope-Icon@On-My-Web-Site.com> - 2018-07-09 19:53 -0700
            Re: LT Spice FFT scaling John Larkin <jjlarkin@highlandtechnology.com> - 2018-07-09 21:48 -0700
            Re: LT Spice FFT scaling Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2018-07-10 09:28 -0400
              Re: LT Spice FFT scaling John Larkin <jjlarkin@highland_snip_technology.com> - 2018-07-10 10:26 -0700
                Re: LT Spice FFT scaling Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2018-07-10 13:31 -0400
                Re: LT Spice FFT scaling Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2018-07-12 09:05 +0100
                Re: LT Spice FFT scaling Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2018-07-13 04:49 -0400
                Re: LT Spice FFT scaling Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2018-07-16 14:17 +0100
                Re: LT Spice FFT scaling Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2018-07-16 10:08 -0400
          Re: LT Spice FFT scaling bitrex <user@example.net> - 2018-07-09 23:09 -0400
            Re: LT Spice FFT scaling bitrex <user@example.net> - 2018-07-09 23:16 -0400
              Re: LT Spice FFT scaling John Larkin <jjlarkin@highland_snip_technology.com> - 2018-07-10 10:33 -0700
                Re: LT Spice FFT scaling bitrex <user@example.net> - 2018-07-10 17:10 -0400
                Re: LT Spice FFT scaling John Larkin <jjlarkin@highland_snip_technology.com> - 2018-07-10 14:37 -0700
                Re: LT Spice FFT scaling bitrex <user@example.net> - 2018-07-10 17:57 -0400
                Re: LT Spice FFT scaling upsidedown@downunder.com - 2018-07-11 09:19 +0300
                Re: LT Spice FFT scaling John Larkin <jjlarkin@highlandtechnology.com> - 2018-07-11 07:08 -0700
                Re: LT Spice FFT scaling makolber@yahoo.com - 2018-07-11 07:55 -0700
                Re: LT Spice FFT scaling John Larkin <jjlarkin@highlandtechnology.com> - 2018-07-11 08:32 -0700
                Re: LT Spice FFT scaling Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2018-07-12 09:18 +0100
                Re: LT Spice FFT scaling Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2018-07-12 09:14 +0100
  Re: LT Spice FFT scaling bitrex <user@example.net> - 2018-07-09 18:04 -0400
  Re: LT Spice FFT scaling Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2018-07-10 08:03 +0100
    Re: LT Spice FFT scaling bitrex <user@example.net> - 2018-07-10 17:53 -0400
      Re: LT Spice FFT scaling Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2018-07-11 09:04 +0100
  Re: LT Spice FFT scaling Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2018-07-10 08:41 -0400
    Re: LT Spice FFT scaling bitrex <user@example.net> - 2018-07-10 17:27 -0400
      Re: LT Spice FFT scaling John Larkin <jjlarkin@highland_snip_technology.com> - 2018-07-10 14:46 -0700
        Re: LT Spice FFT scaling bitrex <user@example.net> - 2018-07-10 19:37 -0400
      Re: LT Spice FFT scaling Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2018-07-11 21:17 -0400
  Re: LT Spice FFT scaling bitrex <user@example.net> - 2018-07-11 22:24 -0400
    Re: LT Spice FFT scaling Phil Hobbs <pcdhSpamMeSenseless@electrooptical.net> - 2018-07-13 04:37 -0400
      Re: LT Spice FFT scaling Martin Brown <'''newspam'''@nezumi.demon.co.uk> - 2018-07-16 14:18 +0100

csiph-web