# Switched Capacitor Circuits - PSS/PAC

1. ## Switched Capacitor Circuits - PSS/PAC

Hello,

I already have the paper by Ken Kundert, but I am looking for a tutorial on how to do PSS/PAC simulation for Switched Capacitor Amplifiers in Cadence Spectre/Virtuoso.

I am not looking for the theory, rather a step by step tutorial on how this is simulated and set up in Cadence Virtuoso/Spectre.

Thank you.

•

2. ## Re: Switched Capacitor Circuits - PSS/PAC

Do you know that Ken Kunert ist active in another electronic Forum (www.designers-guide.org)?
perhaps it is best to contact him directly.

3. ## Re: Switched Capacitor Circuits - PSS/PAC

Hello,

But I am looking for a practical tutorial on this subject.

Thank you.

5. ## Re: Switched Capacitor Circuits - PSS/PAC

Hello,

Thanks, but this document does not talk about Switched Capacitor simulations.

Thank you.

7. ## Re: Switched Capacitor Circuits - PSS/PAC

Hello,

I read the course notes and understand the simulation procedure except for one thing.

How do I:

– Divide results by sinc(f/fs) to correct for ZOH distortion?

Thank you.

•

8. ## Re: Switched Capacitor Circuits - PSS/PAC

Originally Posted by Puppet123
– Divide results by sinc(f/fs) to correct for ZOH distortion?
This is true for Transient Analysis.
Howerver, this is not required for PSS/PAC.

Post Processing of Roll-Off-Compensation for Transient Analysis Result
Code:
```selectResult('tran)

time_vec = drGetWaveformXVec( v("/Vout") )
tstop = drGetElem( time_vec, drVectorLength(time_vec)-1 )
printf("tstop = %g[usec]\n", tstop/1u)

fmax = 25M

tw_in = 1.0/(5*fmax)
froll_off = 1.0 / tw_in
fnyquist = 2*froll_off

delta_f = 1.0 / tstop
maxstep = 1.0 / fnyquist
N = round(2*fnyquist * tstop)
ip = round(log(N)/log(2))
NN = 2**ip
if( NN < N then NN=2**(ip+1) )
fnyquist = NN / (2.0*tstop)
printf("N = %d --> N = %d\n", N NN)

k = tstop / (2.0 * tw_in)  ;  Amplitude Compensation

Vout_freq = dft(v("/Vout") 0 tstop N "Rectangular" 1 1)

Vref_freq = dft(v("/Vref") 0 tstop N "Rectangular" 1 1)

xvec = drGetWaveformXVec(Vout_freq)
len  = drVectorLength(xvec)
printf("len = %d\n", len)

bid = currentSubwindow(1)
plot( db20(k*Vout_freq) ?expr '("tran-S21 without roll-off compensation") )
plot( db20(Vout_freq/Vref_freq) ?expr '("tran-S21 with roll-off compensation") )```

9. ## Re: Switched Capacitor Circuits - PSS/PAC

Puppet23 - are you required to use PSS/PAC or are you free to use any other simulation environment?

10. ## Re: Switched Capacitor Circuits - PSS/PAC

Hello,

Must use Cadence and must use PSS/PAC.

That is why I asked the question originally.

Thank you.

11. ## Re: Switched Capacitor Circuits - PSS/PAC

Originally Posted by Puppet123
Must use Cadence and must use PSS/PAC.
What do you mean ?
Use correct terminology.

Anyway your question is no more than very easy thing.

•

13. ## Re: Switched Capacitor Circuits - PSS/PAC

Originally Posted by Puppet123
Must use Cadence Virtuoso/Spectre and must use PSS/PAC simulation with Virtuoso/Spectre.
No.
You can not understand EDA tools you use at all.

14. ## Re: Switched Capacitor Circuits - PSS/PAC

Yes, I am required to use:

Also, @pancho_hideboo, what is the code you posted earlier - is that MATLAB ?

Thank you.

--

Post Processing of Roll-Off-Compensation for Transient Analysis Result

Code:

```Code dot - [expand]1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
selectResult('tran)

time_vec = drGetWaveformXVec( v("/Vout") )
tstop = drGetElem( time_vec, drVectorLength(time_vec)-1 )
printf("tstop = %g[usec]\n", tstop/1u)

fmax = 25M

tw_in = 1.0/(5*fmax)
froll_off = 1.0 / tw_in
fnyquist = 2*froll_off

delta_f = 1.0 / tstop
maxstep = 1.0 / fnyquist
N = round(2*fnyquist * tstop)
ip = round(log(N)/log(2))
NN = 2**ip
if( NN < N then NN=2**(ip+1) )
fnyquist = NN / (2.0*tstop)
printf("N = %d --> N = %d\n", N NN)

k = tstop / (2.0 * tw_in)  ;  Amplitude Compensation

Vout_freq = dft(v("/Vout") 0 tstop N "Rectangular" 1 1)

Vref_freq = dft(v("/Vref") 0 tstop N "Rectangular" 1 1)

xvec = drGetWaveformXVec(Vout_freq)
len  = drVectorLength(xvec)
printf("len = %d\n", len)

bid = currentSubwindow(1)
plot( db20(k*Vout_freq) ?expr '("tran-S21 without roll-off compensation") )
plot( db20(Vout_freq/Vref_freq) ?expr '("tran-S21 with roll-off compensation") )```