Advertisement

EC 3501 WIRELESS COMMUNICATION LAB MANUAL - New regulation anna university - r2021 and r 2023


Ec 3501 WIRELESS COMMUNICATION

LABORATORY

 

III YEAR- V SEM

 

2023-2024 (ODD SEMESTER)

 

          

1

 

          

2

 

DEPARTMENT OF ECE

 

PROGRAM EDUCATIONAL OBJECTIVES (PEOs)

PEO1: To excel in professional career and higher education by acquiring knowledge in the              area of Electronics and Communication Engineering.

PEO2: To analyze and design appropriate Electronics and Communication systems to provide          solutions that are technically advanced, economically feasible and socially acceptable.

PEO3: To produce Electronics and Communication Engineering graduates with sufficient  breadth in electronics and its related fields enabling to work in multidisciplinary 

      environments.

PEO4: To produce graduates with a professional outlook who can communicate effectively and  interact responsibly in their profession.

PEO5: To pursue lifelong learning by adapting present and future trends to render service to        the nation.

PROGRAM OUTCOMES (POs)

On completion of the B.E (ECE) degree the Electronics and Communication graduates will be able to

PO1: Apply knowledge of mathematics, science and Electronics & Communication Engineering fundamentals on the solutions of complex engineering problems. (Engineering knowledge skill)

PO2: Identify, formulate and analyze complex Electronics and Communication Engineering problems. (Problem analysis skill)

PO3: Design solutions for complex problems and design systems or processes for a specific need with real time constraints. (Design/ Development of solutions)

PO4: Conduct experiments as well as design, analysis and acquire results for complex Electronics and Communication problems. (Conduct investigations of complex problems)

PO5: Select and apply proper techniques and modern engineering tools which are relevant to Electronics and Communication Engineering applications. (Modern tool usage)

PO6: Apply reasoning informed by the contextual knowledge to assess societal, health, safety, legal and cultural issues and consequent responsibilities relevant to the professional engineering practice. (The engineer and society)

PO7: Examine the impact of engineering solutions in social and environmental context and apply knowledge for continuous development. (Creative skill and sustainability)

PO8: Develop consciousness of professional and ethical responsibilities in the field of Electronics and Communication Engineering. (Professional Integrity/Ethics)

PO9: Apply skill to function as an individual and as a member or a leader in a multidisciplinary team. (Individual and team work)

3

 


 

PO10: Communicate effectively on complex Electronics and Communication Engineering activities with the engineering community and with society at large, such as, being able to comprehend and write effective reports and design documentation, make effective presentations.

(Communication skill)

PO11: Manage Projects and finance in multidisciplinary environment as a member or leader in a team using engineering and management principles. (Project finance management skill)

PO12: Recognize the need to engage in lifelong learning. (Life-long learning skill)

  

PROGRAM SPECIFIC OUTCOMES (PSOs)

 

PSO1: An ability to apply creativity in design and development of electronic circuits, equipment, components and systems. (Hardware designing skill)

PSO2: An ability to apply contextual knowledge of microprocessor, micro controller, DSP processor and software tools in embedded systems. (Software and Hardware Interface)

PSO3: An ability to comprehend the knowledge of wired, wireless communication networks in  telecommunication industries. (Communication Systems)

4

 

 

 

EC3501                                      WIRELESS COMMUNICATION  L T P C 3 0 2 4

 

COURSE OBJECTIVES:

 

●  To study and understand the concepts and design of a Cellular System.

●  To Study And Understand Mobile Radio Propagation And Various Digital Modulation Techniques.

●  To Understand The Concepts Of Multiple Access Techniques And Wireless Networks

 

UNIT-I THE CELLULAR CONCEPT-SYSTEM DESIGN FUNDAMENTALS                                                                                                                                                                                                                                                                                            9

Introduction-FrequencyReuse-Channel Assignment Strategies-Handoff Strategies:Prioritizing Handoffs, Practical Handoff Considerations. Interference And System Capacity: Co-Channel Interference And System Capacity-Channel Planning For Wireless Systems, Adjacent Channel Interference, Power Control For Reducing Interference, Trunking And Grade Of Service. Improving Coverage And Capacity In Cellular Systems: Cell Splitting, Sectoring.

 

UNIT-II MOBILE RADIO PROPAGATION                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                9

Large Scale Path Loss: Introduction To Radio Wave Propagation - Free Space Propagation Model – Three Basic Propagation Mechanism: Reflection – Brewster Angle- DiffractionScattering.Small Scale Fading And Multipath: Small Scale Multipath Propagation, Factors Influencing Small-Scale Fading, Doppler Shift, Coherence Bandwidth, Doppler Spread And Coherence Time. Types Of Small- Scale Fading: Fading Effects Due To Multipath Time Delay Spread, Fading Effects Due To Doppler Spread.

 

UNIT- III MODULATION TECHNIQUES AND EQUALIZATION AND DIVERSITY                                                                                                                                                                                                                                   9

Digital Modulation – An Overview: Factors That Influence The Choice Of Digital Modulation,Linear Modulation

Techniques: Minimum Shift Keying (MSK), Gaussian Minimum ShiftKeying(GMSK), Spread Spectrum Modulation

Techniques: Pseudo- Noise (PN) Sequences,Direct Sequence Spread Spectrum (DS-SS)- Modulation Performance In Fading And MultipathChannels- Equalization, Diversity And Channel Coding: Introduction-Fundamentals Of Equalization- Diversity Techniques: Practical Space Diversity Considerations, Polarization Diversity, Frequency Diversity, Time Diversity.

 

UNIT- IV MULTIPLE ACCESS TECHNIQUES                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                9

Introduction: Introduction To Multiple Access- Frequency Division Multiple Access(FDMA)- TimeDivision Multiple Access(TDMA)- Spread Spectrum Multiple Access-Code Division MultipleAccess(CDMA)- Space Division Multiple Access(SDMA)- Capacity Of Cellular Systems: Capacity Of Cellular CDMA, Capacity Of CDMA With Multiple Cells.

 

UNIT- V WIRELESS NETWORKING                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        9

Introduction: Difference Between Wireless And Fixed Telephone Networks, The Public Switched Telephone Network(PSTN), Development Of Wireless Networks: First Generation Wireless Networks, Second Generation Wireless Networks, Third Generation Wireless Networks, Fixed Network Transmission Hierarchy, TrafficRoutingInWireless

Networks: Circuit Switching, Packet Switching- Personal Communication Services/ Networks(PCS/PCNs):Packet Vs Circuit Switching For PCN, Cellular Packet- Switched Architecture- Packet Reservation Multiple Access(PRMA)- Network Databases: Distributed Database For Mobility Management- Universal Mobile Telecommunication Systems(UMTS).

 

 45 PERIODS

 

PRACTICAL EXERCISES: 30 PERIODS

 

1.  Modeling of wireless communication systems using Matlab(Two ray channel and  Okumura –Hata model)

2.  Modeling and simulation of Multipath fading channel

3.  Design, analyze and test Wireless standards and evaluate the performance measurements  such as BER, PER, BLER, throughput, capacity, ACLR, EVM for 4G and 5G using Matlab

4.  Modulation: Spread Spectrum – DSSS Modulation & Demodulation 5

5.  Wireless Channel equalization: Zero-Forcing Equalizer (ZFE),MMSE

Equalizer(MMSEE),Adaptive Equalizer (ADE),Decision Feedback Equalizer (DFE)

6.  Modeling and simulation of TDMA, FDMA and CDMA for wireless communication

 

 TOTAL:75 PERIODS

 

COURSE OUTCOMES :

Upon successful completion of the course the student will be able to:

CO1:Understand The Concept And Design Of A Cellular System.

CO2:Understand Mobile Radio Propagation And Various Digital Modulation Techniques.

CO3:Understand The Concepts Of Multiple Access Techniques And Wireless Networks CO4:Characterize a wireless channel and evolve the system design specifications CO5:Design a cellular system based on resource availability and traffic demands.

 

TEXT BOOK :

1. Rappaport,T.S.,-Wireless communications”, Pearson Education, Second Edition, 2010.

 

REFERENCES :

 

1. Wireless Communication –Andrea Goldsmith, Cambridge University Press, 2011 2. Van Nee, R. and Ramji Prasad,

―OFDM for wireless multimedia communications, Artech House, 2000 3. David Tse and Pramod Viswanath, ―Fundamentals of Wireless Communication, Cambridge University Press, 2005.

4. Upena Dalal, ―Wireless Communication”, Oxford University Press, 2009. 5. Andreas.F. Molisch, ―Wireless Communications”, John Wiley – India, 2006. 6. Wireless Communication and Networks –William Stallings ,Pearson Education, Second Edition 2002

6


 

COURSE OUTCOMES:

On Completion of the course students will be able to

 

Course Outcome

Statement

CO1

Understand The Concept And Design Of A Cellular System

CO2

Understand Mobile Radio Propagation And Various Digital Modulation Techniques.

CO3

Understand The Concepts Of Multiple Access Techniques And Wireless Networks

CO4

Characterize a wireless channel and evolve the system design specifications

CO5

Design a cellular system based on resource availability and traffic demands.

 

             

 

 

 

TABLE OF CONTENTS

 

S.NO

DATE

NAME OF THE EXPERIMENT

Signature

   1.

 

Modeling of wireless communication systems using Matlab(Two ray channel and  Okumura –Hata model)

 

   2.

 

Modeling and simulation of Multipath fading channel

 

  3.

 

Design, analyze and test Wireless standards and evaluate the performance measurements  such as BER, PER, BLER, throughput, capacity, ACLR, EVM for 4G and 5G using Matlab

 

  4.

 

Modulation: Spread Spectrum – DSSS Modulation & Demodulation

 

  5.

 

Wireless Channel equalization: Zero-Forcing Equalizer (ZFE),MMSE

 

  6.

 

Equalizer(MMSEE),Adaptive Equalizer (ADE),Decision Feedback Equalizer (DFE)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

             

             


Expt. No: 1

Modeling of wireless communication systems using Matlab

(Two ray channel and  Okumura –Hata model)

 

AIM:

To generate basic modeling of wireless communication systems using MATLAB.

 

SOFTWARE REQUIRED:

 

System with MATLAB 9.0

PROGRAM FOR TWO RAY CHANNEL

 

lambda = 0.3;  ht100=100; ht30=30; ht2=2; hr=2;

 

axis=[]; p100=[]; p30=[]; p2=[]; pfsl=[];

 

 

for i=1000:5000  d=10^(i/1000);  axis =[axis d]; 

 fspower  = (lambda/(4*3.1415*d))^2 ;  power100 = fspower * 4 *(sin(2*3.1415*hr*ht100/(lambda*d)))^2;  power30  = fspower* 4 *(sin(2*3.1415*hr*ht30/(lambda*d)))^2;  power2   = fspower * 4 *(sin(2*3.1415*hr*ht2/(lambda*d)))^2;

 

 p100 =[p100, 10*log10(power100)];  p30 =[p30, 10*log10(power30)];  p2 =[p2, 10*log10(power2)];  pfsl=[pfsl, 10*log10(fspower)]; end

 

text('FontSize',18)

 

semilogx(axis,p100, 'g-',axis,p30, 'b-',axis,p2, 'r-',axis,pfsl,'y-')

 

 

xlabel('distance in m'); ylabel('pathloss'); text(1000,-66,'blue  : hr=30m'); text(1000,-74,'red   : hr=2m'); text(1000,-58,'red   : hr=100m');

text(1000,-50,'yellow: free space');

 

text(50,-180,'lambda = 0.30 m'); text(50,-190,'hr = 2 m');

 

 

 

 

 

PROGRAM FOR OKUMURA – HATA MODEL clc; clear all;

close all;

fc=1500;% frequency of transmission in MHz fc2=150;

hb= 70;% effective height of transmitting base station antenna in meters hm=1.5;% effective receiving mobile device antenna height in meters hm1=(1.1*log10(fc)-0.7)*hm-(1.56*log10(fc)-0.8);%Open hm2=8.29*(log10(1.54*hm))^2-1.1;%Metropolitan fc<200 hm3=3.2*(log10(11.75*hm))^2-4.92;%Metropolitan fc>200

C=-2*(log10(fc/28))^2-5.4;

C2=-4.78*(log10(fc))^2+18.33*log10(fc)-40.98;

C3=0;

d = (1:50:100);

A=69.55+26.16*log10(fc)-13.82*log10(hb)-hm1;%Open 

A2=69.55+26.16*log10(fc2)-13.82*log10(hb)-hm2;%Metropolitan fc<=200

A3=69.55+26.16*log10(fc)-13.82*log10(hb)-hm3;%Metropolitan fc>=200

B=44.9-6.55*log10(hb);

Plopen=A+B*log10(d)+C %Suburban

Plsub=A+B*log10(d)+C2 %Open

%Plmp1=A2+B*log10(d)+C3 %Metropolitan fc<=200

Plmp2=A3+B*log10(d)+C3 %Metropolitan fc>=200 plot(d,Plopen,d,Plsub,d,Plmp2,'linewidth',2.5); legend('Suburban','Open','Metropolitan') title('Path-Loss for diffrent Envirnment ') xlabel('Distance') ylabel('Path-Loss in dB') grid on

 

 

Path-Loss for diffrent Envirnment

 

 

 

 

 

 

 

 

 

RESULT:

Thus the modeling of wireless communication systems are generated using MATLAB.

 

 

Expt. No: 2

Modeling and simulation of Multipath fading channel AIM:

To generate Modeling and simulation of Multipath fading channel using MATLAB.

 

SOFTWARE REQUIRED:

 

System with MATLAB 9.0

 

PROGRAM FOR FREQUENCY SELECTIVE FADING CHANNEL FROM POWER DELAY

PROFILE

clc; close all; clear all;

% Frequency selective fading channel from power delay profile

              

 t=[0,0.2,0.5,1.6,2.3,5] ;

 pdp=[0.189,0.379,0.293,0.095,0.061,0.037]; LP = length(pdp); % number of taps paths_r = sqrt(pdp/2).*sqrt((randn(1,LP)).^2 + (randn(1,LP)).^2); %these are paths_random tap_coeff=zeros(1,51); tap_coeff(ceil(t./0.1)+1)=paths_r; %filling in the non-zero values in the channel response totP=sum(abs(tap_coeff).^2); % summation of total power coefficients h=tap_coeff/sqrt(totP);  % normalization of power h;

 stem(h); xlabel('Time delay');  ylabel('Power '); title('Frequency selective fading channel'); legend('Frequency selective fading channel');

 

 

 

 

 

 

 

 

 

 

 

 

PROGRAM FOR FLAT FADING CHANNEL  clc; close all; clear all;

 

% Flat fading channel h=alpha*exp(j*theta)         N=10;         p=2*pi*rand(1,N);         pf=p./sqrt(var(p));         y1=randn(1,N);         y2=randn(1,N);         y1=y1/sqrt(var(y1));         y2=y2/sqrt(var(y2));         alpha=sqrt(y1.^2+y2.^2);         alpha1=mean(alpha.^2);       h=alpha1.*complex(cos(pf),sin(pf));     stem(abs(h));     xlabel('Samples');     ylabel('Magnitude ');     title('Flat Frequency fading channel');     legend('Flat fading');

 

 

 

 

 

RESULT:

Thus the Modeling and simulation of Multipath fading channel are generated using MATLAB.

 

 

Expt. No: 3

Design, analyze and test Wireless standards and evaluate the performance measurements  such as BER, PER, BLER, throughput, capacity, ACLR, EVM for 4G and 5G using Matlab.

 

AIM:

To design, analyze and test Wireless standards and evaluate the performance measurements  such as BER, PER, BLER, throughput, capacity, ACLR, EVM for 4G and 5G using Matlab.

 

SOFTWARE REQUIRED:

 

System with MATLAB 9.0

 

PROGRAM FOR

 

BER

coderate = 1/4; % Code rate

% Create a structure, dspec, with information about the distance spectrum. Define the energy per bit to noise power spectral density ratio (Eb/N0) sweep range and generate the theoretical bound results.

dspec.dfree = 10; % Minimum free distance of code dspec.weight = [1 0 4 0 12 0 32 0 80 0 192 0 448 0 1024 ...

    0 2304 0 5120 0]; % Distance spectrum of code EbNo = 3:0.5:8;

berbound = bercoding(EbNo,'conv','soft',coderate,dspec);

 

%Plot the theoretical bound results.

semilogy(EbNo,berbound) xlabel('E_b/N_0 (dB)');  ylabel('Upper Bound on BER');

title('Theoretical Bound on BER for Convolutional Coding'); grid on; 

RESULT

 

 

 

BLER

% Set up DL-SCH coding parameters

TBS = 3816;            % Transport block size, a positive integer codeRate = 308/1024;   % Target code rate, a real number between 0 and 1 rv = 0;                % Redundancy version, 0-3

modulation = 'QPSK';   % Modulation scheme, QPSK, 16QAM, 64QAM, 256QAM nlayers = 1;           % Number of layers, 1-4 for a transport block cbsInfo = nrDLSCHInfo(TBS,codeRate); disp('DL-SCH coding parameters') disp(cbsInfo)

 switch modulation     case 'QPSK'         bitsPerSymbol = 2;     case '16QAM'         bitsPerSymbol = 4;     case '64QAM'         bitsPerSymbol = 6;     case '256QAM'         bitsPerSymbol = 8; end

 

% Set up AWGN channel EbNo = 1.25; % in dB outlen = ceil(TBS/codeRate); snrdB = convertSNR(EbNo,"ebno",...

    BitsPerSymbol=bitsPerSymbol,CodingRate=TBS/outlen);

 

% Random transport block data generation in = randi([0 1],TBS,1,'int8'); % Transport block CRC attachment tbIn = nrCRCEncode(in,cbsInfo.CRC); % Code block segmentation and CRC attachment cbsIn = nrCodeBlockSegmentLDPC(tbIn,cbsInfo.BGN);

% LDPC encoding

enc = nrLDPCEncode(cbsIn,cbsInfo.BGN); % Rate matching and code block concatenation

chIn = nrRateMatchLDPC(enc,outlen,rv,modulation,nlayers);

% Symbol mapping

symOut = nrSymbolModulate(chIn,modulation);

% AWGN channel

[rxSig, noiseVar] = awgn(symOut,snrdB);

% Symbol demapping

rxllr = nrSymbolDemodulate(rxSig,modulation,noiseVar);

% Rate recovery

raterec = nrRateRecoverLDPC(rxllr,TBS,codeRate,rv,modulation,nlayers); % LDPC decoding, with early termination and at most 12 iterations decBits = nrLDPCDecode(raterec,cbsInfo.BGN,12);

% Code block desegmentation and CRC decoding

[blk,~] = nrCodeBlockDesegmentLDPC(decBits,cbsInfo.BGN,TBS+cbsInfo.L);

% Transport block CRC decoding

[out,~] = nrCRCDecode(blk,cbsInfo.CRC);

% Compare blockError = any(out~=in)

 EVM FOR 4G AND 5G

% Select one of the Release 15 NR-TMs for FR1 and FR2 among:

% "NR-FR1-TM1.1","NR-FR1-TM1.2","NR-FR1-TM2",

% "NR-FR1-TM2a","NR-FR1-TM3.1","NR-FR1-TM3.1a",

% "NR-FR1-TM3.2","NR-FR1-TM3.3","NR-FR2-TM1.1",

% "NR-FR2-TM2","NR-FR2-TM2a","NR-FR2-TM3.1","NR-FR2-TM3.1a"

 

% or

% Select one of the Release 15 FRCs for FR1 and FR2 among:

% "DL-FRC-FR1-QPSK","DL-FRC-FR1-64QAM",

% "DL-FRC-FR1-256QAM","DL-FRC-FR2-QPSK",

% "DL-FRC-FR2-16QAM","DL-FRC-FR2-64QAM"

 

rc = "NR-FR1-TM3.2"; % Reference channel (NR-TM or FRC)

 

% Select the NR waveform parameters bw = "10MHz"; % Channel bandwidth scs = "30kHz"; % Subcarrier spacing dm = "FDD"; % Duplexing mode targetRNTIs = []; displayEVM = true; plotEVM = true; if displayEVM

    fprintf('Reference Channel = %s\n', rc); end

evm3GPP = false; phaseNoiseOn = true; IQImbalanceON = true; filterOn = true; nonLinearityModelOn = true; OSR = 5; % oversampling factor

 

% Create waveform generator object

tmwavegen = hNRReferenceWaveformGenerator(rc,bw,scs,dm);

 

% Waveform bandwidth

bandwidth = tmwavegen.Config.ChannelBandwidth*1e6;

 

if OSR > 1

    % The |Config| property in |tmwavegen| specifies the configuration of

    % the standard-defined reference waveform. It is a read-only property.

    % To customize the waveform, make the |Config| property writable.     tmwavegen = makeConfigWritable(tmwavegen);

 

    % Increase the waveform sample rate by multiplying the nominal sample

    % rate with |OSR|

    nominalSampleRate = getNominalSampleRate(tmwavegen.Config);     tmwavegen.Config.SampleRate = nominalSampleRate*OSR; else

    filterOn = false; end

 

% Generate the waveform and get the waveform sample rate

[txWaveform,tmwaveinfo,resourcesinfo] =

generateWaveform(tmwavegen,tmwavegen.Config.NumSubframes); sr = tmwaveinfo.Info.SamplingRate; % waveform sample rate txWaveform = txWaveform/max(abs(txWaveform),[],'all'); txWaveform = repmat(txWaveform,2,1); if phaseNoiseOn     % Carrier frequency

    if tmwavegen.Config.FrequencyRange == "FR1" % carrier frequency for FR1

        fc = 4e9;

    else % carrier frequency for FR2         fc = 30e9;     end

 

    % Calculate the phase noise level

    foffsetLog = (4:0.2:log10(sr/2)-0.001); % model offset from 10e3Hz to                                             % almost sr/2. To avoid

                                            % aliasing, the sample rate

                                            % must be greater than twice

                                            % the largest value specified                                             % by FrequencyOffset     foffset = 10.^foffsetLog;    % linear frequency offset     PN_dBc_Hz = hPhaseNoisePoleZeroModel(foffset,fc,'C');     figure; semilogx(foffset,PN_dBc_Hz);     xlabel('Frequency offset (Hz)');     ylabel('dBc/Hz');

    title('Phase noise model'); grid on

 

    % Apply phase noise to the waveform

    pnoise = comm.PhaseNoise('FrequencyOffset',foffset,'Level',PN_dBc_Hz,'SampleRate',sr);     pnoise.RandomStream = "mt19937ar with seed";     rxWaveform = pnoise(txWaveform);     release(pnoise);

else

    rxWaveform = txWaveform; %#ok<UNRCH> end

 

RESULT

 

 

 

 

 

 

 

 

 

 

 

 

RESULT:

Thus the design, analyze and test Wireless standards and evaluate the performance measurements  such as BER, PER, BLER, throughput, capacity, ACLR, EVM for 4G and 5G was generated successfully using Matlab.

 

 

Expt. No: 4

Modulation: Spread Spectrum – DSSS Modulation &amp; Demodulation AIM:

To simulate Spread Spectrum – DSSS Modulation &amp; Demodulation using MATLAB.

 

SOFTWARE REQUIRED:

 

System with MATLAB 9.0

PROGRAM FOR  MODULATION: SPREAD SPECTRUM – DSSS MODULATION &AMP;

DEMODULATION

 

% Direct Sequence Spread Spectrum

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clc clear

% Generating the bit pattern with each bit 20 samples long b=round(rand(1,30));

pattern=[]; for k=1:30     if b(1,k)==0         sig=-ones(1,20);     else

        sig=ones(1,20);     end

    

    pattern=[pattern sig];

end subplot(4,1,1) plot(pattern); axis([-1 620 -1.5 1.5]); title('Original Bit Sequence');

% Generating the pseudo random bit pattern for spreading d=round(rand(1,120)); pn_seq=[]; carrier=[];

t=[0:2*pi/4:2*pi];     % Creating 5 samples for one cosine  for k=1:120     if d(1,k)==0         sig=-ones(1,5);     else

        sig=ones(1,5);     end     c=cos(t);        carrier=[carrier c];

    pn_seq=[pn_seq sig];

   

end

% Spreading of sequence spreaded_sig=pattern.*pn_seq;

subplot(4,1,2) plot(spreaded_sig) axis([-1 620 -1.5 1.5]);

title('Spreaded signal');

% BPSK Modulation of the spreaded signal bpsk_sig=spreaded_sig.*carrier;   % Modulating the signal

subplot(4,1,3); plot(bpsk_sig) axis([-1 620 -1.5 1.5]); title('BPSK Modulated Signal'); %Plotting the FFT of DSSS signal y=abs(fft(xcorr(bpsk_sig))); subplot(4,1,4) plot(y/max(y)) xlabel('Frequency') ylabel('PSD')

%Demodulation and Despreading of Received Signal

figure rxsig=bpsk_sig.*carrier; demod_sig=[]; for i=1:600     if rxsig(i)>=0     rxs =1; else     rxs =-1;

    end     demod_sig=[demod_sig rxs]; end subplot(3,1,1) plot(demod_sig) axis([-1 620 -1.5 1.5]); title('Demodulated Signal') despread_sig=demod_sig.*pn_seq;

subplot(3,1,2) plot(despread_sig) axis([-1 620 -1.5 1.5]); title('Despreaded data')

%Power Spectrum of Despreaded data  z=0.5+0.5*despread_sig; y=abs(fft(xcorr(z))); subplot(3,1,3) plot(y/max(y)) axis([0 500 0 1.5]) xlabel('Frequency') ylabel('PSD')

 

 

 

 

 

 

 

 

 

 

 

Demodulated Signal

Frequency

 

 

 

 

 

 

RESULT:

Thus the simulation of  Spread Spectrum – DSSS Modulation &amp; Demodulation was generated using

MATLAB.

Expt. No: 5

Wireless Channel equalization: Zero-Forcing Equalizer (ZFE), MMSE AIM:

To Model and simulate the Wireless Channel Equalization: Zero-Forcing Equalizer (ZFE), MMSE using

MATLAB.

 

SOFTWARE REQUIRED:

 

System with MATLAB 9.0

PROGRAM FOR ZERO FORCING clc; close all; clear all;

 

N=10;

        p=2*pi*rand(1,N);         pf=p./sqrt(var(p));         y1=randn(1,N);         y2=randn(1,N);         y1=y1/sqrt(var(y1));         y2=y2/sqrt(var(y2));         alpha=sqrt(y1.^2+y2.^2);         alpha1=mean(alpha.^2);       h=alpha1.*complex(cos(pf),sin(pf));     stem(abs(h));

    % zero forcing equalizer     equalizer= conj(h);

    

    equalizedh = h.* equalizer;     stem(abs((equalizer)));

 

 

 

 

 

 

 

 

 

PROGRAM ON ESTIMATION AND MMSE EQUALIZATION FOR OFDM SYSTEM

 

clc close all clear all

H = comm.QPSKModulator('BitInput',true);

Hdemod = comm.QPSKDemodulator('BitOutput',true);

% hScope = commscope.ScatterPlot;

% hScope.Constellation = [0.7071+0.7071i -0.7071+0.7071i -0.7071-0.7071i 0.7071-0.7071i];

% hScope.SamplesPerSymbol = 1; n=16;    %no of random data... r_data = randint(n,1); %random numbers generator...

data_qpsk=[]; data_qpsk = step(H,r_data); %Data converted in QPSK symbols... d1=data_qpsk(1); d5=data_qpsk(5); data_qpsk(1) = 0.7071+0.7071i; % adding two pilots at location 1 and 5. data_qpsk(5) = 0.7071+0.7071i; % update(hScope, data_qpsk);

dawgn=awgn(data_qpsk,0); % Adding white Gaussian Noise est(1)=dawgn(1); est(2)=dawgn(5); % MMSE starts here...... des=[0.7071+0.7071i 0.7071+0.7071i];% desired data symbols rec=[est(1) est(2)]; % received data symbols... z=filter([1 0 0 0 0 0 0 0],[1],rec);

Rxx=xcorr(rec); Rxz=xcorr(des,z);

x=toeplitz([Rxx zeros(1,5)],zeros(1,8)) cof=x\([Rxz zeros(1,5)].'); % coefficients for MMSE equalizer... det1=filter(cof,[1],dawgn); det1 for i=1:8

det(i)=filter(cof,[1],dawgn(i));

end

det.'

% update(hScope, det);

 

 

 

 

 

 

RESULT:

Thus the Modeling and simulation of the Wireless Channel Equalization: Zero-Forcing Equalizer (ZFE), MMSE was generated using MATLAB.

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Expt. No: 6

Equalizer(MMSEE),Adaptive Equalizer (ADE),Decision Feedback Equalizer (DFE)

 

AIM:

To Model and simulate the Equalizer(MMSEE),Adaptive Equalizer (ADE),Decision Feedback Equalizer (DFE) using MATLAB.

 

SOFTWARE REQUIRED:

 

System with MATLAB 9.0

 

PROGRAM FOR ADAPTIVE EQUALIZER

%%%%%%%%%%%%adaptive system identification%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%Manolis

Tsakiris%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear all close all

 

%simulation length

N = 1000;

 

%channel to be identified M = 9; wo = randn(M,1);

wo = wo / norm(wo);

 

%excitation signal

u = randn(1,N);

 

%channel output

y = filter(wo,1,u);

 

%additive noise to the channel output

SNR = 30; var_v = var(y) * 10^(-SNR/10);

v = var_v^0.5 * randn(1,N);

 

%desired signal

d = y + v;

 

%NLMS adaptive system identification w = zeros(M,1); u_regressor = zeros(1,M);

step = 0.5; epsilon = 10^(-6); msd = zeros(1,N); for k = 1 : N

u_regressor = [u(k) u_regressor(1:M-1)]; e = d(k) - u_regressor * w;

w = w + step * u_regressor' * e / (u_regressor * u_regressor' + epsilon); msd(k) = (w-wo)' * (w-wo);

end

 

figure;

plot(10*log10(msd));

ylabel('MSD(dB)'); xlabel('iterations');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%

 

And this is a sample code for adaptive channel equalization:

 

%%%%%%%%%adaptive channel equalization%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%Manolis

Tsakiris%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% clear all

close all

 

%simulation length

N = 1000;

 

%channel length

M = 5;

 

%number of independent trials

T = 100;

 

cascade_impulse_response = zeros(1,2*M-1); for j = 1 : T

%training signal u = randn(1,N);

 

%channel to be equalized c = randn(M,1);

c = c / norm(c);

 

%channel output z = filter(c,1,u);

 

%additive noise to the channel output

SNR = 30;

var_v = var(z) * 10^(-SNR/10);

v = var_v^0.5 * randn(1,N);

 

%input to the equalizer

x = z + v;

 

%NLMS channel equalization w = zeros(M,1); x_regressor = zeros(1,M);

step = 0.1; epsilon = 10^(-6); for k = 4 : N

x_regressor = [x(k) x_regressor(1:M-1)]; e = u(k-3) - x_regressor * w;

w = w + step * x_regressor' * e / (x_regressor * x_regressor' + epsilon); end

cascade_impulse_response = cascade_impulse_response + conv(w,c)'; display(j);

end

figure;

stem(cascade_impulse_response/T);

title('cascade channel-equalizer impulse response'); xlabel('taps');

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%

 

 

 

 

 

PROGRAM FOR DECISION FEEDBACK EQUALIZER

 

% decision feedback equalizer

% References: See Section 5.1.8 in the book "Digital Communications and

% Signal Processing" by K Vasudevan

% QPSK modulation

clear all close all clc

training_len = 10^4; %length of the training sequence snr_dB = 10; % snr in dB

ff_filter_len = 30; % feedforward filter length fb_filter_len = 20; % feedback filter length data_len = 10^6; % length of the data sequence

% snr parameters snr = 10^(0.1*snr_dB);

noise_var_1D = 0.5*2*1/(2*snr); % noise variance

% --------------- training phase ------------------------------------------

% source

training_a = randi([0 1],1,2*training_len);

% qpsk mapper

training_seq = 1-2*training_a(1:2:end) + 1i*(1-2*training_a(2:2:end));

% impulse response of the channel

fade_chan = [0.9+0.9i 0.1+0.1i 0.1+0.1i 0.1+0.1i 0.1+0.1i]; 

fade_chan = fade_chan/norm(fade_chan); chan_len = length(fade_chan);

% awgn

noise = normrnd(0,sqrt(noise_var_1D),1,training_len+chan_len-1)+normrnd(0,sqrt(noise_var_1D),1,training_len+chan_len-

1);

% channel output

chan_op = conv(fade_chan,training_seq)+noise;

% ------------ LMS update of taps------------------------------------------ ff_filter = zeros(1,ff_filter_len); % feedforward filter initialization fb_filter = zeros(1,fb_filter_len); % feedback filter initialization ff_filter_ip = zeros(1,ff_filter_len); % feedforward filter input vector fb_filter_ip = zeros(1,fb_filter_len); % feedback filter input vector fb_filter_op = 0; % feedback filter output symbol

% estimating the autocorrelation of received sequence at zero lag

Rvv0 = (chan_op*chan_op')/(training_len+chan_len-1);

% maximum step size

max_step_size = 2/(ff_filter_len*(Rvv0)+fb_filter_len*(2)); step_size = 0.125*max_step_size; % step size for i1=1:training_len-ff_filter_len+1 % steady state part

         ff_filter_ip(2:end)=ff_filter_ip(1:end-1);          ff_filter_ip(1) = chan_op(i1);

         ff_filter_op = ff_filter*ff_filter_ip.'; % feedforward filter output

         

         ff_and_fb = ff_filter_op-fb_filter_op; 

         error = ff_and_fb-training_seq(i1); % instantaneous

         

         % hard decision          temp1 = real(ff_and_fb)<0;          temp2 = imag(ff_and_fb)<0;

         quantizer_op = 1-2*temp1 + 1i*(1-2*temp2);

         

         % LMS update          ff_filter=ff_filter-step_size*error*conj(ff_filter_ip);          fb_filter=fb_filter+step_size*error*conj(fb_filter_ip);

         

         fb_filter_ip(2:end)=fb_filter(1:end-1);          fb_filter_ip(1) = quantizer_op;

         

         fb_filter_op = fb_filter*fb_filter_ip.'; end

%-------    data transmission phase----------------------------

% source

data_a = randi([0 1],1,2*data_len);

% qpsk mapper

data_seq = 1-2*data_a(1:2:end)+1i*(1-2*data_a(2:2:end));

% awgn noise = normrnd(0,sqrt(noise_var_1D),1,data_len+chan_len-1)+...

    1i*normrnd(0,sqrt(noise_var_1D),1,data_len+chan_len-1);

% channel output

chan_op = conv(fade_chan,data_seq)+noise; dec_seq = zeros(1,data_len-ff_filter_len+1);% output from dfe ff_filter_ip = zeros(1,ff_filter_len); % feedforward filter input fb_filter_ip = zeros(1,fb_filter_len); % feedback filter input fb_filter_op = 0; % feedback filter output symbol for i1=1:data_len-ff_filter_len+1 % steady state part          ff_filter_ip(2:end)=ff_filter_ip(1:end-1);          ff_filter_ip(1) = chan_op(i1);          ff_filter_op = ff_filter*ff_filter_ip.';

         

         ff_and_fb = ff_filter_op-fb_filter_op;

        

         % hard decision          temp1 = real(ff_and_fb)<0;          temp2 = imag(ff_and_fb)<0;

         dec_seq(i1) = 1-2*temp1 +1i*(1-2*temp2);

         

         fb_filter_ip(2:end)=fb_filter(1:end-1);          fb_filter_ip(1) = dec_seq(i1);

         

         fb_filter_op = fb_filter*fb_filter_ip.'; % feedback filter output end

% demapping symbols back to bits dec_a = zeros(1,2*(data_len-ff_filter_len+1)); dec_a(1:2:end) = real(dec_seq)<0; dec_a(2:2:end) = imag(dec_seq)<0;

% bit error rate

ber = nnz(dec_a-data_a(1:2*(data_len-ff_filter_len+1)))/(2*(data_len-ff_filter_len+1))

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

RESULT:

Thus the Modeling and simulation of the Equalizer (MMSEE),Adaptive Equalizer (ADE),Decision Feedback Equalizer (DFE)  was generated using MATLAB.



For full manual in pdf click the link

 

Post a Comment

0 Comments