Perform coarse CFO estimation
specifies the correlation offset as a fraction of
a short training symbol.
fOffset = wlanCoarseCFOEstimate(
Coarse Estimate of CFO for Non-HT Waveform
Create a 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 kHz frequency offset.
pfOffset = comm.PhaseFrequencyOffset('SampleRate',20e6,'FrequencyOffset',2000); rxSig = pfOffset(txSig);
Extract the L-STF.
ind = wlanFieldIndices(nht,'L-STF'); rxLSTF = rxSig(ind(1):ind(2),:);
Estimate the frequency offset from the L-STF.
freqOffsetEst = wlanCoarseCFOEstimate(rxLSTF,'CBW20')
freqOffsetEst = 2.0000e+03
Estimate and Correct CFO for VHT Waveform with Correlation Offset
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-STF.
vht = wlanVHTConfig; txstf = wlanLSTF(vht);
Set the channel bandwidth and sample rate.
cbw = 'CBW80'; fs = 80e6;
Create TGac and thermal noise channel objects. Set the delay profile of the TGac channel to
'Model-C'. Set the noise figure of the thermal noise channel to 9 dB.
tgacChan = wlanTGacChannel('SampleRate',fs,'ChannelBandwidth',cbw, ... 'DelayProfile','Model-C','LargeScaleFadingEffect','Pathloss'); noise = comm.ThermalNoise('SampleRate',fs,'NoiseMethod','Noise figure', ... 'NoiseFigure',9);
Pass the L-STF through the noisy TGac channel.
rxstfNoNoise = tgacChan(txstf); rxstf = noise(rxstfNoNoise);
Create a phase and frequency offset object and introduce a 750 Hz frequency offset.
pfOffset = comm.PhaseFrequencyOffset('SampleRate',fs, ... 'FrequencyOffsetSource','Input port'); rxstf = pfOffset(rxstf,750);
For the model-C delay profile, the RMS delay spread is 30 ns, which is 3/8 of the 80 ns short training symbol duration. As such, set the correlation offset to 0.375.
corrOffset = 0.375;
Estimate the frequency offset. Your results may differ slightly.
fOffsetEst = wlanCoarseCFOEstimate(rxstf,cbw,corrOffset)
fOffsetEst = 746.2700
The estimate is very close to the introduced CFO of 750 Hz.
Change the delay profile to
'Model-E', which has an RMS delay spread of 100 ns.
release(tgacChan) tgacChan.DelayProfile = 'Model-E';
Pass the transmitted signal through the modified channel and apply the 750 Hz CFO.
rxstfNoNoise = tgacChan(txstf); rxstf = noise(rxstfNoNoise); rxstf = pfOffset(rxstf,750);
Estimate the frequency offset.
fOffsetEst = wlanCoarseCFOEstimate(rxstf,cbw,corrOffset)
fOffsetEst = 947.7234
The estimate is inaccurate because the RMS delay spread is greater than the duration of the training symbol.
Set the correlation offset to the maximum value of 1 and estimate the CFO.
corrOffset = 1; fOffsetEst = wlanCoarseCFOEstimate(rxstf,cbw,corrOffset)
fOffsetEst = 745.3640
The estimate is accurate because the autocorrelation does not use the first training symbol. The channel delay renders this symbol useless.
Correct for the estimated frequency offset.
rxstfCorrected = pfOffset(rxstf,-fOffsetEst);
Estimate the frequency offset of the corrected signal.
fOffsetEstCorr = wlanCoarseCFOEstimate(rxstfCorrected,cbw,corrOffset)
fOffsetEstCorr = 2.4911e-11
The corrected signal has negligible frequency offset.
Two-Step CFO Estimation and Correction
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', ... 'NoiseFigure',9);
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 = -1.9722e-11
The CFO is zero.
rxSig — Received L-STF samples
Received L-STF samples, specified as a complex-valued matrix of size NS-by-NR. NS is the number of samples in the L-STF and NR is the number of receive antennas.
If the number of samples in this input is greater than the number of samples in the L-STF, the function estimates the CFO by using only the first NS samples.
Complex Number Support: Yes
cbw — Channel bandwidth
Channel bandwidth, specified as one of these values.
'CBW5'– Channel bandwidth of 5 MHz
'CBW10'– Channel bandwidth of 10 MHz
'CBW20'– Channel bandwidth of 20 MHz
'CBW40'– Channel bandwidth of 40 MHz
'CBW80'– Channel bandwidth of 80 MHz
'CBW160'– Channel bandwidth of 160 MHz
'CBW320'– Channel bandwidth of 320 MHz
corrOffset — Correlation offset
0.75 (default) | scalar in the interval [0, 1]
Correlation offset as a fraction of a short training symbol, specified as a scalar in the interval [0, 1]. The duration of the short training symbol varies with bandwidth. For more information, see L-STF.
fOffset — Frequency offset
Frequency offset, in Hz, returned as a real-valued scalar. The function can estimate a maximum CFO of 625 kHz, or twice the subcarrier spacing.
The legacy short training field (L-STF) is the first field of the 802.11™ OFDM PLCP legacy preamble. The L-STF is a component of VHT, HT, and non-HT PPDUs.
The L-STF duration varies with channel bandwidth.
|Channel Bandwidth (MHz)||Subcarrier Frequency Spacing, ΔF (kHz)||Fast Fourier Transform (FFT) Period (TFFT = 1 / ΔF)||L-STF Duration (TSHORT = 10 × TFFT / 4)|
|20, 40, 80, 160, and 320||312.5||3.2 μs||8 μs|
|10||156.25||6.4 μs||16 μs|
|5||78.125||12.8 μs||32 μs|
Because the sequence has good correlation properties, it is used for start-of-packet detection, for coarse frequency correction, and for setting the AGC. The sequence uses 12 of the 52 subcarriers that are available per 20 MHz channel bandwidth segment. For 5 MHz, 10 MHz, and 20 MHz bandwidths, the number of channel bandwidths segments is 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.
 Li, Jian. “Carrier Frequency Offset Estimation for OFDM-Based WLANs.” IEEE Signal Processing Letters. Vol. 8, Issue 3, Mar 2001, pp. 80–82.
 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.
 Perahia, E. and R. Stacey. Next Generation Wireless LANs: 802.11n and 802.11ac. 2nd Edition. United Kingdom: Cambridge University Press, 2013.
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.