**3. Frequency measurement using digital signal processing**

To remove the effect of common offset oscillator phase noise and improve the accuracy of measuring frequency, we proposed to make use of digital signal processing method measuring frequency. A Multi-Channel Digital Frequency Stability Analyzer has been developed in NTSC.

### **3.1 System configuration**

This section will report on the Multi-Channel Digital Frequency Stability Analyzer (DFSA) based upon the reformed DMTD scheme working at 10MHz with 100Hz beat frequency. DFSA has eight parallel channels, and it can measure simultaneously seven oscillators. The block diagram of the DFSA that only includes two channels is reported in Fig. 3.

Common offset reference oscillator generates frequency signal, which has a constant frequency difference with reference oscillator. Reference oscillator and under test oscillator at the same nominal frequency are down-converted to beat signals of low frequency by mixing them with the common offset reference to beat frequency. A pair of analog-to-digital converters (ADC) simultaneously digitizes the beat signals output from the double-balance mixers. All sampling frequency of ADCs are droved by a reference oscillator to realize simultaneously sampling. The digital beat signals are fed into personal computer (PC) to computer the drift frequency or phase difference during measuring time interval.

High-Precision Frequency Measurement Using Digital Signal Processing 119

Where x is the beat signals array; n is the number of points in the signal array x; \* denotes a complex conjugate. According aforementioned formula, figure 4 plots power spectrum of a 100 Hz sine wave. As expected, we get a very strong peak at a frequency of 100 Hz. Therefore, we can acquire the frequency corresponding to the maximum power from the

The beat signals from the ADCs are fed into PC to realize fine measuring too. Fine measurement includes the cross-correlation and interpolation methods. To illuminate the cross-correlation method, figure 5 shows a group of simulation data. The simulation signals of 1.08Hz are digitized at the sampling frequency of 400Hz. The signal can be expressed by

> <sup>0</sup> ( ) sin(2 ) *s*

Where *f* indicates the frequency of signal, the *sf* is sampling frequency, *n* refers the number

*ff f* ' *<sup>N</sup>* (1 0.05)*Hz* (3.3)

There the *fN* refers the integer and '*f* indicates decimal fraction. In addition, there is the

we can divide it into data1 and data2 two groups. Data1 and data2 can be expressed

1 0 ( ) sin(2 ), [0,399] *<sup>N</sup> s f f x n n n f*

'

0

 MS

' '

 ' 

sin(2 2 ( )), [0,399]

 M

*f f n f fn <sup>f</sup>*

According the formula (3.5), the green line can be used to instead of the red one in the figure 5 to show the phase difference between data1 and data2. And then the phase difference is the result that the decimal frequency '*f* of signal is less than 1Hz. Therefore, we can calculate the phase difference to get '*f* . The cross-correlation method is used to calculate

1 1 ( ) ( ) ( ) cos(2 2 ( )) <sup>2</sup>

S

' ¦ ' (3.6)

 S

*<sup>N</sup> x x <sup>N</sup> n s f f R m x nx n m <sup>m</sup> f f N f*

( ) sin(2 ), [400,799]

 M

*N*

(3.4)

S

2 0

S

*N*

The cross-correlation function can be shown by following formula:

1 2

1

*N*

0

S

the phase difference of adjacent two groups data.

1 2

*s*

*N s*

*f f x n n n f*

0 represents the initial phase. In the figure 5, the frequency of signal can be

0 and 400 *sf Hz* . There are sampled two seconds data in the figure 5, so

(3.2)

(3.5)

*<sup>f</sup> x n <sup>n</sup> f* S M

plot of auto power spectrum.

**3.2.2 Fine measurement** 

following formula.

of sample, and

initial phase <sup>0</sup>

M

respectively by following formulas:

expressed:

M

Fig. 3. Block diagram of the DFSA

### **3.2 Measurement methods**

Digital beat signals processing is separated two steps that consist of coarse measuring and fine measuring. The two steps are parallel processed at every measurement period. The results of coarse measuring can be used to remove the integer ambiguity of fine measuring.

#### **3.2.1 Coarse measurement**

The coarse measurement of beat frequency is realized by analyzing the power spectrums beat signal. The auto power spectrums of the digital signals are calculated to find the frequency components of beat signal buried in a noisy time domain signal. Generating the auto power spectrum is by using a fast Fourier transform (FFT) method. The auto power spectrum is calculated as shown in the following formula:

$$S\_x(f) = \frac{FFT(x)FFT^\*(x)}{n^2} \tag{3.1}$$

Fig. 4. The power vs. frequency in Hertz

Where x is the beat signals array; n is the number of points in the signal array x; \* denotes a complex conjugate. According aforementioned formula, figure 4 plots power spectrum of a 100 Hz sine wave. As expected, we get a very strong peak at a frequency of 100 Hz. Therefore, we can acquire the frequency corresponding to the maximum power from the plot of auto power spectrum.

#### **3.2.2 Fine measurement**

118 Applications of Digital Signal Processing

Digital beat signals processing is separated two steps that consist of coarse measuring and fine measuring. The two steps are parallel processed at every measurement period. The results of coarse measuring can be used to remove the integer ambiguity of fine measuring.

The coarse measurement of beat frequency is realized by analyzing the power spectrums beat signal. The auto power spectrums of the digital signals are calculated to find the frequency components of beat signal buried in a noisy time domain signal. Generating the auto power spectrum is by using a fast Fourier transform (FFT) method. The auto power

\*

*n* (3.1)

2 () () ( ) *<sup>x</sup> FFT x FFT x S f*

Fig. 3. Block diagram of the DFSA

**3.2 Measurement methods** 

**3.2.1 Coarse measurement** 

Fig. 4. The power vs. frequency in Hertz

spectrum is calculated as shown in the following formula:

The beat signals from the ADCs are fed into PC to realize fine measuring too. Fine measurement includes the cross-correlation and interpolation methods. To illuminate the cross-correlation method, figure 5 shows a group of simulation data. The simulation signals of 1.08Hz are digitized at the sampling frequency of 400Hz. The signal can be expressed by following formula.

$$\tan(n) = \sin(2\pi \frac{f}{f\_s} n + \varphi\_0) \tag{3.2}$$

Where *f* indicates the frequency of signal, the *sf* is sampling frequency, *n* refers the number of sample, and M0 represents the initial phase. In the figure 5, the frequency of signal can be expressed:

$$f = f\_N + \Delta f = (1 + 0.05)Hz\tag{3.3}$$

There the *fN* refers the integer and '*f* indicates decimal fraction. In addition, there is the initial phase <sup>0</sup> M 0 and 400 *sf Hz* . There are sampled two seconds data in the figure 5, so we can divide it into data1 and data2 two groups. Data1 and data2 can be expressed respectively by following formulas:

$$\ln x\_1(n) = \sin(2\pi \frac{f\_N + \Delta f}{f\_s} n + \varphi\_0), n \in [0, 399] \tag{3.4}$$

$$\begin{aligned} \max\_{\mathbf{x}} (n) &= \sin(2\pi \frac{f\_N + \Delta f}{f\_s} n + \varphi\_0), n \in [400, 799] \\ &= \sin(2\pi \frac{f\_N + \Delta f}{f\_s} n + \varphi\_0 + 2\pi (f\_N + \Delta f)), n \in [0, 399] \end{aligned} \tag{3.5}$$

According the formula (3.5), the green line can be used to instead of the red one in the figure 5 to show the phase difference between data1 and data2. And then the phase difference is the result that the decimal frequency '*f* of signal is less than 1Hz. Therefore, we can calculate the phase difference to get '*f* . The cross-correlation method is used to calculate the phase difference of adjacent two groups data.

The cross-correlation function can be shown by following formula:

$$R\_{\mathbf{x}\_1 \mathbf{x}\_2}(m) = \frac{1}{N} \sum\_{n=0}^{N-1} \mathbf{x}\_1(n) \mathbf{x}\_2(n+m) = \frac{1}{2} \cos(2\pi \frac{f\_N + \Delta f}{f\_s} m + 2\pi (f\_N + \Delta f))\tag{3.6}$$

High-Precision Frequency Measurement Using Digital Signal Processing 121

acquire eight or more offset sources at frequency *rf* . Seven under test signals, denoted frequency , 1,2,3... *xi f i* , are down-converted to sinusoidal beat-frequency signals at nominal frequency *bf* by mixing them with the offset sources at frequency *rf* . The signal

Fig. 6. Block Diagram of the Multi-Channel Digital Frequency Stability Analyzer

The channel zero is calibrating channel, which input the reference source running at frequency <sup>0</sup>*f* to test real time noise floor of the DFSA, and then can calibrate systematic errors of the other channels. The calibrating can be finished depending on the relativity between the input of channel zero and the output of OG. Because both signals come from one reference oscillator, they should have strong relativity that can cancel the effect of

The Digital Signal Processing module consists of multi-channel Data Acquisition device (DAQ), personal computer (PC) and output devices. The Measurement Frequency (MF) software is installed in PC to analyze data from DAQ. The beat frequency signals, which are output from the MBFG that are connected to channels of analog-to-digital converter respectively, are digitized according to the same timing by the DAQ that are driven by a clock with sampling frequency *N* . Then, MF software retrieves the data from buffer of DAQ, maintains synchronization of the data stream, carries out processing of measurement (including frequency, phase difference, and analyzing stability), stores original data to disk,

The MBFG output must be sinusoidal beat frequency signals, because processing beat frequency signal make use of the property of trigonometric function. It has the obvious difference with traditional beat frequency method using square waveform and Zero Crosser

flow graph is showed in figure 6.

reference oscillator noise.

and manages the output devices.

Assembly.

Fig. 5. Signals of 1.08Hz are digitized at the sampling frequency of 400Hz

Where m denotes the delay and m=0, 1, 2…N-1. To calculate the value of '*f* , m is supposed to be zero. So we can get the formula (3.7):

$$R\_{x\_1 x\_2}(0) = \frac{1}{2} \cos(2\pi (f\_N + \Delta f)) = \frac{1}{2} \cos(2\pi \Delta f) \tag{3.7}$$

From the formula (3.7), the '*f* that being mentioned in formula (3.3) means frequency drift of under test signal during the measurement interval can be acquired. On the other side, the *fN* is measured by using the coarse measurement method. So combining coarse and fine measurement method, we can get the high-precision frequency of under test signals.

#### **3.3 Hardware description**

The Multi-Channel Digital Frequency Stability Analyzer consists of Multi-channel Beat-Frequency signal Generator (MBFG) and Digital Signal Processing (DSP) module. The multichannel means seven test channels and one calibration channel with same physical structure. The system block diagram is shown in figure 6.

The MBFG is made up of Offset Generator (OG), Frequency Distribution Amplifier (FDA), and Mixer. There are eight input signals, and seven signals from under test sources when the other one is designed as the reference, generally the most reliable source to be chosen as reference. The reference signal <sup>0</sup>*f* is used to drive the OG. The OG is a special frequency synthesizer that can generate the frequency at *r b* <sup>0</sup> *fff* . The output of OG drives FDA to 120 Applications of Digital Signal Processing

Fig. 5. Signals of 1.08Hz are digitized at the sampling frequency of 400Hz

to be zero. So we can get the formula (3.7):

*Rx x*

structure. The system block diagram is shown in figure 6.

1 2

**3.3 Hardware description** 

signals.

Where m denotes the delay and m=0, 1, 2…N-1. To calculate the value of '*f* , m is supposed

From the formula (3.7), the '*f* that being mentioned in formula (3.3) means frequency drift of under test signal during the measurement interval can be acquired. On the other side, the *fN* is measured by using the coarse measurement method. So combining coarse and fine measurement method, we can get the high-precision frequency of under test

The Multi-Channel Digital Frequency Stability Analyzer consists of Multi-channel Beat-Frequency signal Generator (MBFG) and Digital Signal Processing (DSP) module. The multichannel means seven test channels and one calibration channel with same physical

The MBFG is made up of Offset Generator (OG), Frequency Distribution Amplifier (FDA), and Mixer. There are eight input signals, and seven signals from under test sources when the other one is designed as the reference, generally the most reliable source to be chosen as reference. The reference signal <sup>0</sup>*f* is used to drive the OG. The OG is a special frequency synthesizer that can generate the frequency at *r b* <sup>0</sup> *fff* . The output of OG drives FDA to

S

1 1 (0) cos(2 ( )) cos(2 )) 2 2

 S

*ff f <sup>N</sup>* ' ' (3.7)

acquire eight or more offset sources at frequency *rf* . Seven under test signals, denoted frequency , 1,2,3... *xi f i* , are down-converted to sinusoidal beat-frequency signals at nominal frequency *bf* by mixing them with the offset sources at frequency *rf* . The signal flow graph is showed in figure 6.

Fig. 6. Block Diagram of the Multi-Channel Digital Frequency Stability Analyzer

The channel zero is calibrating channel, which input the reference source running at frequency <sup>0</sup>*f* to test real time noise floor of the DFSA, and then can calibrate systematic errors of the other channels. The calibrating can be finished depending on the relativity between the input of channel zero and the output of OG. Because both signals come from one reference oscillator, they should have strong relativity that can cancel the effect of reference oscillator noise.

The Digital Signal Processing module consists of multi-channel Data Acquisition device (DAQ), personal computer (PC) and output devices. The Measurement Frequency (MF) software is installed in PC to analyze data from DAQ. The beat frequency signals, which are output from the MBFG that are connected to channels of analog-to-digital converter respectively, are digitized according to the same timing by the DAQ that are driven by a clock with sampling frequency *N* . Then, MF software retrieves the data from buffer of DAQ, maintains synchronization of the data stream, carries out processing of measurement (including frequency, phase difference, and analyzing stability), stores original data to disk, and manages the output devices.

The MBFG output must be sinusoidal beat frequency signals, because processing beat frequency signal make use of the property of trigonometric function. It has the obvious difference with traditional beat frequency method using square waveform and Zero Crosser Assembly.

High-Precision Frequency Measurement Using Digital Signal Processing 123

Server program configures the parameters of each channel, maintains synchronization of the data stream, carries out the simple preprocessing (either ignore those points that are significantly less than or greater than the threshold or detect missing points and substitute extrapolated values to maintain data integrity), stores original data and results of measuring

Fig. 8. MF software, (a) shows the window of configuring parameters and choosing

channels, (b) shows the strip chart of real-time original data of one of channels, (c) shows the graph of the real-time results of frequency measurement, (d) shows the child panel that covers the original data, frequency values and Allan deviation information of one of

to disk.

channel.
