Coarse Frequency Compensator
Compensate for carrier frequency offset in PAM, PSK, or QAM
Communications Toolbox / RF Impairments Correction
Communications Toolbox / Synchronization
The Coarse Frequency Compensator block compensates for carrier frequency offset in QAM, 8-PSK, BPSK, OQPSK, PAM, and QPSK modulation schemes.
Compensate Signal Frequency and Phase Offset in Simulink
Compensate for a frequency offset imposed on a noisy 8-PSK channel by using the Coarse Frequency Compensator block.
doc_coarsefreqcomp model compares a frequency offset impaired signal to one that has coarse frequency compensation applied.
A spectrum analyzer plot shows the transmitted signal before and after applying coarse frequency compensation.
Estimated frequency offset is 1999.9694824.2 Hz.
In — Input signal
Input signal, specified as a column vector.
Complex Number Support: Yes
Out — Compensated output signal
complex column vector
Compensated output signal, returned as a complex column vector with the same dimensions and data type as the input In.
FreqEst — Estimate of frequency offset
Estimate of the frequency offset, returned as a scalar.
To add this port, select Estimated frequency offset output port.
To edit block parameters interactively, use the Property Inspector. From the Simulink® Toolstrip, on the Simulation tab, in the Prepare gallery, select Property Inspector.
Modulation type of input signal — Modulation type
QAM (default) |
Modulation type, specified as
Estimation algorithm — Algorithm used to estimate frequency offset
FFT-based (default) |
Specify the frequency offset estimation algorithm as
The table shows the allowable combinations of the modulation type and the estimation algorithm.
|Modulation||FFT-Based Algorithm||Correlation-Based Algorithm|
For more information, see Algorithms.
This parameter appears when you set Modulation type of input signal to
Frequency resolution (Hz) — Frequency resolution
100 (default) | positive scalar
Frequency resolution in Hz, specified as a positive real scalar.
This parameter applies when you set Estimation algorithm to
Samples per symbol — Number of samples per symbol
4 (default) | even integer greater than or equal to
Number of samples per symbol, specified as an even integer scalar greater than or equal to 4.
This parameter appears when you set Modulation type of input signal to
Maximum frequency offset (Hz) — Maximum measurable frequency offset
5e3 (default) | positive scalar
Maximum measurable frequency offset in Hz, specified as a positive scalar.
This parameter appears when you set Estimation algorithm to
Estimated frequency offset output port — Option to add estimated frequency offset output port
on (default) |
Select this check box to add the FreqEst output port. The FreqEst port outputs the estimated frequency offset in Hz.
Simulate using — Type of simulation to run
Code generation (default) |
Type of simulation to run, specified as
Code generation or
Code generation— Simulate the model by using generated C code. The first time you run a simulation, Simulink generates C code for the block. The model reuses the C code for subsequent simulations unless the model changes. This option requires additional startup time, but the speed of the subsequent simulations is faster than with the
Interpreted execution— Simulate the model by using the MATLAB® interpreter. This option shortens startup time, but the speed of subsequent simulations is slower than with the
Code generationoption. In this mode, you can debug the source code of the block.
For more information, see Simulation Modes (Simulink).
Reference [ 1 ] describes the correlation-based estimation algorithm used to estimate the
frequency offset for PSK and PAM signals. To determine the frequency offset,
Δf, the algorithm performs a maximum likelihood (ML) estimation
of the complex-valued oscillation
observed signal, rk, is represented as
Ts is the sampling interval, θ is an unknown random phase, and N is the number of samples. The ML estimation of the frequency offset is equivalent to seeking the maximum of the likelihood function,
After simplifying, the problem is expressed as a discrete Fourier transform, weighted by a parabolic windowing function. It is expressed as
R(k) denotes the estimated autocorrelation of the sequence rk and is represented as
The term k(N–k) is the parabolic windowing function. In [ 1 ], it is shown that R(k) is a poor estimate of the autocorrelation of rk when k = 0 or when k is close to N. Consequently, the windowing function can be expressed as a rectangular sequence of 1s for k = 1, 2, ..., L, where L ≤ N – 1. The result is a modified ML estimation strategy in which
This equation results in an estimate of in which
The sampling frequency, fsamp, is the reciprocal of Ts. The number of elements used to compute the autocorrelation sequence, L, are determined as
fmax is the maximum expected frequency offset and
round is the nearest integer function. The frequency offset
estimate improves when L ≥ 7 and leads to the recommendation that fmax ≤
FFT-based estimation algorithms can be used to estimate the frequency offset for various modulation types. The coarse frequency compensator implementation supports these modulation methods by using the algorithm noted.
QAMmodulation, the coarse frequency compensator uses the FFT-based algorithm described in [ 2 ]. The algorithm estimates by using a periodogram of the mth power of the received signal and is given as
where m is the modulation order, r(k) is the received sequence, Rsym is the symbol rate, and N is the number of samples. The algorithm searches for a frequency that maximizes the time average of the mth power of the received signal multiplied by various frequencies in the range of [–Rsym / 2, Rsym / 2]. Because the form of the algorithm is the definition of the discrete Fourier transform of rm(t), searching for a frequency that maximizes the time average is equivalent to searching for a peak line in the spectrum of rm(t). The number of points required by the FFT is
where fr is the desired frequency resolution.
For OQPSK modulation, the coarse frequency compensator uses the FFT-based algorithm described in [ 4 ]. The algorithm searches for spectral peaks at ±200 kHz around the symbol rate. This technique locates desired peaks in the presence of interference from spectral content around baseband frequencies due to filtering.
 Luise, M., and R. Reggiannini. “Carrier Frequency Recovery in All-Digital Modems for Burst-Mode Transmissions.” IEEE® Transactions on Communications, Vol. 43, No. 2/3/4, Feb. 1995, pp. 1169–1178.
 Wang, Y., et al. “Non-Data-Aided Feedforward Carrier Frequency Offset Estimators for QAM Constellations: A Nonlinear Least-Squares Approach.” EURASIP Journal on Advances in Signal Processing, Vol. 2004, No. 13, Dec. 2004, p. 856139. https://doi.org/10.1155/S1110865704403175.
 Nakagawa, Tadao, et al. “Non-Data-Aided Wide-Range Frequency Offset Estimator for QAM Optical Coherent Receivers.” Optical Fiber Communication Conference/National Fiber Optic Engineers Conference 2011, OSA, 2011, paper OMJ1. https://doi.org/10.1364/OFC.2011.OMJ1.
 Olds, Jonathan. Designing an OQPSK demodulator.
C/C++ Code Generation
Generate C and C++ code using Simulink® Coder™.
Version HistoryIntroduced in R2015b
R2023b: Default settings change
The Coarse Frequency Compensator block parameters have new default values.
|Parameter||New Default||Previous Default|
|Frequency resolution (Hz)|
|Maximum frequency offset (Hz)|
When executing code created in a previous release, confirm the coarse frequency compensator settings. The new default settings change your results. To produce results using the previous default settings, you can manually update the settings of your block.