# How to calculate THD in spectre

1. ## spectre thd

Hi all,
I want to simulate the THD using spectre, I've done the Transient analysis
and want to use Calculator -> Special functions -> thd; there're four parameters must fill in, (the first two must start and stop frequency I think, Number of Samples and Fundamental)
What's the relation between them and THD? And how do I find out the THD in Caculator?

Thanks!

•

2. ## thd in spectre

If you have in your transient responce current i.e I2, then you first press wave,it and then you press the waveform in transient responce so the expression is in the buffer.After that select from special functions thd.At this point you have to set as you said 4 parameters. At boxes From & To you have to write something in time, for example 3u to 5u(meaning usec).These values depends on the frequency of your output waveform.So it is good to select two periods of your signal. At fundamental choose 0 .Now for number of samples you can write 64,512,1024 but it depends on the step you have in transient analysis.Check at cadence help for calculator.I think you will find it at calc.pdf . There you will find the expression in order to select the right No of samples. If you have problem send a photo with your signal or just send the frequency of your signal.
If your waveform is voltage, press wave,vt and then the waveform

2 members found this post helpful.

3. ## cadance calc.pdf

Thanks laoud!

Would you pls send me the calc.pdf? There's no cadence manul in my computor.

4. ## thd analysis spectre

when u plot a waveform, you can find the calculator in your waveform window. it is in the tools buttom. You can find the Thd function in the calculator

5. ## cadence spectre calc.pdf

And the this is the step by step method

4 members found this post helpful.

6. ## How to calculate THD in spectre

the result got from thd simulation is the real value, or with unit%?

2 members found this post helpful.

7. ## Re: How to calculate THD in spectre

Originally Posted by chichi
the result got from thd simulation is the real value, or with unit%?
(H)SPICE and Spectre results are always presented as real values, small or big values designated by an appropriate prefix or by an E notation.

8. ## Re: How to calculate THD in spectre

thanks..i just find it so strange that not only THD but also HD3, they does not behave the normal way, i mean normally, the third harmonics increase faster than signal amplitude when increasing the input signal, so HD3 should decrease till 0 with increasing output amplitude(so called IIP3 point),but in my case the curve is like a wave, very bad.lz se the atattched

9. ## Re: How to calculate THD in spectre

Originally Posted by chichi
... the third harmonics increase faster than signal amplitude when increasing the input signal
Right!

Originally Posted by chichi
so HD3 should decrease till 0 with increasing output amplitude(so called IIP3 point)
No, this is a misunderstanding. See iamlearning's contribution from Thu, 18 Feb 2010 19:01, saying "IIP3 determines the input power after which gain for the 3rd harmonic is greater than that of the Fundamental". See also this wiki for a good explanation of IIP3.

Originally Posted by chichi
but in my case the curve is like a wave, very bad.lz se the atattched
I do not quite understand your curve. From your text, it should be HD3 vs. HD1 (the Fundamental), right? Then - apart from its strange shape - how can you get an HD3 output signal between 60 and 90 dB from a fundamental signal between -70 and -20dB ? At a fundamental input signal of -60dB (1mV, in case of dbV), an HD3 output of 70dBV would mean an HD3 gain of 130dB (≈ 3e6) or an HD3 output voltage of > 3kV. There definitely something must be wrong with the size of the units.

But may be this is my mis-interpretation?

10. ## Re: How to calculate THD in spectre

Hi, right the x axis is the HD1, while the y axis is HD1-HD3, the distance between thrid order harmonics and fundamental signal.

•

11. ## Re: How to calculate THD in spectre

Ok, then it seems you are still far, far away from the IIP3 point, which is HD1-HD3=0dB (see the wiki). So you should simulate the input range -20dB ≤ HD1 ≤ +10dB !

1 members found this post helpful.

12. ## Re: How to calculate THD in spectre

hello
the result got from thd simulation is the real value, or with unit%?
i am going through a linearity analysis right now, and it seems to me that the value given by the thd function is a percentage

13. ## Re: How to calculate THD in spectre

yes it is, as can be seen in the wavescan user guide (calculator functions) for THD

just multiply it with 100 and you can use it to calculate ENOB or SN(D)R

14. ## How to calculate THD in spectre

from the calculator use the Fourier transform then sum a few terms HD2, HD3 is usually sufficient
good luck

15. ## Re: How to calculate THD in spectre

hello, is the thd in cadence calculator expressed in percentage?

16. ## Re: How to calculate THD in spectre

See the replies above yours!

17. ## Re: How to calculate THD in spectre

but why my THD always seem to be about 8%, my specs requirement is 0.92%, what do u think is the reason?

•

18. ## Re: How to calculate THD in spectre

Originally Posted by kokykokykoky
but why my THD always seem to be about 8%, my specs requirement is 0.92%, what do u think is the reason?
How could anyone know the reason without any info on your circuit? - and this on a hijacked thread!
Would you know why the THD of my circuit is ok?

19. ## Re: How to calculate THD in spectre

Hello everyone

I am using the calculator in cadence to find the settling time for the output voltage waveform.

There is this calculator function(Settlingtime) in cadence which I believe would be useful to me.

However, there are 4 blanks to be filled up:

Initial value type:
Initial value:

Final value type:
Final value:

Kindly advise. I tried doing it but the answer does not seem sensible.

20. ## Re: thd in spectre

Originally Posted by laoud
If you have in your transient responce current i.e I2, then you first press wave,it and then you press the waveform in transient responce so the expression is in the buffer.After that select from special functions thd.At this point you have to set as you said 4 parameters. At boxes From & To you have to write something in time, for example 3u to 5u(meaning usec).These values depends on the frequency of your output waveform.So it is good to select two periods of your signal. At fundamental choose 0 .Now for number of samples you can write 64,512,1024 but it depends on the step you have in transient analysis.Check at cadence help for calculator.I think you will find it at calc.pdf . There you will find the expression in order to select the right No of samples. If you have problem send a photo with your signal or just send the frequency of your signal.
If your waveform is voltage, press wave,vt and then the waveform
Thanks!

--[[ ]]--