When simulating a sine generator using .FOUR func, Total Harmonic Distortion in spice log is less than Partial Harmonic Distortion, why?
When simulating a sine generator using .FOUR func, Total Harmonic Distortion in spice log is less than Partial Harmonic Distortion, why?
Sine generator 2.ascAnd here is my sim file. Thx!
Dear EvernessW ,
Please turn off waveform compression. .four is a post processing step that needs high quality data.
Best Regards,
Mathias
Thank you for your response; the initial issue has been resolved. However, I have encountered a new problem. In the circuit, there is a sine wave generator producing VSine1 and its output after passing through a band-pass filter, labeled Vout. From the FFT plot, the harmonic components of Vout are much smaller than those of VSine1. However, in the .FOUR analysis, there is no significant difference in the Total Harmonic Distortion (THD) between the two, and the harmonic components of Vout are calculated to be quite large. Do you have any thoughts on this?
The waveform is shown in the figure below. I use 40 period to calculate .FOUR.
FFT with blackman-harris window shows:
And .FOUR output is:
I use an external spice model of x182Q1. Rename it to OPAx192-Q1.asy if you need it.
Thank you for your response; the initial issue has been resolved. However, I have encountered a new problem. In the circuit, there is a sine wave generator producing VSine1 and its output after passing through a band-pass filter, labeled Vout. From the FFT plot, the harmonic components of Vout are much smaller than those of VSine1. However, in the .FOUR analysis, there is no significant difference in the Total Harmonic Distortion (THD) between the two, and the harmonic components of Vout are calculated to be quite large. Do you have any thoughts on this?
The waveform is shown in the figure below. I use 40 period to calculate .FOUR.
FFT with blackman-harris window shows:
And .FOUR output is:
I use an external spice model of x182Q1. Rename it to OPAx192-Q1.asy if you need it.
Dear EvernessW ,
I can't reproduces this, as I would also need the lib file of the OPAx192.
Anyway, in this case .four is not a good tool, because you need to tell it a priori what the fundamental frequency is. That's because .four assumes that the signal is periodic (with the given frequency) and thus can be expressed as a Fourier series. However, you don't exactly know the frequency, because your signal comes from a free running oscillator circuit. If its frequency is even slightly off the .four spec, you'll get results very different from the FFT.
Thus, only use the FFT. Unfortunately, there is currently no way to automate this within LTspice.
Best Regards,
Mathias
Thank you for your assistance. I am now exporting the simulation data to external programs for signal processing.