Vous êtes sur la page 1sur 7

Adaptive Equalizer Simulation (Part I)

This script simulates a communication link with PSK modulation, raised-cosine pulse shaping, multipath fading, adaptive equalization.

It is the first of two parts: Part I (adapteqpt1.m) sets simulation parameters and creates channel and equalizer obj Part II (adapteqpt2.m) performs a link simulation based on these settings, which are stored in the MATLAB workspace. For information on the Part II script, enter demo('toolbox','comm') at the MATLAB prompt, and sele "Adaptive Equalizer Simulation (Part II)".

Part I sets up three equalization scenarios, and calls Part II multiple times for each of these. Each call correspond transmission block. The pulse shaping and multipath fading channel retain state information from one block to th For visualizing the impact of channel fading on adaptive equalizer convergence, the simulation resets the equaliz every block.

To experiment with different simulation settings, you can edit the Part I script. For instance, you can set the ResetBeforeFiltering property of the equalizer object to 0, which will cause the equalizer to retain state from one to the next.

Contents
y y y y y y

Modulation and Transmission Block Transmit/Receive Filters Additive White Gaussian Noise Simulation 1: Frequency-Flat Fading Channel Simulation 2: Frequency-Selective Fading Channel and Linear Equalizer Simulation 3: Decision Feedback Equalizer (DFE)

Modulation and Transmission Block

Set parameters related to PSK modulation and the transmission block. The block comprises three contiguous part training sequence, payload, and tail sequence. All use the same PSK scheme. The training and tail sequences are for equalization. We create a local random stream with known seed and state to be used by random number gene Using this local stream ensures that the results generated by this demo will be repeatable.
Tsym = 1e-6; % Symbol period (s) bitsPerSymbol = 2; % Number of bits per PSK symbol M = 2.^bitsPerSymbol; % PSK alphabet size (number of modulation levels) nPayload = 400; % Number of payload symbols nTrain = 100; % Number of training symbols nTail = 20; % Number of tail symbols pskmodObj = modem.pskmod(M); % modulator object hStream = RandStream('mt19937ar', 'Seed', 12345); % Local random number stre am % Training sequence symbols xTrainSym = randi(hStream, [0 M-1], 1, nTrain); % Modulated training sequence xTrain = modulate(pskmodObj, xTrainSym);

% Tail sequence symbols xTailSym = randi(hStream, [0 M-1], 1, nTail); % Modulated tail sequence xTail = modulate(pskmodObj, xTailSym);

Transmit/Receive Filters

Create structures containing information about the transmit and receive filters (txFilt and rxFilt). Each filter has a square-root raised cosine frequency response, implemented with an FIR structure.

The transmit and receive filters incorporate upsampling and downsampling, respectively, and both use an efficien polyphase scheme (see Part II script for more information). These multirate filters retain state from one transmiss block to the next, like the channel object (see "Simulation 1: Frequency-flat fading channel" below). The peak value of the impulse response of the filter cascade is 1. The transmit filter uses a scale factor to ensure transmitted power. To construct the pulse filter structures, this script uses an auxiliary function adapteq_buildfilter.m. An improved approach would be to use multirate filter objects from the Filter Design Toolbox.
% Filter parameters nSymFilt = 8; % Number of symbol periods spanned by each filter osfFilt = 4; % Oversampling factor for filter (samples per symbol) rolloff = 0.25; % Rolloff factor Tsamp = Tsym/osfFilt; % TX signal sample period (s) cutoffFreq = 1/(2*Tsym); % Cutoff frequency (half Nyquist bandwidth) orderFilt = nSymFilt*osfFilt; % Filter order (number of taps - 1) % Filter responses and structures sqrtrcCoeff = firrcos(orderFilt, cutoffFreq, rolloff, 1/Tsamp, ... 'rolloff', 'sqrt'); txFilt = adapteq_buildfilter(osfFilt*sqrtrcCoeff, osfFilt, 1); rxFilt = adapteq_buildfilter(sqrtrcCoeff, 1, osfFilt);

Additive White Gaussian Noise


Set signal-to-noise ratio parameter for additive white Gaussian noise.
EsNodB = 20; % Ratio of symbol energy to noise power spectral density (dB) snrdB = EsNodB - 10*log10(osfFilt); % Signal-to-noise ratio per sample (dB)

Simulation 1: Frequency-Flat Fading Channel

Begin with single-path, frequency-flat fading. For this channel, the receiver uses a simple 1-tap LMS (least mean equalizer, which implements automatic gain and phase control.

The Part II script (adapteqpt2.m) runs multiple times. Each run corresponds to a transmission block. The equalize its state and weight every transmission block. (To retain state from one block to the next, you can set the

ResetBeforeFiltering property of the equalizer object to 0.)

Before the first run, the Part II script displays the initial properties of the channel and equalizer objects. For each MATLAB figure shows signal processing visualizations. The red circles in the signal constellation plots correspo symbol errors. In the "Weights" plot, blue and magenta lines correspond to real and imaginary parts, respectively HTML version of this demo shows the last state of the visualizations.)
simName = 'Frequency-flat fading'; % Used to label figure window.

% Multipath channel fd = 30; % Maximum Doppler shift (Hz) chan = rayleighchan(Tsamp, fd); % Create channel object. chan.ResetBeforeFiltering = 0; % Allow state retention across blocks. % Adaptive equalizer nWeights = 1; % Single weight stepSize = 0.1; % Step size for LMS algorithm alg = lms(stepSize); % Adaptive algorithm object eqObj = lineareq(nWeights, alg, pskmodObj.Constellation); t

% Equalizer objec

% Link simulation nBlocks = 50; % Number of transmission blocks in simulation for block = 1:nBlocks, adapteqpt2; end % Run Part II script in loop. chan = ChannelType: InputSamplePeriod: DopplerSpectrum: MaxDopplerShift: PathDelays: AvgPathGaindB: NormalizePathGains: StoreHistory: StorePathGains: PathGains: ChannelFilterDelay: ResetBeforeFiltering: NumSamplesProcessed: eqObj = EqType: AlgType: nWeights: nSampPerSym: RefTap: SigConst: StepSize: LeakageFactor: Weights: WeightInputs: ResetBeforeFiltering: NumSamplesProcessed: 'Linear Equalizer' 'LMS' 1 1 1 [1x4 double] 0.1000 1 0 0 1 0 'Rayleigh' 2.5000e-007 [1x1 doppler.jakes] 30 0 0 1 0 0 1.3607 + 0.9826i 0 0 0

Simulation 2: Frequency-Selective Fading Channel and Linear Equalizer

Simulate a three-path fading channel (frequency-selective fading). The receiver uses an 8-tap linear RLS (recursi squares) equalizer with symbol-spaced taps. The simulation uses the channel object from Simulation 1, but with modified properties.
simName = 'Linear equalization of frequency-selective fading channel'; % Multipath channel chan.PathDelays = [0 0.9 1.5]*Tsym; % Path delay vector (s) chan.AvgPathGaindB = [0 -3 -6]; % Average path gain vector (dB) % Adaptive equalizer nWeights = 8; forgetFactor = 0.99; % RLS algorithm forgetting factor alg = rls(forgetFactor); % RLS algorithm object eqObj = lineareq(nWeights, alg, pskmodObj.Constellation); t eqObj.RefTap = 3; % Reference tap

% Equalizer objec

% Link simulation. Store BER values. for block = 1:nBlocks, adapteqpt2; BERvect(block)=BER; end avgBER2 = mean(BERvect) % Average BER over transmission blocks chan = ChannelType: InputSamplePeriod: DopplerSpectrum: MaxDopplerShift: PathDelays: AvgPathGaindB: NormalizePathGains: StoreHistory: StorePathGains: PathGains: ChannelFilterDelay: 'Rayleigh' 2.5000e-007 [1x1 doppler.jakes] 30 [0 9.0000e-007 1.5000e-006] [0 -3 -6] 1 0 0 [1x3 double] 4

ResetBeforeFiltering: 0 NumSamplesProcessed: 0 eqObj = EqType: AlgType: nWeights: nSampPerSym: RefTap: SigConst: ForgetFactor: InvCorrInit: InvCorrMatrix: Weights: WeightInputs: ResetBeforeFiltering: NumSamplesProcessed: avgBER2 = 1.0000e-004 'Linear Equalizer' 'RLS' 8 1 3 [1x4 double] 0.9900 0.1000 [8x8 double] [0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0] 1 0

Simulation 3: Decision Feedback Equalizer (DFE)

The receiver uses a DFE with a six-tap fractionally spaced forward filter (two samples per symbol) and two feedb weights. The DFE uses the same RLS algorithm as in Simulation 2. The receive filter structure is reconstructed t account for the increased number of samples per symbol. This simulation uses the same channel object as in Sim 2.
simName = 'Decision feedback equalizer (DFE)'; % Receive filter nSamp = 2; % Two samples per symbol at equalizer input

rxFilt = adapteq_buildfilter(sqrtrcCoeff, 1, osfFilt/nSamp); % Adaptive equalizer nFwdWeights = 6; % Number of feedforward equalizer weights nFbkWeights = 2; % Number of feedback filter weights eqObj = dfe(nFwdWeights, nFbkWeights, alg, pskmodObj.Constellation, nSamp); eqObj.RefTap = 3; % Reference tap for block = 1:nBlocks, adapteqpt2; BERvect(block)=BER; end avgBER3 = mean(BERvect) block = 1; chan = % Reset variable (in case Part II is run independently). 'Rayleigh' 2.5000e-007 [1x1 doppler.jakes] 30 [0 9.0000e-007 1.5000e-006] [0 -3 -6] 1 0 0 [1x3 double] 4 0 105450

ChannelType: InputSamplePeriod: DopplerSpectrum: MaxDopplerShift: PathDelays: AvgPathGaindB: NormalizePathGains: StoreHistory: StorePathGains: PathGains: ChannelFilterDelay: ResetBeforeFiltering: NumSamplesProcessed: eqObj = EqType: AlgType: nWeights: nSampPerSym: RefTap: SigConst: ForgetFactor: InvCorrInit: InvCorrMatrix: Weights: WeightInputs: ResetBeforeFiltering: NumSamplesProcessed: avgBER3 = 0.0010

'Decision Feedback Equalizer' 'RLS' [6 2] 2 3 [1x4 double] 0.9900 0.1000 [8x8 double] [0 0 0 0 0 0 0 0] [0 0 0 0 0 0 0 0] 1 0

1994-2011 The MathWorks, Inc. US/Canada Australia Belgium China Denmark Finland France Germany India Ireland Italy Japan Korea Luxembourg Netherlands Norway Portugal Spain Sweden Switzerland United Kingdom All Other Countries

- Site Help - Patents - Trademarks - Privacy Policy - Pr

Vous aimerez peut-être aussi