%% Fine Estimate of Carrier Frequency Offset
% 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')

% Copyright 2012 The MathWorks, Inc.