The Designer's Guide Community
Forum
Welcome, Guest. Please Login or Register. Please follow the Forum guidelines.
Jul 16th, 2024, 4:37pm
Pages: 1
Send Topic Print
FM VerilogA and limited noise performance (Read 6769 times)
trond
Senior Member
****
Offline



Posts: 168
Glasgow, Scotland
FM VerilogA and limited noise performance
May 07th, 2007, 10:07pm
 
Hello,

When using an IDEAL VCO (without noise) in VerilogA to generate a frequency modulated signal, then the instantaneous frequency of that signal is proportional to the modulating input signal.
I can use VerilogA to measure the period of the FM signal by using the @cross function for each zero crossing. Thus I can get the instantaneous frequency. I then export these values at my sampling rate Fs to Matlab where I do an FFT.

My question is regarding the noise floor. The maximum SNR I can get is somewhat in the range of 90dB for a given VCO gain and input amplitude. Why only so little? What determines the noise floor as everything is ideal and I am not introducing any quantization either?
With errors I mean that the VCO is ideal, the period determination of the FM signal is ideal and my Fs is at much greater than the free running frequency of the VCO (just making sure I am exporting enough values to matlab).
What determines the noise floor?

Thanks for your thoughts.
Back to top
 
 
View Profile   IP Logged
ACWWong
Community Fellow
*****
Offline



Posts: 539
Oxford, UK
Re: FM VerilogA and limited noise performance
Reply #1 - May 8th, 2007, 6:47am
 
This is likely to be numerical noise floor of the simulation data.
What you should do is control the time step of your simulator to 1/fs so that your fft sampling points coincide with the simulated data points rather than "interpolated points". As such higher fs in matlab alone will not necessarily improve matters.
Also try improving your simulation accuarcy settings.
Back to top
 
 
View Profile   IP Logged
trond
Senior Member
****
Offline



Posts: 168
Glasgow, Scotland
Re: FM VerilogA and limited noise performance
Reply #2 - May 8th, 2007, 7:45am
 
Thanks for the response ACWWong.

ACWWong wrote on May 8th, 2007, 6:47am:
This is likely to be numerical noise floor of the simulation data.
What you should do is control the time step of your simulator to 1/fs so that your fft sampling points coincide with the simulated data points rather than "interpolated points". As such higher fs in matlab alone will not necessarily improve matters.

I am not certain I understand how to do this. How do you make sure the simulated data points from Spectre coincide with the rising edge of the sampling clock? I assume you referring to  $bound_step = $bound_step(1/Fs); ?

ACWWong wrote on May 8th, 2007, 6:47am:
Also try improving your simulation accuarcy settings.

If you mean setting the "maxstep" option then I have already done so. For example, my Fs is approx. 200MHz and the "maxstep" I tried all the way down to 1e-10 without improvement in the noise floor.
Back to top
 
 
View Profile   IP Logged
ACWWong
Community Fellow
*****
Offline



Posts: 539
Oxford, UK
Re: FM VerilogA and limited noise performance
Reply #3 - May 8th, 2007, 9:19am
 
I've just re-read your initial post (My first post is relevant for exporting the VCO waveform itself).... So you are outputing the frequency generated from the cross function... you must therefore lookup in the verilogA reference manual the arguments to control the time tolerancing of the cross event. Using "conservative" in the transient options (to reduce reltol) should also help.

anyway, bound_step is like maxstep. A setting of 1e-10 for 200MHz is not very high (50 points per cycle). You should see the vco output model waveform improve dramatically if you reduce to 50ps or smaller..

cheers
aw
Back to top
 
 
View Profile   IP Logged
trond
Senior Member
****
Offline



Posts: 168
Glasgow, Scotland
Re: FM VerilogA and limited noise performance
Reply #4 - May 9th, 2007, 8:27am
 
Hmmm, I tried setting the maxstep parameter down to 50e-12, errpreset=conservative, $bound_step(0.1*period); without any improvement in the noise floor. I also used the maximum tolerance option for the @cross function. (see code below)

Code:
simulator lang=spectre
ahdl_include "widthcounter.va"
ahdl_include "fmeasure.va"

parameters FS=200e6

Vin  (in  0)  vsource type=sine ampl=0.5 freq=8.4e3 dc=0 sinedc=0
Vclk  (clk 0)  vsource type=pulse period=1/FS rise=1p fall=1p
sdvco (out in clk) sdm Kvco=0.5e6 f0=4*4.352e6 period=1/FS

resp tran stop=8/8.4e3 skipdc=yes errpreset=conservative maxstep=50e-12
 



Code:
`include "disciplines.vams"
`include "constants.vams"

module sdm (out, in, clk);

input in, clk; voltage in, clk;
output out; voltage out;

parameter real f0=4*4.352e6;		// Carrier frequency VCO
parameter real Kvco=0.5e6;		// Gain VCO
parameter real period=1/200e6;		// Sampling frequency

integer fptr1;
real TFM, last_timee, Te;
real freq, phase, last_time, current_time;

analog begin

	@(initial_step)
	begin
		fptr1=$fopen("...path to file");
	end

	$bound_step(0.1*period);
	freq = f0+Kvco*V(in);
	  phase = 2*`M_PI*idtmod(freq, 0.0, 1.0, -0.5);

	@(cross(phase + `M_PI/2, +1, 1e-12, 1e-12) or cross(phase - `M_PI/2, +1, 1e-12, 1e-12))
		begin
			current_time = $abstime;
			if (last_time > 0.0) TFM = period/(current_time - last_time);
			last_time = current_time;
		end

	@(cross(V(clk) - 0.5, 1)) begin
		$fstrobe(fptr1, "%g", TFM);
	end

	@(final_step) $fclose(fptr1);

	V(out) <+ phase;

end
endmodule
 



Do you know what else I might try?
Cheers
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: FM VerilogA and limited noise performance
Reply #5 - May 9th, 2007, 1:34pm
 
You can dramatically improve the accuracy if you use the last_crossing function in conjunction with the cross function.

-Ken
Back to top
 
 
View Profile WWW   IP Logged
trond
Senior Member
****
Offline



Posts: 168
Glasgow, Scotland
Re: FM VerilogA and limited noise performance
Reply #6 - May 9th, 2007, 11:41pm
 
Ken Kundert wrote on May 9th, 2007, 1:34pm:
You can dramatically improve the accuracy if you use the last_crossing function in conjunction with the cross function.

-Ken


Ken, when looking at the difference in time that I get when using @cross and last_crossing it was about 30f.
So subtracting this difference as shown below gave me a some improvement (noise floor drops by about 10dB).

Code:
............
............
bla=last_crossing(phase,0);

@(cross(phase, 0, 1e-12, 1e-12)
		begin
			current_time = $abstime;
			diff = current_time - bla ;
			TFM = period/(current_time - last_time - diff);
			last_time = bla;
		end
...........
...........
 



Is this what you had in mind?
Thanks,

Ps. Why would the last_crossing function give more accurate results than the @cross function, i.e what happens in the simulator settings?
Back to top
 
 
View Profile   IP Logged
Ken Kundert
Global Moderator
*****
Offline



Posts: 2386
Silicon Valley
Re: FM VerilogA and limited noise performance
Reply #7 - May 10th, 2007, 12:08am
 
The cross function stops the simulator after the crossing. In that way if you test the crossing condition you will see that it is true. However, it means that the time at which the simulator stops is always a little after the true crossing. The last_crossing function returns the actual time of the crossing.

-Ken
Back to top
 
 
View Profile WWW   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.