%% Detect 802.11n Packet
% Detect a received 802.11n™ packet at a signal-to-noise ratio (SNR) of 20 dB.
% Create an HT configuration object and TGn channel object. Generate a transmit waveform.

cfgHT = wlanHTConfig;
tgn = wlanTGnChannel('LargeScaleFadingEffect','None');
txWaveform = wlanWaveformGenerator([1;0;0;1],cfgHT);

% Pass the waveform through a TGn channel with an SNR of 20 dB. Detect the start of the packet.

snr = 20;
fadedSig = tgn(txWaveform);
rxWaveform = awgn(fadedSig,snr,0);
startOffset = wlanPacketDetect(rxWaveform,cfgHT.ChannelBandwidth)

% Copyright 2012 The MathWorks, Inc.