Options for channel modeling include addition of AWGN, channel models from the Communications System Toolbox™, plus TGn and TGac models from the WLAN System Toolbox™. This example shows how to pass WLAN waveforms through different channels. Because no front end filtering has been added and the oversampling rate is one, it is sufficient to set the channel model sampling frequency to match the channel bandwidth. Use a spectrum analyzer to display waveforms before and after they pass through the channel.

Create a bit stream to use when generating VHT, HT, and non-HT WLAN format waveforms.

bits = randi([0 1],1000,1);

Create a VHT configuration object and generate an 80 MHz VHT waveform.

vht = wlanVHTConfig; preChVHT = wlanWaveformGenerator(bits,vht);

Create a TGac SISO channel and AWGN channel. Use `Name,Value`

pairs to set the sample rate and channel bandwidth, to enable path loss and shadowing, and to use the Model-D delay profile.

bw = vht.ChannelBandwidth; fs = 80e6; chTGac = wlanTGacChannel('SampleRate',fs,'ChannelBandwidth',bw,... 'LargeScaleFadingEffect','Pathloss and shadowing','DelayProfile','Model-D') chAWGN = comm.AWGNChannel('NoiseMethod','Variance','VarianceSource','Input port')

chTGac = wlanTGacChannel with properties: SampleRate: 80000000 DelayProfile: 'Model-D' ChannelBandwidth: 'CBW80' CarrierFrequency: 5.2500e+09 TransmitReceiveDistance: 3 NormalizePathGains: 1 UserIndex: 0 TransmissionDirection: 'Downlink' NumTransmitAntennas: 1 NumReceiveAntennas: 1 LargeScaleFadingEffect: 'Pathloss and shadowing' FluorescentEffect: 1 PowerLineFrequency: '60Hz' RandomStream: 'Global stream' NormalizeChannelOutputs: 1 chAWGN = comm.AWGNChannel with properties: NoiseMethod: 'Variance' VarianceSource: 'Input port' RandomStream: 'Global stream'

Calculate the noise variance for a receiver with a 9 dB noise figure. The noise variance, `nVar`

, is equal to kTBF, where k is Boltzmann's constant, T is the ambient temperature of 290 K, B is the bandwidth (sample rate), and F is the receiver noise figure. Pass the transmitted waveform through the noisy, TGac channel.

nVar = 10^((-228.6 + 10*log10(290) + 10*log10(fs) + 9)/10); postChVHT = step(chAWGN,step(chTGac,preChVHT),nVar);

Display a spectrum analyzer with before-channel and after-channel waveforms. Use `SpectralAverages`

= 10 to reduce noise in the plotted signals

title = '80 MHz VHT Waveform Before and After TGac Channel'; sa = dsp.SpectrumAnalyzer('SampleRate',fs,'ShowLegend',true,... 'SpectralAverages',10,'Title',title,'ChannelNames',{'Before','After'}); step(sa,[preChVHT,postChVHT]);

The path loss results from the default transmitter-to-receiver distance of three meters, and from shadowing effects. This path loss accounts for the roughly 50 to 60 dB of separation between the waveform before and after passing through the TGac channel. The frequency selectivity of the delay profile is seen in the signal level variation across the frequency spectrum.

Create an HT configuration object and generate an HT waveform.

ht = wlanHTConfig; preChHT = wlanWaveformGenerator(bits,ht);

Create a TGn SISO channel and AGWN channel. Use `Name,Value`

pairs to set the sample rate, to enable path loss and shadowing, and to use the Model-F delay profile.

fs = 20e6; chTGn = wlanTGnChannel('SampleRate',fs,'LargeScaleFadingEffect',... 'Pathloss and shadowing','DelayProfile','Model-F') chAWGN = comm.AWGNChannel('NoiseMethod','Variance','VarianceSource','Input port')

chTGn = wlanTGnChannel with properties: SampleRate: 20000000 DelayProfile: 'Model-F' CarrierFrequency: 5.2500e+09 TransmitReceiveDistance: 3 NormalizePathGains: 1 NumTransmitAntennas: 1 NumReceiveAntennas: 1 LargeScaleFadingEffect: 'Pathloss and shadowing' RandomStream: 'Global stream' NormalizeChannelOutputs: 1 chAWGN = comm.AWGNChannel with properties: NoiseMethod: 'Variance' VarianceSource: 'Input port' RandomStream: 'Global stream'

Calculate the noise variance for a receiver with a 9 dB noise figure. The noise variance, `nVar`

, is equal to kTBF, where k is Boltzmann's constant, T is the ambient temperature of 290 K, B is the bandwidth (sample rate), and F is the receiver noise figure. Pass the transmitted waveform through the noisy TGn channel.

nVar = 10^((-228.6 + 10*log10(290) + 10*log10(fs) + 9)/10); postChHT = step(chAWGN, step(chTGn,preChHT), nVar);

Display a spectrum analyzer with before-channel and after-channel waveforms. Use `SpectralAverages`

= 10 to reduce noise in the plotted signals

title = '20 MHz HT Waveform Before and After TGn Channel'; sa = dsp.SpectrumAnalyzer('SampleRate',fs,'ShowLegend',true,... 'SpectralAverages',10,'Title',title,'ChannelNames',{'Before','After'}); step(sa,[preChHT,postChHT]);

The path loss results from the default transmitter-to-receiver distance of three meters, and from shadowing effects. This path loss accounts for the roughly 50 to 60 dB of separation between the waveform before and after passing through the TGn channel. The frequency selectivity of the delay profile is seen in the signal level variation across the frequency spectrum.

Create a non-HT configuration object and generate a non-HT waveform.

nht = wlanNonHTConfig; preChNonHT = wlanWaveformGenerator(bits,nht);

Calculate free-space path loss for a transmitter-to-receiver separation distance of three meters. Create an 802.11g channel with a 3 Hz maximum Doppler shift and an RMS path delay equal to two times the sample time. Create an AWGN channel.

dist = 3; fc = 2.4e9; pathLoss = 10^(-log10(4*pi*dist*(fc/3e8))); fs = 20e6; trms = 2/fs; ch802 = stdchan(1/fs,dist,'802.11g',trms) chAWGN = comm.AWGNChannel('NoiseMethod','Variance','VarianceSource','Input port')

ch802 = ChannelType: 'Rayleigh' InputSamplePeriod: 5.0000e-08 DopplerSpectrum: [1x1 doppler.jakes] MaxDopplerShift: 3 PathDelays: [1x21 double] AvgPathGaindB: [1x21 double] NormalizePathGains: 1 StoreHistory: 0 StorePathGains: 0 PathGains: [1x21 double] ChannelFilterDelay: 0 ResetBeforeFiltering: 1 NumSamplesProcessed: 0 chAWGN = comm.AWGNChannel with properties: NoiseMethod: 'Variance' VarianceSource: 'Input port' RandomStream: 'Global stream'

Calculate the noise variance for a receiver with a 9 dB noise figure. The noise variance, `nVar`

, is equal to kTBF, where k is Boltzmann's constant, T is the ambient temperature of 290 K, B is the bandwidth (sample rate), and F is the receiver noise figure. Pass the transmitted waveform through the noisy, lossy 802.11g channel.

nVar = 10^((-228.6 + 10*log10(290) + 10*log10(fs) + 9)/10); postChNonHT = step(chAWGN, filter(ch802,preChNonHT), nVar) * pathLoss;

Display a spectrum analyzer with before-channel and after-channel waveforms. Use `SpectralAverages`

= 10 to reduce noise in the plotted signals

title = '20 MHz Non-HT Waveform Before and After 802.11g Channel'; sa = dsp.SpectrumAnalyzer('SampleRate',fs,'ShowLegend',true,... 'SpectralAverages',10,'Title',title,'ChannelNames',{'Before','After'}); step(sa,[preChNonHT,postChNonHT]);

The free-space path loss accounts for the approximatley 50 dB of separation between the waveform before and after it passes through the 802.11g channel.

Create a multi-user VHT configuration object and generate a VHT waveform. Set the number of transmit antennas to four. Set the number of space-time streams and the number of receive antennas to three. Since the number of transmit antennas is not equal to the number of space-time streams, the spatial mapping is not direct. Set the spatial mapping to Hadamard.

ntx = 4; nsts = 3; nrx = 3; vht = wlanVHTConfig('NumTransmitAntennas',ntx,'NumSpaceTimeStreams',nsts,... 'SpatialMapping','Hadamard'); preChVHT = wlanWaveformGenerator(bits,vht);

Create a TGac MIMO channel and an AWGN channel. Disable large-scale fading effects.

bw = vht.ChannelBandwidth; fs = 80e6; chTGac = wlanTGacChannel('SampleRate',fs,'ChannelBandwidth',bw,... 'NumTransmitAntennas',ntx,'NumReceiveAntennas',nrx); chTGac.LargeScaleFadingEffect = 'None' chAWGN = comm.AWGNChannel('NoiseMethod','Variance','VarianceSource','Input port')

chTGac = wlanTGacChannel with properties: SampleRate: 80000000 DelayProfile: 'Model-B' ChannelBandwidth: 'CBW80' CarrierFrequency: 5.2500e+09 TransmitReceiveDistance: 3 NormalizePathGains: 1 UserIndex: 0 TransmissionDirection: 'Downlink' NumTransmitAntennas: 4 TransmitAntennaSpacing: 0.5000 NumReceiveAntennas: 3 ReceiveAntennaSpacing: 0.5000 LargeScaleFadingEffect: 'None' RandomStream: 'Global stream' NormalizeChannelOutputs: 1 chAWGN = comm.AWGNChannel with properties: NoiseMethod: 'Variance' VarianceSource: 'Input port' RandomStream: 'Global stream'

Calculate the noise variance for a receiver with a 9 dB noise figure. The noise variance, `nVar`

, is equal to kTBF, where k is Boltzmann's constant, T is the ambient temperature of 290 K, B is the bandwidth (sample rate), and F is the receiver noise figure. Pass the transmitted waveform through the noisy TGac channel.

nVar = 10^((-228.6 + 10*log10(290) + 10*log10(fs) + 9)/10); postChVHT = step(chAWGN,step(chTGac,preChVHT),nVar);

Display a spectrum analyzer showing the multiple streams after the channel effects have been added. Use `SpectralAverages`

= 10 to reduce noise in the plotted signals

title = '80 MHz VHT 4x3 MIMO Waveform After TGac Channel'; sa = dsp.SpectrumAnalyzer('SampleRate',fs,'ShowLegend',true,... 'SpectralAverages',10,'Title',title,'ChannelNames',{'RX1','RX2','RX3'}); step(sa,postChVHT);

The overlaid signals show the TGac channel variation between received streams.

References

[1] Erceg, V., L. Schumacher, P. Kyritsi, et al. *TGn Channel Models*. Version 4. IEEE 802.11-03/940r4, May 2004.

[2] Breit, G., H. Sampath, S. Vermani, et al. *TGac Channel Model Addendum*. Version 12. IEEE 802.11-09/0308r12, March 2010.

`stdchan`

| wlanHTConfig Properties | wlanNonHTConfig Properties | wlanRecoveryConfig Properties | `wlanTGacChannel`

| `wlanTGnChannel`

| wlanVHTConfig Properties

Was this topic helpful?