matlab plotrec,Basic VHT Data Recovery

Basic Data Recovery

WLAN Toolbox™ provides functions to generate and recover IEEE® 802.11ac™ standards-compliant waveforms. The data recovery process comprises these steps.

Generate a VHT waveform

Pass the waveform through a channel

Extract the VHT-LTF and demodulate

Estimate the channel by using the demodulated VHT-LTF

Extract the data field

Recover the data by using the channel and noise variance estimates

The block diagram shows these steps, along with their corresponding commands.

8ed9f874f1dcaaf408d2b9060b0ff2a1.png

Create VHT configuration object.

cfg = wlanVHTConfig;

Create a VHT transmit waveform by using the VHT configuration object. Set the data sequence to [1;0;1;1]. The waveform generator function repeats the data sequence to generate the specified number of packets.

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

Pass the received signal through an AWGN channel.

rxSig = awgn(txSig,10);

Determine the field indices of the waveform.

ind = wlanFieldIndices(cfg);

Extract the VHT-LTF from the received signal.

rxVHTLTF = rxSig(ind.VHTLTF(1):ind.VHTLTF(2),:);

Demodulate the VHT-LTF. Estimate the channel response by using the demodulated signal.

demodVHTLTF = wlanVHTLTFDemodulate(rxVHTLTF,cfg);

chEst = wlanVHTLTFChannelEstimate(demodVHTLTF,cfg);

Extract the VHT data field.

rxData = rxSig(ind.VHTData(1):ind.VHTData(2),:);

Recover the information bits by using the channel and noise variance estimates. Confirm that the first 8 bits match two repetitions of the input data sequence of [1;0;1;1].

rxBits = wlanVHTDataRecover(rxData,chEst,0.1,cfg);

rxBits(1:8)

ans = 8x1 int8 column vector

1

0

1

1

1

0

1

1

Data Recovery with Frequency Correction

Data recovery when a carrier frequency offset is present is accomplished by these steps.

Generate a VHT waveform

Pass the waveform through a channel

Extract the L-STF and perform a coarse frequency offset estimate

Correct for the offset by using the coarse estimate

Extract the L-LTF and perform a fine frequency offset estimate

Correct for the offset by using the fine estimate

Extract the VHT-LTF and demodulate

Estimate the channel by using the demodulated VHT-LTF

Extract the data field

Recover the data by using the channel and noise variance estimates

The block diagram shows these steps, along with their corresponding commands.

715153b076da5ef7d488e40e628301e2.png

Set the channel bandwidth and sample rate.

cbw = 'CBW160';

fs = 160e6;

Create a VHT configuration object that supports a 2x2 MIMO transmission.

cfg = wlanVHTConfig('ChannelBandwidth',cbw, ...

'NumTransmitAntennas',2,'NumSpaceTimeStreams',2);

Generate a VHT waveform containing a random PSDU.

txPSDU = randi([0 1],cfg.PSDULength*8,1);

txSig = wlanWaveformGenerator(txPSDU,cfg);

Create a 2x2 TGac channel.

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

'NumTransmitAntennas',2,'NumReceiveAntennas',2);

Create a phase and frequency offset object.

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

Pass the transmitted waveform through the noisy TGac channel.

rxSigNoNoise = tgacChan(txSig);

rxSig = awgn(rxSigNoNoise,15);

Introduce a frequency offset of 500 Hz to the received signal.

rxSigFreqOffset = pfOffset(rxSig,500);

Find the start and stop indices for all component fields of the PPDU.

ind = wlanFieldIndices(cfg);

Extract the L-STF. Estimate and correct for the carrier frequency offset.

rxLSTF = rxSigFreqOffset(ind.LSTF(1):ind.LSTF(2),:);

foffset1 = wlanCoarseCFOEstimate(rxLSTF,cbw);

rxSig1 = pfOffset(rxSigFreqOffset,-foffset1);

Extract the L-LTF from the corrected signal. Estimate and correct for the residual frequency offset.

rxLLTF = rxSig1(ind.LLTF(1):ind.LLTF(2),:);

foffset2 = wlanFineCFOEstimate(rxLLTF,cbw);

rxSig2 = pfOffset(rxSig1,-foffset2);

Extract and demodulate the VHT-LTF. Estimate the channel coefficients.

rxVHTLTF = rxSig2(ind.VHTLTF(1):ind.VHTLTF(2),:);

demodVHTLTF = wlanVHTLTFDemodulate(rxVHTLTF,cfg);

chEst = wlanVHTLTFChannelEstimate(demodVHTLTF,cfg);

Extract the VHT data field from the received and frequency-corrected PPDU. Recover the data field.

rxData = rxSig2(ind.VHTData(1):ind.VHTData(2),:);

rxPSDU = wlanVHTDataRecover(rxData,chEst,0.03,cfg);

Calculate the number of bit errors in the received packet.

numErr = biterr(txPSDU,rxPSDU)

numErr = 2

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值