Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

FFT in LTspice inaccurate when only one period considered

Status
Not open for further replies.
T

treez

Guest
Hello,
Just noting the FFT of this quasi sine wave in LTspice is inaccurate when you only look at just one 20ms period……….for 40ms FFT measurement intervals or more, then the FFT is the same and presumably accurate. Why is it not accurate when you only take one 20ms period?

LTspice sim and accompanying text file attached.
 

Attachments

  • Quasi sine wave.txt
    1.4 KB · Views: 74
  • Quasi.txt
    4.1 KB · Views: 74

What do you mean with inaccurate? You apparently don't consider the effect of a windowed fourier transform.

IEC 1001 3-2 e.g. requires at least 4 periods for a FFT harmonics measurement.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
Thanks, i am finding, with the above simualtion of post#1, that when i go above 2 periods the harmonics above 2 then stay the same.....the simulation dialog box for FFT speaks of a "number of points", and so as you know, with the "2xfrequency", Nyquist theory, there is a limit to the number of periods that i can put in there, so i need to work this out.....Its not clear what the sample rate is for whatever chosen parameters.

I presume that the more periods one uses in the simulator, then the more inaccurate it gets?
I appreciate that this wouldnt be the case with a real harmonics measurement instrument in hardware.
 

The difference between 20 ms and 60 ms FFT is caused by windowing, not sample rate. Waveviewer FFT works different from .FOUR command which calculates the fourier components for harmonics over one fundamental period, equivalent to a FFT with rectangular window.

I presume that the more periods one uses in the simulator, then the more inaccurate it gets?
Might be a problem with large analysis duration due to automatic number of points setting. But you are not in this range yet.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
I've run the simulation and while yes the number of cycles does change the overall appearance of the FFT, the values of the FFT at the harmonic frequencies of interest do not change, as expected. As FvM suggests, this is due to the window width changing as well. As the number of cycles approaches infinity, the FFT will appear as a fourier series instead of a DFT. But the harmonic values will not change, so it's a moot point.
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top