The Designer's Guide Community Forum
https://designers-guide.org/forum/YaBB.pl Simulators >> Circuit Simulators >> Accurate Fourier analysis for circuit simulators https://designers-guide.org/forum/YaBB.pl?num=1199039997 Message started by Visjnoe on Dec 30th, 2007, 10:39am |
Title: Accurate Fourier analysis for circuit simulators Post by Visjnoe on Dec 30th, 2007, 10:39am Dear Ken, I recently read the paper "Accurate Fourier analysis for circuit simulators". I don't have access to Spectre, therefore I wanted to try out the described Fourier analysis by writing a custom MATLAB script that processes the SPICE output. I wanted to start on the ua741 example from the paper to have a good reference and than go forward from there. However, when trying to reproduce the 'normal' Fourier analysis results from SPICE, I could not come up with the numbers presented in the paper. These are the numbers SPICE reports (THD is smaller than reported in the paper): Code:
I see some possible causes for this and it would be nice if you could comment on them: 1. Different SPICE version: I used spice3f5 while the paper mentions spice2g6. 2. SPICE testbench: this is my SPICE deck: Code:
3. ua741 model: I used the so called Oregano model: Code:
My gut feeling says the model is the culprit... Kind Regards Peter |
Title: Re: Accurate Fourier analysis for circuit simulato Post by Ken Kundert on Dec 31st, 2007, 12:39am Fourier analysis accuracy is a sensitive function of the circuit, the simulator, and the options. Any of the changes you made could account for the difference. I used an actual transistor model of the circuit, not a macromodel. I have included it below, but I could not find the SPICE netlist, all I had was a Spectre netlist. Code:
The real value of the method presented in that paper will not be demonstrated with the ua741. It differs from standard Fourier analysis in that it includes every point in the calculation, whereas traditional Fourier analysis samples the waveform first. There are certain types of circuits where sampling discards important information, circuits such as pulse width modulators. This approach is indispensable for such circuits. For other circuits, circuits like the ua741, the method tends to be a bit better than traditional methods if you only need a few harmonics because more attention is focused on controlling errors. You will likely not see this benefit when post-processing the waveforms with Matlab because the errors are controlled by changing the behavior of the simulator algorithms. If you need lots of harmonics, a traditional approach based on the FFT is best. -Ken |
Title: Re: Accurate Fourier analysis for circuit simulato Post by Visjnoe on Dec 31st, 2007, 3:19am Dear Ken, thank you for the ua741 Spectre netlist, I think I will be able to convert this to SPICE format. I personally think the difference between the actual device-level netlist and the macro-model will account for much of the difference between the Fourier analysis results. As I understand your reply correctly, my effort of implementing the proposed Fourier analysis using Matlab does not make sense. When I read the paper, I thought I could just take the waveform I'm interested in straight from SPICE and than calculate the sum of integrals as discussed in the paper (these are all just numerical calculations). As I understand it now (please correct me if I'm wrong), the problem lies in the polynomial fit of the waveform. My approach would be to fit an N-degree polynomial through every (N+1) points from the calculated SPICE solution. I know SPICE already performs such a fit, therefore the only benefit would be to obtain the coefficients of the polynomial. Of course, it might very well be that the order of the polynomial fit SPICE uses changes during simulation and than my approach would not work well. Otherwise, I think I can still obtain the coefficients of the polynomial (dubbed 'cm' in the paper) and calculate the sum of integrals. Regards Peter |
Title: Re: Accurate Fourier analysis for circuit simulato Post by Ken Kundert on Dec 31st, 2007, 11:21am No, I am saying something different. What I am saying is that there are two important differences between what I presented in the paper and what SPICE normally provides. 1. The algorithm from the paper acts on the data from every timepoint. In this way it implements a true Fourier integral approach to Fourier analysis. SPICE uses a discrete Fourier transform (DFT) approach, and so ignores the waveform between sample points. For the ua741, either approach works okay. This is not true for a pulse-width-modulator, where the DFT does not give accurate results but the Fourier intergral approach would. 2. The implementation described in the paper tends to give more accurate results than SPICE because it is accompanied by improved simulation control. This is the thing that would be hard for you to implement in a post-processing based approach. -Ken |
Title: Re: Accurate Fourier analysis for circuit simulato Post by Visjnoe on Jan 1st, 2008, 3:45am Dear Ken, ok, I understand your point now. One more thing though (for my understanding): you state that the presented methodology's benefits are not so apparent on the ua741 example as they are on the PWM example. I understand why the method is much better for the PWM case (compared to DFT), but in your paper, the Spectre results (implementing this method) are also much better than the SPICE2g6 results (using 'traditional' .four analysis), apart from the RELTOL setting which is equal for both. So based on those results, I would conclude that the presented method also has *significant* (tens of dB more resolution compared to SPICE2g6) benefits for a ua741 type of circuit, although a DFT would also be able to provide the same accuracy/resolution, given enough FFT points (~simulation time). Regards Peter |
The Designer's Guide Community Forum » Powered by YaBB 2.2.2! YaBB © 2000-2008. All Rights Reserved. |