The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 19th, 2024, 8:34pm
Pages: 1
Send Topic Print
THD of Pulse Width Modulated Sine Wave in Spectre (Read 4639 times)
Count
Junior Member
**
Offline



Posts: 14
Singapore
THD of Pulse Width Modulated Sine Wave in Spectre
Dec 02nd, 2008, 5:10pm
 
Hi, I read it from "The Designer's Guide to Spice and Spectre", that we are able to find the THD of a pulse-width modulated sine wave using the Fourier Integral method by Spectre. The book also mentioned that Fourier integral is not subjected to aliasing.

Now, I am designing a class D amplifier. I am trying to obtain the THD from simulation. I observe the THD at two points, i.e. the output of the class D amplifier ( which is a pulse width modulated sinewave) and the point after a low pass filter to the output ( to remove the clock harmonics).

I am getting ~0.1% THD at the filtered output vs ~3%THD at the unfiltered output. Could anyone explain to me what went wrong? For your information, my input frequency is 1kHz while the clock frequency is 1MHz. In my THD calculation, the bandwidth of interest is from 20Hz ~ 20kHz. The corner frequency of the low pass filter is 40kHz. I was expecting that both THD would give similar result but I was proven wrong. Is the discrepancy due to aliasing or some other effects? Thanks!
Back to top
 
 
View Profile   IP Logged
Peruzzi
Community Member
***
Offline



Posts: 71

Re: THD of Pulse Width Modulated Sine Wave in Spectre
Reply #1 - Dec 2nd, 2008, 7:53pm
 
Count,

Your question doesn't have enough detail for me to give you more than a guess, but shouldn't you be expecting the filter to reduce the distortion just as you are seeing?

Bob P.
Back to top
 
 
View Profile   IP Logged
Count
Junior Member
**
Offline



Posts: 14
Singapore
Re: THD of Pulse Width Modulated Sine Wave in Spectre
Reply #2 - Dec 2nd, 2008, 10:27pm
 
Hi Bob, what other information do you need? I am willing to supply them. Let me rephrase the question. I am only interested in the THD from 20Hz ~ 20kHz. I have a lowpass filter with 3dB frequency at 40kHz. So theorectically, the harmonics below 40kHz should not be filtered away, assuming no aliasing effect. I am expecting the THD from 20Hz ~ 20kHz to be similar before and after the filter using the Fourier Integral method by Spectre because it is mentioned in the book by Ken as well as the Spectre user guide that Fourier Integral method is not subjected to aliasing effect. It is also mentioned that Fourier Integral can be used to analyze the THD of a PWM signal. I hope I am making myself clear this time around. Did I miss something in the setup or have I misunderstood some concept? Thanks for the help!
Back to top
 
 
View Profile   IP Logged
Peruzzi
Community Member
***
Offline



Posts: 71

Re: THD of Pulse Width Modulated Sine Wave in Spectre
Reply #3 - Dec 4th, 2008, 8:03am
 
Since you're only interested in frequencies less than 20 kHz, your mathematical analysis is equivalent to a brick wall at 20 kHz, so you reason that the 40 kHz LPF has no effect right?

If that's true it would seem the two analyses would give similar results.  I can't give you a definite answer.  Can you view the spectrum (either graphically or as a table) and see which frequencies are contributing to the THD?  
Back to top
 
 
View Profile   IP Logged
sheldon
Community Fellow
*****
Offline



Posts: 751

Re: THD of Pulse Width Modulated Sine Wave in Spectre
Reply #4 - Dec 4th, 2008, 9:33pm
 
Count,

  One thing that you might want to try is writing a Verilog-A
model for Hann window and re-run the Fourier integral for
the unfiltered output after windowing the data. The Fourier
integral uses the rectangular window function. As a result,
the testbench needs to follow the recommendations for selecting
the input frequency that has been discussed in previous
threads for data converters. Using the window function,
will allow you to identify whether or not the issue is due
to setup.

                                                       Best Regards,

                                                           Sheldon
Back to top
 
 
View Profile   IP Logged
Count
Junior Member
**
Offline



Posts: 14
Singapore
Re: THD of Pulse Width Modulated Sine Wave in Spectre
Reply #5 - Dec 5th, 2008, 9:50am
 
Hi Sheldon,

Are you saying that I have to satisfy coherent sampling requirements to prevent spectral leakage? I am not really sure about this because the Fourier Integral method by Spectre automatically makes use of data in the last cycle of the transient simulation to perform Fourier Transform and THD calculation. Another point I would like to bring up is that passing the PWM signal through a low pass filter does not create a FFT window effect. I do not see why the in-band spectrum should be different at the PWM output and the filtered output. Anyway, I will follow your suggestion and post back any result. Thanks!

Count
Back to top
 
 
View Profile   IP Logged
Pages: 1
Send Topic Print
Copyright 2002-2024 Designer’s Guide Consulting, Inc. Designer’s Guide® is a registered trademark of Designer’s Guide Consulting, Inc. All rights reserved. Send comments or questions to editor@designers-guide.org. Consider submitting a paper or model.