The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
May 6th, 2024, 7:08am
Pages: 1
Send Topic Print
Verilog-A model for a sinusoidal voltage source with jitter (Read 169 times)
zoujunjx
New Member
*
Offline



Posts: 5

Verilog-A model for a sinusoidal voltage source with jitter
Mar 13th, 2009, 3:15am
 
I need a behavioral model in Verilog-A for a sinusoidal voltage source with input random jitter. Anyone can help me? Many thanks in advance!  :)
Back to top
 
 
View Profile   IP Logged
pancho_hideboo
Senior Fellow
******
Offline



Posts: 1424
Real Homeless
Re: Verilog-A model for a sinusoidal voltage source with jitter
Reply #1 - Mar 13th, 2009, 9:04am
 
zoujunjx wrote on Mar 13th, 2009, 3:15am:
I need a behavioral model in Verilog-A for a sinusoidal voltage source with input random jitter. Anyone can help me?

See http://www.designers-guide.org/Analysis/PLLnoise+jitter.pdf
Back to top
 
 
View Profile WWW Top+Secret Top+Secret   IP Logged
zoujunjx
New Member
*
Offline



Posts: 5

Re: Verilog-A model for a sinusoidal voltage source with jitter
Reply #2 - Mar 17th, 2009, 2:28am
 
Thanks a lot! However, I need a sinusoidal voltage source with input random jitter, while the model in your mentioned paper is only square waveform.  
Back to top
 
 
View Profile   IP Logged
pancho_hideboo
Senior Fellow
******
Offline



Posts: 1424
Real Homeless
Re: Verilog-A model for a sinusoidal voltage source with jitter
Reply #3 - Mar 17th, 2009, 6:22am
 
zoujunjx wrote on Mar 17th, 2009, 2:28am:
I need a sinusoidal voltage source with input random jitter

zoujunjx wrote on Mar 17th, 2009, 2:28am:
while the model in your mentioned paper is only square waveform.

Compared to square waveform, sinusoidal waveform is very easy.
Did you read surely with considering possiblity of extension or application.

Use Phase Modulation sources modulated by random signal.
Back to top
 
 
View Profile WWW Top+Secret Top+Secret   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2384
Silicon Valley
Re: Verilog-A model for a sinusoidal voltage source with jitter
Reply #4 - Mar 17th, 2009, 9:28am
 
The Verilog-AMS page has vco models that are simple to convert to sinusoidal output. Perhaps you can use them. For example, the model of the vco with jitter is

Code:
//
// Voltage controlled oscillator with white accumulating jitter
//

module vco2 (out, in);

input in; voltage in;				// input terminal
output out; voltage out;			// output terminal
parameter real vmin=0;				// input voltage that corresponds to minimum output frequency
parameter real vmax=vmin+1 from (vmin:inf);	// input voltage that corresponds to maximum output frequency
parameter real fmin=1 from (0:inf);		// minimum output frequency
parameter real fmax=2*fmin from (fmin:inf);	// maximum output frequency
parameter real vl=-1;				// high output voltage
parameter real vh=1;				// low output voltage
parameter real tt=0.01/fmax from (0:inf);	// output transition time
parameter real ttol=1u/fmax from (0:1/fmax);	// time tolerance
parameter real jitter=0 from [0:0.25/fmax);	// period jitter (produces white accumulating jitter)
real freq, phase, dT;
integer n, seed;

analog begin
    @(initial_step) seed = -561;

    // compute the freq from the input voltage
    freq = (V(in) - vmin)*(fmax - fmin) / (vmax - vmin) + fmin;

    // bound the frequency (this is optional)
    if (freq > fmax) freq = fmax;
    if (freq < fmin) freq = fmin;

    // add the phase noise
    freq = freq/(1 + dT*freq);

    // bound the time step to assure no cycles are skipped
    $bound_step(0.6/freq);

    // phase is the integral of the freq modulo 2p
    phase = 2*`M_PI*idtmod(freq, 0.0, 1.0, -0.5);

    // update jitter twice per period
    // `M_SQRT2=sqrt(K), K=2 jitter updates/period
    @(cross(phase + `M_PI/2, +1, ttol) or cross(phase - `M_PI/2, +1, ttol)) begin
	dT = `M_SQRT2*jitter*$rdist_normal(seed,0, 1);
	n = (phase >= -`M_PI/2) && (phase < `M_PI/2);
    end

    // generate the output
    V(out) <+ transition(n ? vh : vl, 0, tt);
end
endmodule
 

To convert it to sinusoidal output, change the lines Code:
    @(cross(phase + `M_PI/2, +1, ttol) or cross(phase - `M_PI/2, +1, ttol)) begin
	dT = `M_SQRT2*jitter*$rdist_normal(seed,0, 1);
	n = (phase >= -`M_PI/2) && (phase < `M_PI/2);
    end

    // generate the output
    V(out) <+ transition(n ? vh : vl, 0, tt);
end
endmodule 

to Code:
    @(cross(phase + `M_PI/2, +1, ttol) or cross(phase - `M_PI/2, +1, ttol))
	dT = `M_SQRT2*jitter*$rdist_normal(seed,0, 1);

    // generate the output
    V(out) <+ sin(phase);
end
endmodule 


-Ken
Back to top
 
 
View Profile WWW   IP Logged
nadroit
Junior Member
**
Offline



Posts: 14

Re: Verilog-A model for a sinusoidal voltage source with jitter
Reply #5 - May 31st, 2012, 9:12am
 
Hello Ken,
 I do not understand why value of K is changed from 2 to 1 for the jitter in sine wave oscillator. For square wave jitter is updated twice per period but for sine wave it is updated once per period why?

Thanks
Back to top
 
 
View Profile   IP Logged
Forum Administrator
YaBB Administrator
*****
Offline



Posts: 145

Re: Verilog-A model for a sinusoidal voltage source with jitter
Reply #6 - May 31st, 2012, 9:53am
 
When generating a square wave it is natural and convenient to do it twice per cycle, but it is not necessary to do it so often. Once is sufficient.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
ywguo
Community Fellow
*****
Offline



Posts: 943
Shanghai, PRC
Re: Verilog-A model for a sinusoidal voltage source with jitter
Reply #7 - Jan 30th, 2013, 1:44pm
 
Hi Ken,

Why is the bound step 0.6/freq? Is it too big?


Best Regards,
Yawei
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.