It's because you don't have enough points in the shooting interval to do the DFT accurately - so you're suffering from interpolation error. If you plot the DFT you've done, you'll see the fundamental is a bit low - and this is the root cause. If instead you integrated the pss_fd results, you'd get the right answer because the Fourier integral used is more accurate. Alternatively, if you set (say) maxacfreq=16G on the pss analysis and then do the DFT, it would be fine. Or simpler still, do a transient and set strobeperiod so that the strobe points match the sample points of the DFT - that way you eliminate the interpolation error: tran tran stop=2e-7 strobeperiod=2e-7/2048 Then if I do: printf("Tran power=%g\n" sqrt(integ(v("out" ?result "tran")**2)/2e-7)) DFT=mag(dft(v("out" ?result "tran") 0 2e-7 2048 "Rectangular" 1 "default" 1.0 ))**2 printf("Tran DFT integ=%g\n" sqrt(integ(DFT)/5M/2)) I get: Tran power=0.707107 Tran DFT integ=0.707107 Regards, Andrew.
↧