This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.


Fine estimate of carrier frequency offset


fOffset = wlanFineCFOEstimate(rxSig,cbw)
fOffset = wlanFineCFOEstimate(rxSig,cbw,corrOffset)



fOffset = wlanFineCFOEstimate(rxSig,cbw) returns a fine estimate of the carrier frequency offset (CFO) given received time-domain L-LTF[1] samples rxSig and channel bandwidth cbw.


fOffset = wlanFineCFOEstimate(rxSig,cbw,corrOffset) returns the estimated frequency offset given correlation offset corrOffset.


collapse all

Create non-HT configuration object.

nht = wlanNonHTConfig;

Generate a non-HT waveform.

txSig = wlanWaveformGenerator([1;0;0;1],nht);

Create a phase and frequency offset object and introduce a 2 Hz frequency offset.

pfOffset = comm.PhaseFrequencyOffset('SampleRate',20e6,'FrequencyOffset',2);
rxSig = pfOffset(txSig);

Extract the L-LTF and estimate the frequency offset.

ind = wlanFieldIndices(nht,'L-LTF');
rxlltf = rxSig(ind(1):ind(2),:);
freqOffsetEst = wlanFineCFOEstimate(rxlltf,'CBW20')
freqOffsetEst = 2.0000

Estimate the frequency offset for a VHT signal passing through a noisy, TGac channel. Correct for the frequency offset.

Create a VHT configuration object and create the L-LTF.

vht = wlanVHTConfig;
txltf = wlanLLTF(vht);

Set the sample rate to correspond to the default bandwidth of the VHT configuration object.

fs = 80e6;

Create TGac and thermal noise channel objects. Set the noise figure of the AWGN channel to 10 dB.

tgacChan = wlanTGacChannel('SampleRate',fs, ...
    'ChannelBandwidth',vht.ChannelBandwidth, ...

noise = comm.ThermalNoise('SampleRate',fs, ...
    'NoiseMethod','Noise figure', ...

Pass the L-LTF through the noisy TGac channel.

rxltfNoNoise = tgacChan(txltf);
rxltf = noise(rxltfNoNoise);

Create a phase and frequency offset object and introduce a 25 Hz frequency offset.

pfoffset = comm.PhaseFrequencyOffset('SampleRate',fs,'FrequencyOffsetSource','Input port');
rxltf = pfoffset(rxltf,25);

Perform a fine estimate the frequency offset using a correlation offset of 0.6. Your results may differ slightly.

fOffsetEst = wlanFineCFOEstimate(rxltf,vht.ChannelBandwidth,0.6)
fOffsetEst = 28.0773

Correct for the estimated frequency offset.

rxltfCorr = pfoffset(rxltf,-fOffsetEst);

Estimate the frequency offset of the corrected signal.

fOffsetEstCorr = wlanFineCFOEstimate(rxltfCorr,vht.ChannelBandwidth,0.6)
fOffsetEstCorr = -3.1286e-13

The corrected signal has negligible frequency offset.

Estimate and correct for a significant carrier frequency offset in two steps. Estimate the frequency offset after all corrections have been made.

Set the channel bandwidth and the corresponding sample rate.

cbw = 'CBW40';
fs = 40e6;

Coarse Frequency Correction

Generate an HT format configuration object.

cfg = wlanHTConfig('ChannelBandwidth',cbw);

Generate the transmit waveform.

txSig = wlanWaveformGenerator([1;0;0;1],cfg);

Create TGn and thermal noise channel objects. Set the noise figure of the receiver to 9 dB.

tgnChan = wlanTGnChannel('SampleRate',fs,'DelayProfile','Model-D', ...
    'LargeScaleFadingEffect','Pathloss and shadowing');
noise = comm.ThermalNoise('SampleRate',fs, ...
    'NoiseMethod','Noise figure', ...

Pass the waveform through the TGn channel and add noise.

rxSigNoNoise = tgnChan(txSig);
rxSig = noise(rxSigNoNoise);

Create a phase and frequency offset object to introduce a carrier frequency offset. Introduce a 2 kHz frequency offset.

pfOffset = comm.PhaseFrequencyOffset('SampleRate',fs,'FrequencyOffsetSource','Input port');
rxSig = pfOffset(rxSig,2e3);

Extract the L-STF signal for coarse frequency offset estimation.

istf = wlanFieldIndices(cfg,'L-STF');
rxstf = rxSig(istf(1):istf(2),:);

Perform a coarse estimate of the frequency offset. Your results may differ.

foffset1 = wlanCoarseCFOEstimate(rxstf,cbw)
foffset1 = 2.0221e+03

Correct for the estimated offset.

rxSigCorr1 = pfOffset(rxSig,-foffset1);

Fine Frequency Correction

Extract the L-LTF signal for fine offset estimation.

iltf = wlanFieldIndices(cfg,'L-LTF');
rxltf1 = rxSigCorr1(iltf(1):iltf(2),:);

Perform a fine estimate of the corrected signal.

foffset2 = wlanFineCFOEstimate(rxltf1,cbw)
foffset2 = -11.0795

The corrected signal offset is reduced from 2000 Hz to approximately 7 Hz.

Correct for the remaining offset.

rxSigCorr2 = pfOffset(rxSigCorr1,-foffset2);

Determine the frequency offset of the twice corrected signal.

rxltf2 = rxSigCorr2(iltf(1):iltf(2),:);
deltaFreq = wlanFineCFOEstimate(rxltf2,cbw)
deltaFreq = -2.0048e-11

The CFO is zero.

Input Arguments

collapse all

Received signal containing an L-LTF, specified as an NS-by-NR matrix. NS is the number of samples in the L-LTF and NR is the number of receive antennas.


If the number of samples in rxSig is greater than the number of samples in the L-LTF, the trailing samples are not used to estimate the carrier frequency offset.

Data Types: double
Complex Number Support: Yes

Channel bandwidth in MHz, specified as 'CBW5', 'CBW10', 'CBW20', 'CBW40', 'CBW80', or 'CBW160'.

Data Types: char | string

Correlation offset as a fraction of the L-LTF cyclic prefix, specified as a real scalar from 0 to 1. The duration of the short training symbol varies with bandwidth. For more information, see L-LTF.

Data Types: double

Output Arguments

collapse all

Frequency offset in Hz, returned as a real scalar.

Data Types: double

More About

collapse all


The legacy long training field (L-LTF) is the second field in the 802.11™ OFDM PLCP legacy preamble. The L-LTF is a component of VHT, HT, and non-HT PPDUs.

Channel estimation, fine frequency offset estimation, and fine symbol timing offset estimation rely on the L-LTF.

The L-LTF is composed of a cyclic prefix (CP) followed by two identical long training symbols (C1 and C2). The CP consists of the second half of the long training symbol.

The L-LTF duration varies with channel bandwidth.

Channel Bandwidth (MHz)Subcarrier Frequency Spacing, ΔF (kHz)Fast Fourier Transform (FFT) Period (TFFT = 1 / ΔF)Cyclic Prefix or Training Symbol Guard Interval (GI2) Duration (TGI2 = TFFT / 2)L-LTF Duration (TLONG = TGI2 + 2 × TFFT)
20, 40, 80, and 160312.53.2 μs1.6 μs8 μs
10156.256.4 μs3.2 μs16 μs
578.12512.8 μs6.4 μs32 μs


[1] IEEE Std 802.11™-2016 (Revision of IEEE Std 802.11-2012). “Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications.” IEEE Standard for Information technology — Telecommunications and information exchange between systems — Local and metropolitan area networks — Specific requirements.

[2] Li, Jian. “Carrier Frequency Offset Estimation for OFDM-Based WLANs.” IEEE Signal Processing Letters. Vol. 8, Issue 3, Mar 2001, pp. 80–82.

[3] Moose, P. H. “A technique for orthogonal frequency division multiplexing frequency offset correction.” IEEE Transactions on Communications. Vol. 42, Issue 10, Oct 1994, pp. 2908–2914.

[4] Perahia, E., and R. Stacey. Next Generation Wireless LANs: 802.11n and 802.11ac. 2nd Edition. United Kingdom: Cambridge University Press, 2013.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2015b

[1] IEEE® Std 802.11-2012 Adapted and reprinted with permission from IEEE. Copyright IEEE 2012. All rights reserved.