Converting Phase Noise data into Allan Deviation

Application Note – 31

Converting Phase Noise data into Allan Deviation

Introduction

For precision frequency reference applications, the main parameters of interest are typically, frequency accuracy, frequency stability and phase noise.

The latter two parameters are inversely related. Frequency stability is typically measured in the time domain, expressed in terms of Allan Deviation (which is the square root of Allan Variance) at specific time intervals, using something like a time interval measurement system. Phase noise is typically measured in the frequency domain, expressed in dBc/Hz down from the carrier frequency at specific frequency offsets, using a Phase Noise measurement system.

Example plots of both are shown below;

Often only one of the parameters (Allan Deviation or Phase Noise) is provided, and rather than measuring the other parameter, it is sometimes convenient to calculate one characteristic from the other. This is not a new approach, and has been previously described in the PTTI proceedings (2004) however for convenience is repeated here. The following calculations describe the calculation of Allan Variance from Phase Noise data.

Calculations

The following equations use L(f), the linear single side band phase noise, which relates to the common logarithmic scale SSB phase noise as:

From the linear SSB trace, the spectral density of the fractional frequency can be calculated using :

This condition makes sure that the noise power, located above the highest offset frequency under investigation, is small.

With Sy(f) known from the above equation, the Allan variance can be derived numerically using ;

For those interested in the derivation of this equation, it can be found in ;

“Characterization of Frequency and Phase Noise, Report 580, International Radio Consultative Committee (C.C.I.R.), pp. 142-150, 1986”.

The following “C” program demonstrates the technique using a phase noise simulation of a high performance OCXO, and a graphical stability plot of the output from the program. The program splits the phase noise simulation (dB[n]) from the integration for obtaining aDev so that, if required, you can modify the code to provide your own phase noise values for the calculation.

Note:  The technique is integrating a product of the area under the phase noise curve, so two values of s[n] (and subsequently  y[n]) are calculated. To get a close approximation the integration_step must be small (0.001 in this case). Also, the data points are stepped in a continuous way to cover the complete curve, i.e. if data pairs are x1:x2, x3:x4, x5:x6 etc. then x3=x2 and x5=x4 and so on.

// ADEV from Numeric Integration of Phase Noise

// K. Lyon

#define PN_FILE   “/etc/pn_file”

#define ADEV_FILE “/etc/adev_file”

void adevCalc()

{

double Area = 0, sigma, integration_step = 1.0;

double lower_limit = 1e-3;

double upper_limit = 1e3;

double pi = 3.1415926535;

double t;

double exp_start = -3.0;

double exp_stop = 1.0;

double exp_step = 0.1;

double i;

char adevFile[80000], tmpBuf[100], pnFile[80000];;

long arraySize, j=0, samples;

int first = 1;

FILE *fp;

int  tmp;

arraySize = 8000;

double pnArray[arraySize];

double xArray[arraySize];

double dB ;

double x0[arraySize],x1[arraySize],s0[arraySize],s1[arraySize],lf, y0, y1;

x0[0]      = lower_limit;

x1[0]      = integration_step;

j          = 0L;

i         = exp_start;

t         = pow(10, i);

//Create phase noise array

while(x0[j] < upper_limit){

     //simulated phase noise (dB[n]=10*log10(Lf[n])) of a high performance OCXO

     lf = ((1e-9/pow(x0[j],4)) + 1e-12 /(pow(x0[j],3)) + 1e-13/x0[j] + 2e-16);

     pnArray[j]   = lf;

     xArray[j]    = x0[j];

     // spectral density (s[n])

     s0[j]   = 2 * (x0[j]*x0[j]/1e14)* lf;

     lf = ((1e-9/pow(x1[j],4)) + 1e-12 /(pow(x1[j],3)) + 1e-13/x1[j] + 2e-16);

     // spectral density (s[n])

     s1[j] = 2 * (x1[j]*x1[j]/1e14)* lf;

     x0[j+1] = x0[j]   + integration_step;

     x1[j+1] = x0[j+1] + integration_step;

                          j++;

}// end while(x[0] < upper_limit)

samples = j; //number of pn samples

printf(“arraySize =%ld  number of samples=%ld \n\r”,arraySize, samples);

while(t <= pow(10, exp_stop)){

     printf(“\nCALCULATING ADEV i=%f  x0[%ld]=%f\n”,i,j,x0[j]);

     t = pow(10, i); // step tau linearly over log range

     j     = 0L;

     while(j < samples){

          // Integral coefficient * s[n]

          y0 =  2*s0[j]*(pow(sin(pi*t*x0[j]),4))/((pi*t*x0[j])*(pi*t*x0[j]));

          // Integral coefficient * s[n]

          y1 =  2*s1[j]*(pow(sin(pi*t*x1[j]),4))/((pi*t*x1[j])*(pi*t*x1[j]));

          Area = 0.5*integration_step*(y0 + y1) + Area;

          j++;

     }// end while(x[0] < upper_limit)

     sigma = sqrt(2*Area);

     if(first == 1){

          sprintf(adevFile,”%f    %.16e\n”, t, sigma);

          first = 0;

     }

     else{

          sprintf(tmpBuf,”%f    %.16e\n”, t, sigma);

          strcat(adevFile,tmpBuf);

     }

     i = i + exp_step;

     Area = 0.0;

}//end while(t <= pow(10, exp_stop)){

printf(“%s”,adevFile);

fp = fopen(ADEV_FILE, “wb+”);

if(fp==NULL){

     printf(“Unable to open the ADEV file for writing (%s)!\n\r”,                       strerror(errno));

}

tmp = fwrite(&adevFile[0],sizeof(char),sizeof(adevFile),fp);

fclose(fp);

printf(“ADEV saved, %d bytes written===============\n\r”,tmp);

dB = 10*log10(pnArray[0]); //pnArray holds L(f) values

sprintf(pnFile,  “%.16e    %f\n”,dB ,xArray[0]);

for(j=1;j<(samples);j++){

     dB = 10*log10(pnArray[j]);

     sprintf(tmpBuf,”%.16e    %f\n”, dB,xArray[j]);

     strcat(pnFile, tmpBuf);

}

printf(“%s”,pnFile);

fp = fopen(PN_FILE, “wb+”);

if(fp==NULL){

     printf(“Unable to open the PN file for writing(%s)!\n\r”,

            strerror(errno));

}

tmp = fwrite(&pnFile[0],sizeof(char),sizeof(pnFile),fp);

fclose(fp);

printf(“PN saved, %d bytes written===============\n\r”,tmp);

} //end void adevCalc()

Results from the above example program are plotted below. L(f) has been converted to dBc/Hz. x0[n] is the frequency, starting at 0.001Hz, and stepped in increments of 1Hz. s0[n] and s1[n] are the calculated spectral frequencies at x0[n] and x1[n].

To calculate ADEV from your own set of phase noise data, simply replace the simulated pnArray[n] values with your own phase noise values, converted to L(f), at frequency steps equal to the integration_step.

Scroll to Top