Update September 2022: New section on the non-conjugate and conjugate coherence function.
In this post I provide some tools for the do-it-yourself CSP practitioner. One of the goals of this blog is to help new CSP researchers and students to write their own estimators and algorithms. This post contains some spectral correlation function and cyclic autocorrelation function estimates and numerically evaluated formulas that can be compared to those produced by anybody’s code.
The signal of interest is, of course, our rectangular-pulse BPSK signal with symbol rate (normalized frequency units) and carrier offset . You can download a MATLAB script for creating such a signal here.
The formula for the SCF for a textbook BPSK signal is published in several places (The Literature [R47], My Papers ) and depends mainly on the Fourier transform of the pulse function used by the textbook signal.
We’ll compare the numerically evaluated spectral correlation formula with estimates produced by my version of the frequency-smoothing method (FSM). The FSM estimates and the theoretical functions are contained in a MATLAB mat file here. (
I had to change the extension of the mat file from .mat to .doc to allow posting it to WordPress–change it back after downloading. It is a zipped .mat file as of 12/2/22.) In all the results shown here and that you can download, the processed data-block length is samples and the FSM smoothing width is Hz. A rectangular smoothing window is used. For all cycle frequencies except zero (non-conjugate), a zero-padding factor of two is used in the FSM.
For the cyclic autocorrelation, we provide estimates using two methods: inverse Fourier transformation of the spectral correlation estimate and direct averaging of the second-order lag product in the time domain.
Let’s look at the PSD first. The graph in Figure 1 shows a plot of the theoretical PSD for the signal plus noise and the corresponding FSM estimate. The signal power is one and the noise power is . The mainlobe and the two adjacent sidelobes match nearly perfectly; there is a small discrepancy three or four sidelobes away from the mainlobe. Overall, I judge this an excellent match between theory and measurement.
Non-Conjugate Spectral Correlation
Next consider the non-conjugate cycle frequencies, which are harmonics of the bit rate . The first three harmonics are , and , and the theoretical and FSM-estimated non-conjugate spectral correlation function magnitudes are shown in Figure 2.
Conjugate Spectral Correlation
Figure 3 shows three of the conjugate spectral correlation function magnitudes. The conjugate cycle frequencies are equal to the doubled carrier plus harmonics of the BPSK bit rate, or . The three functions shown below correspond to .
Non-Conjugate Cyclic Autocorrelation
Each of the functions above is inverse Fourier transformed and the resulting cyclic autocorrelation estimates are plotted:
The cyclic autocorrelation functions are also directly estimated in the time domain by simply implementing the defining average:
Conjugate Cyclic Autocorrelation
The conjugate cyclic autocorrelation functions are estimated by inverse Fourier transforming the FSM spectral correlation estimates and by direct time-domain averaging of the lag product:
Non-Conjugate and Conjugate Coherence Functions
In this final section I use the FSM to estimate the coherence function for several of the BPSK signal’s cycle frequencies. The theoretical coherence function has a maximum magnitude of one, which is always achieved by the non-conjugate coherence for a cycle frequency of zero. That is, the power spectrum is perfectly coherent no matter what the signal. In practice, when we estimate the coherence using an estimate of the spectral correlation (for the numerator) and an estimate of the power spectrum (for the denominator), the value may exceed unity. A good debugging strategy for the coherence is to first focus on getting your code working for the non-conjugate cycle frequency of zero because you know that should be very close to one for all spectral frequencies.
Figure 8 shows the FSM-estimated non-conjugate spectral coherence for a cycle frequency of zero along with the theoretical power spectrum from Figure 1. My implementation of the FSM actually calculates the coherence here–it doesn’t just set it equal to one if it sees the zero cycle frequency.
Figure 9 shows the estimated non-conjugate spectral coherence estimates along with the theoretical spectral correlation functions so you can visually line up the peaks.
Finally, Figure 10 shows estimated conjugate spectral coherence functions along with their associated theoretical conjugate spectral correlation functions.
The matches between theory and measurement are excellent. This should give you confidence in comparing the results here with the output of your estimator when you use the rectangular-pulse BPSK signal.
Don’t forget to download the MATLAB file containing all the functions plotted in this post (including their time or frequency vectors that define the x-axis) here.