Frequency Estimation Using Zero Crossing Method

A sinusoidal signal is the most fundamental type of signal that exists in communication systems, power systems, navigation systems etc. It is controlled by three parameters which are the amplitude, phase and frequency. The last two, that is phase and frequency, are interconnected. As discussed in my previous post Instantaneous Frequency (IF) is nothing but the rate of change of phase. This can be mathematically described as:


It is sometimes important in communication systems to estimate the phase and frequency of the signal arriving at the receiver. This is especially true for Phase Modulated (PM) and Frequency Modulated (FM) systems. But any synchronous communication system requires that the carrier phase and frequency is synchronized between the transmitter and receiver. For more on carrier phase and frequency synchronization error please see my previous post.

There are number of ways to estimate the frequency of a sine wave, from Fast Fourier Transform (FFT), to Autoregressive (AR) methods, to high resolution spectral estimation methods such as MUSIC* and ESPRIT**. The challenge here is to perform an accurate estimation with minimum number of samples and in presence of high noise and interference. Sometimes it is also required to detect multiple sinusoids simultaneously, which are overlapping in time domain and closely spaced in the frequency domain.        

In this post we present the simplest method of frequency estimation that is called the Zero Crossing (ZC) method. Since a sine wave crosses the x-axis twice during each cycle, we can simply count the number of crossings and divide it by two and again divide it by the observation window size, giving us the frequency in Hertz. Please note that for this scheme to work we need to have a few complete cycles. Higher the length of the observation window greater is the accuracy.

It has been shown in [1] that at high Signal to Noise Ratio (SNR > 10dB) ZC estimator approaches the Cramer Rao Lower Bound (CRLB).  MATLAB code for the ZC method is given below. For comparison we have also included the FFT method in our simulation and results are shown in the figure below. Please remember that accuracy of the FFT method depends upon the window size T in the time domain. Mathematically, the frequency bin size is given as:


To separate two sinusoids the minimum separation must be 2Δf and not Δf as there needs to be a vacant bin between the two sinusoids. Also, we experimented with the frequency resolution of Zero Crossing detector and it was found out to be Δf/2 (although, unlike FFT, this method can detect only one tone at a time). It must be noted that frequency resolution of FFT does not increase by increasing the sampling frequency. In fact if sampling frequency is increased and number of samples remains the same, frequency resolution in fact decreases.

%            USING
clear all
close all

N=1e6;              % Number of samples
fc=1e9;             % Carrier frequency
fs=10*fc;           % Sampling frequency
ts=1/fs;            % Sampling interval
t=0:ts:N*ts;        % Total time
dp=pi/6;            % Phase offset
df=20e3;            % Frequency offset


% Frequency Estimation at Transmitter
for n=1:N
  if tx_carrier(n)>0 && tx_carrier(n+1)<0   % -ve going
  if tx_carrier(n)<0 && tx_carrier(n+1)>0   % +ve going

% Frequency Estimation at Receiver
for n=1:N
  if rx_carrier(n)>0 && rx_carrier(n+1)<0   % -ve going
  if rx_carrier(n)<0 && rx_carrier(n+1)>0   % +ve going

% Fourier Transform
axis([fc-2*df fc+2*df -15 5])
title('Fourier Transform')
grid on
FFT of Two Tones Embedded in Noise

[1] Yizheng Liao, “Phase and Frequency Estimation: High-Accuracy and Low-Complexity Techniques,” MS Thesis Worcester Polytechnic Institute, May 2011.

* MUSIC: Multiple Signal Classification

** ESPRIT: Estimation of Signal Parameters via Rotational Invariance Technique

Author: John (YA)

John has over 15 years of Research and Development experience in the field of Wireless Communications. He has worked for a number of companies around the world including Qualcomm Inc. USA. He has an MS in Electrical Engineering from Virginia Tech USA and has published his work in international journals and conferences.
0.00 avg. rating (0% score) - 0 votes

Leave a Reply

Your email address will not be published. Required fields are marked *