SlideShare a Scribd company logo
1 of 7
Digital Communication Systems

                                              Homework # 6

                                         Muhammad Irfan Anjum



Matlab code is given in the Appendix.

BPSK Modulation      ±1

Sampling frequency fs= 2000 Hz

Sampling interval    T=1/fs

Symbol duration      Ts=20/fs



Problem # 1

       Matlab script to design root raised cosine filter p(kTs) with roll-off factor 0.5 and convolution of
two root raised cosine pulse is shown in fig. 1.

The graphs shown in Fig.1 are obtained using oversampling. It is clear from Fig.1 (b) that convolution of
two root raised cosine pulses is raise cosine pulse.



Problem # 2

       Fig. 2 shows the time and frequency plots of transmitted BPSK symbols before and after passing
through pulse shaping filter shown in Fig.1.



Problem # 3

       Fig. 3 shows the time and frequency plots of transmitted BPSK symbols before and after passing
through filter h(t), where h(t)=c(t)*p(t).
Fig.1
Fig. 2
Fig. 3



Problem # 4

         Fig. 4 shows the BER graphs of BPSK and 4-QAM modulations schemes in case of MLSD. It is
clear from the figure that BPSK performs better than 4-QAM in ISI channel.
Fig. 4



Appendix:

%% HomeWork#6, Digital Communication Systems...
clc
clear
close all
roll_off_factor=0.5;             % Rolloff factor.
fs=2000;                         % Sampling rrequency.
Ts=1/fs;                         % Sampling rate.
T=20/fs;                         % Symbol duration
M=10^5;                          % Number of symbols
interval=-T/2:Ts:T/2;
SNR=0:3:15;
%% Problem #1
Index=1;
for t=interval
    if t==0
         p(Index)=1-roll_off_factor+4*roll_off_factor/pi;
    elseif t== abs(Ts/(4*roll_off_factor))
p(Index)=roll_off_factor/sqrt(2) * ((1+2/pi)*sin(pi/
(4*roll_off_factor)) + (1-2/pi)*cos(pi/(4*roll_off_factor)));
    else
         N= sin(pi*t * (1-roll_off_factor)/Ts) + 4*roll_off_factor*t *
cos(pi*t*(1+roll_off_factor)/Ts)/Ts;
         D= pi*t * (1-(4*roll_off_factor*t/Ts)^2)/Ts;
         p(Index)=N/D;
    end
    Index=Index+1;
end
figure
subplot(211)
plot(interval,p);
xlabel('time-->'); ylabel('Amplitude'); title('Impulse response of Root
raised cosine filter'); grid on
p_kTs=conv(p,p);
hold on
interval=-T:Ts:T;
subplot(212)
plot(interval,p_kTs);
xlabel('time-->'); ylabel('Amplitude'); title('Impulse response of Raised
cosine filter'); grid on
axis ([-5*Ts 5*Ts -2 10])

%% Problem # 2

m=randsrc(M,1,[-1 1;0.5 0.5]); % BPSK Symbols 1,-1
oversampled_data=upsample(m,T/Ts);
figure;
subplot(311);
stem(oversampled_data);
axis ([200 300 -2 2])
xlabel('n'); ylabel('Amplitude'); title('oversampled data');grid on

Tx=conv(oversampled_data,p);
subplot(312)
plot(Tx);
axis ([200 300 -2 2])
xlabel('time'); ylabel('Amplitude'); title('Transmitted data');grid on
subplot(313);
spec_Tx=fft(Tx,length(Tx));
plot(abs(spec_Tx));
xlabel('f'); ylabel('Amplitude'); title('Spectrum of transmitted data');grid
on

%% Problem #3

m=randsrc(M,1,[-1 1;0.5 0.5]); % BPSK Symbols 1,-1
c=upsample([1 0.5 -0.1],T/Ts);
h=conv(c,p);
oversampled_data=upsample(m,T/Ts);
figure;
subplot(311);
stem(oversampled_data);
axis ([200 300 -2 2])
xlabel('n'); ylabel('Amplitude'); title('oversampled data');grid on
Tx=conv(oversampled_data,h);
subplot(312)
plot(Tx);
axis ([200 300 -2 2])
xlabel('time'); ylabel('Amplitude'); title('Transmitted data');grid on
subplot(313);
spec_Tx=fft(Tx,length(Tx));
plot(abs(spec_Tx));
xlabel('f'); ylabel('Amplitude'); title('Spectrum of transmitted data');grid
on

%% Problem #4 BPSK

[x y]=size(Tx);
j=1;
m=(m+1)/2;
for i=SNR
     sgma=sqrt(10^(-i/10));
     noise=random('Normal',0,sgma,x,y);
     Rx=noise+Tx;
     r_k=conv(Rx,fliplr(h));
     r=r_k(80:end-79);
     rx=sign(downsample(r,T/Ts));
     rx=(rx+1)/2;
     [N,ber]=biterr(m,rx);
     e_bpsk(j)=ber;
     j=j+1;
end
% Problem #4 4-QAM
rl=1/sqrt(2)*randsrc(M,1,[-1 1;0.5 0.5]); mg=1/sqrt(2)*randsrc(M,1,[-1 1;0.5
0.5]); % BPSK Symbols 1,-1
m=rl+mg*1j;                              % 4-QAM symbols
oversampled_data=upsample(m,T/Ts);
Tx=conv(oversampled_data,h);
[x y]=size(Tx); j=1;
rl=(sqrt(2)*rl+1)/2; mg=(sqrt(2)*mg+1)/2;
for i=SNR
     sgma=sqrt(10^(-i/10));
     noise=random('Normal',0,sgma,x,y)+random('Normal',0,sgma,x,y)*1j;
     Rx=noise+Tx;
     r_k=conv(Rx,fliplr(h));
     r=r_k(80:end-79);
     rxr=sign(downsample(real(r),T/Ts)); rxm=sign(downsample(imag(r),T/Ts));
     rxr=(rxr+1)/2; rxm=(rxm+1)/2;
     [N,ber1]=biterr(rl,rxr); [N,ber2]=biterr(mg,rxm);
     e_4qam(j)=(ber1+ber2)/2;
     j=j+1;
end
figure;
semilogy(SNR,e_bpsk,'-o');
hold on;
semilogy(SNR,e_4qam,'-*');
legend('BPSK', '4-QAM'); xlabel('SNR in dB'); ylabel('BER');
title('BER comparison of BPSK and 4-QAM in MLSD detector'); grid on

More Related Content

What's hot

Matlab code for comparing two microphone files
Matlab code for comparing two microphone filesMatlab code for comparing two microphone files
Matlab code for comparing two microphone filesMinh Anh Nguyen
 
Tele4653 l5
Tele4653 l5Tele4653 l5
Tele4653 l5Vin Voro
 
Sampling and filtering
Sampling and filteringSampling and filtering
Sampling and filteringgayatrigayu1
 
Exam 6 commlab 18_119_ei0292
Exam 6 commlab 18_119_ei0292Exam 6 commlab 18_119_ei0292
Exam 6 commlab 18_119_ei0292lucky859450
 
The Inner Secrets of Compilers
The Inner Secrets of CompilersThe Inner Secrets of Compilers
The Inner Secrets of CompilersIT MegaMeet
 
Ff tand matlab-wanjun huang
Ff tand matlab-wanjun huangFf tand matlab-wanjun huang
Ff tand matlab-wanjun huangSagar Ahir
 
Chapter 4 review
Chapter 4 reviewChapter 4 review
Chapter 4 reviewgregcross22
 
K10692 control theory
K10692 control theoryK10692 control theory
K10692 control theorysaagar264
 
The method of comparing two audio files
The method of comparing two audio filesThe method of comparing two audio files
The method of comparing two audio filesMinh Anh Nguyen
 
Mpmc unit-string manipulation
Mpmc unit-string manipulationMpmc unit-string manipulation
Mpmc unit-string manipulationxyxz
 
Tele3113 tut2
Tele3113 tut2Tele3113 tut2
Tele3113 tut2Vin Voro
 
Tele3113 tut5
Tele3113 tut5Tele3113 tut5
Tele3113 tut5Vin Voro
 
MATLAB program of expansion and compression of signal
MATLAB program of expansion and compression of signalMATLAB program of expansion and compression of signal
MATLAB program of expansion and compression of signalMarmik Kothari
 
Tele3113 wk6wed
Tele3113 wk6wedTele3113 wk6wed
Tele3113 wk6wedVin Voro
 

What's hot (19)

Matlab code for comparing two microphone files
Matlab code for comparing two microphone filesMatlab code for comparing two microphone files
Matlab code for comparing two microphone files
 
Tele4653 l5
Tele4653 l5Tele4653 l5
Tele4653 l5
 
畳み込みについて
畳み込みについて畳み込みについて
畳み込みについて
 
Sampling and filtering
Sampling and filteringSampling and filtering
Sampling and filtering
 
Dsp final
Dsp finalDsp final
Dsp final
 
Exam 6 commlab 18_119_ei0292
Exam 6 commlab 18_119_ei0292Exam 6 commlab 18_119_ei0292
Exam 6 commlab 18_119_ei0292
 
The Inner Secrets of Compilers
The Inner Secrets of CompilersThe Inner Secrets of Compilers
The Inner Secrets of Compilers
 
Ff tand matlab-wanjun huang
Ff tand matlab-wanjun huangFf tand matlab-wanjun huang
Ff tand matlab-wanjun huang
 
Chapter 4 review
Chapter 4 reviewChapter 4 review
Chapter 4 review
 
K10692 control theory
K10692 control theoryK10692 control theory
K10692 control theory
 
Adaptive
AdaptiveAdaptive
Adaptive
 
The method of comparing two audio files
The method of comparing two audio filesThe method of comparing two audio files
The method of comparing two audio files
 
Matlab Señales Discretas
Matlab Señales DiscretasMatlab Señales Discretas
Matlab Señales Discretas
 
Mpmc unit-string manipulation
Mpmc unit-string manipulationMpmc unit-string manipulation
Mpmc unit-string manipulation
 
Tele3113 tut2
Tele3113 tut2Tele3113 tut2
Tele3113 tut2
 
Tele3113 tut5
Tele3113 tut5Tele3113 tut5
Tele3113 tut5
 
MATLAB program of expansion and compression of signal
MATLAB program of expansion and compression of signalMATLAB program of expansion and compression of signal
MATLAB program of expansion and compression of signal
 
Tele3113 wk6wed
Tele3113 wk6wedTele3113 wk6wed
Tele3113 wk6wed
 
Matlab programs
Matlab programsMatlab programs
Matlab programs
 

Viewers also liked

pulse shaping and equalization
pulse shaping and equalizationpulse shaping and equalization
pulse shaping and equalizationremyard
 
Isi and nyquist criterion
Isi and nyquist criterionIsi and nyquist criterion
Isi and nyquist criterionsrkrishna341
 
Digital data transmission,line coding and pulse shaping
Digital data transmission,line coding and pulse shapingDigital data transmission,line coding and pulse shaping
Digital data transmission,line coding and pulse shapingAayush Kumar
 
Simulation Study of FIR Filter based on MATLAB
Simulation Study of FIR Filter based on MATLABSimulation Study of FIR Filter based on MATLAB
Simulation Study of FIR Filter based on MATLABijsrd.com
 
Gender detection using MATLAB
Gender detection using MATLABGender detection using MATLAB
Gender detection using MATLABTanmay Bakshi
 
Digital communication
Digital communication Digital communication
Digital communication Akshay Joshi
 
Final project report
Final project reportFinal project report
Final project reportssuryawanshi
 
Fourier series example
Fourier series exampleFourier series example
Fourier series exampleAbi finni
 
Introductory Lecture to Audio Signal Processing
Introductory Lecture to Audio Signal ProcessingIntroductory Lecture to Audio Signal Processing
Introductory Lecture to Audio Signal ProcessingAngelo Salatino
 
Matlab: Spectral Analysis, Fourier Analysis, Filterbank Analysis
Matlab: Spectral Analysis, Fourier Analysis, Filterbank AnalysisMatlab: Spectral Analysis, Fourier Analysis, Filterbank Analysis
Matlab: Spectral Analysis, Fourier Analysis, Filterbank AnalysisDataminingTools Inc
 

Viewers also liked (17)

pulse shaping and equalization
pulse shaping and equalizationpulse shaping and equalization
pulse shaping and equalization
 
Isi and nyquist criterion
Isi and nyquist criterionIsi and nyquist criterion
Isi and nyquist criterion
 
Digital data transmission,line coding and pulse shaping
Digital data transmission,line coding and pulse shapingDigital data transmission,line coding and pulse shaping
Digital data transmission,line coding and pulse shaping
 
Matlab: Speech Signal Analysis
Matlab: Speech Signal AnalysisMatlab: Speech Signal Analysis
Matlab: Speech Signal Analysis
 
Simulation Study of FIR Filter based on MATLAB
Simulation Study of FIR Filter based on MATLABSimulation Study of FIR Filter based on MATLAB
Simulation Study of FIR Filter based on MATLAB
 
Designing a uniform filter bank using multirate concept
Designing a uniform filter bank using multirate conceptDesigning a uniform filter bank using multirate concept
Designing a uniform filter bank using multirate concept
 
Digfilt
DigfiltDigfilt
Digfilt
 
FILTER BANKS
FILTER BANKSFILTER BANKS
FILTER BANKS
 
Matlab dsp examples
Matlab dsp examplesMatlab dsp examples
Matlab dsp examples
 
Gender detection using MATLAB
Gender detection using MATLABGender detection using MATLAB
Gender detection using MATLAB
 
Digital communication
Digital communication Digital communication
Digital communication
 
Pulse Shaping FIR Filter for WCDMA
Pulse Shaping FIR Filter for WCDMAPulse Shaping FIR Filter for WCDMA
Pulse Shaping FIR Filter for WCDMA
 
Final project report
Final project reportFinal project report
Final project report
 
DSP MATLAB notes - Akshansh
DSP MATLAB notes - AkshanshDSP MATLAB notes - Akshansh
DSP MATLAB notes - Akshansh
 
Fourier series example
Fourier series exampleFourier series example
Fourier series example
 
Introductory Lecture to Audio Signal Processing
Introductory Lecture to Audio Signal ProcessingIntroductory Lecture to Audio Signal Processing
Introductory Lecture to Audio Signal Processing
 
Matlab: Spectral Analysis, Fourier Analysis, Filterbank Analysis
Matlab: Spectral Analysis, Fourier Analysis, Filterbank AnalysisMatlab: Spectral Analysis, Fourier Analysis, Filterbank Analysis
Matlab: Spectral Analysis, Fourier Analysis, Filterbank Analysis
 

Similar to Digitla Communication pulse shaping filter

Similar to Digitla Communication pulse shaping filter (20)

DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLABDIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
DIGITAL SIGNAL PROCESSING: Sampling and Reconstruction on MATLAB
 
Solvedproblems 120406031331-phpapp01
Solvedproblems 120406031331-phpapp01Solvedproblems 120406031331-phpapp01
Solvedproblems 120406031331-phpapp01
 
Dsp gcu lab11
Dsp gcu lab11Dsp gcu lab11
Dsp gcu lab11
 
Comm lab manual_final-1
Comm lab manual_final-1Comm lab manual_final-1
Comm lab manual_final-1
 
Comm lab manual_final
Comm lab manual_finalComm lab manual_final
Comm lab manual_final
 
Experiment3_DCS-21BEC0384Adityabonnerjee
Experiment3_DCS-21BEC0384AdityabonnerjeeExperiment3_DCS-21BEC0384Adityabonnerjee
Experiment3_DCS-21BEC0384Adityabonnerjee
 
Final ppt
Final pptFinal ppt
Final ppt
 
Frequency modulation
Frequency modulationFrequency modulation
Frequency modulation
 
Fhss project
Fhss projectFhss project
Fhss project
 
Frequency Modulation.ppt
Frequency Modulation.pptFrequency Modulation.ppt
Frequency Modulation.ppt
 
디지털통신 7
디지털통신 7디지털통신 7
디지털통신 7
 
DSP Lab 1-6.pdf
DSP Lab 1-6.pdfDSP Lab 1-6.pdf
DSP Lab 1-6.pdf
 
Lecture_ch6.pptx
Lecture_ch6.pptxLecture_ch6.pptx
Lecture_ch6.pptx
 
Decimation and Interpolation
Decimation and InterpolationDecimation and Interpolation
Decimation and Interpolation
 
dsp
dspdsp
dsp
 
data transmission
data transmission data transmission
data transmission
 
Unit IV_SS_MMS.ppt
Unit IV_SS_MMS.pptUnit IV_SS_MMS.ppt
Unit IV_SS_MMS.ppt
 
Modulation techniques matlab_code
Modulation techniques matlab_codeModulation techniques matlab_code
Modulation techniques matlab_code
 
Baseline Wandering
Baseline WanderingBaseline Wandering
Baseline Wandering
 
Lab01
Lab01Lab01
Lab01
 

Recently uploaded

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxAnaBeatriceAblay2
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Celine George
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaVirag Sontakke
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfadityarao40181
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 

Recently uploaded (20)

Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptxENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
ENGLISH5 QUARTER4 MODULE1 WEEK1-3 How Visual and Multimedia Elements.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
Incoming and Outgoing Shipments in 1 STEP Using Odoo 17
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Painted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of IndiaPainted Grey Ware.pptx, PGW Culture of India
Painted Grey Ware.pptx, PGW Culture of India
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Biting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdfBiting mechanism of poisonous snakes.pdf
Biting mechanism of poisonous snakes.pdf
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 

Digitla Communication pulse shaping filter

  • 1. Digital Communication Systems Homework # 6 Muhammad Irfan Anjum Matlab code is given in the Appendix. BPSK Modulation ±1 Sampling frequency fs= 2000 Hz Sampling interval T=1/fs Symbol duration Ts=20/fs Problem # 1 Matlab script to design root raised cosine filter p(kTs) with roll-off factor 0.5 and convolution of two root raised cosine pulse is shown in fig. 1. The graphs shown in Fig.1 are obtained using oversampling. It is clear from Fig.1 (b) that convolution of two root raised cosine pulses is raise cosine pulse. Problem # 2 Fig. 2 shows the time and frequency plots of transmitted BPSK symbols before and after passing through pulse shaping filter shown in Fig.1. Problem # 3 Fig. 3 shows the time and frequency plots of transmitted BPSK symbols before and after passing through filter h(t), where h(t)=c(t)*p(t).
  • 4. Fig. 3 Problem # 4 Fig. 4 shows the BER graphs of BPSK and 4-QAM modulations schemes in case of MLSD. It is clear from the figure that BPSK performs better than 4-QAM in ISI channel.
  • 5. Fig. 4 Appendix: %% HomeWork#6, Digital Communication Systems... clc clear close all roll_off_factor=0.5; % Rolloff factor. fs=2000; % Sampling rrequency. Ts=1/fs; % Sampling rate. T=20/fs; % Symbol duration M=10^5; % Number of symbols interval=-T/2:Ts:T/2; SNR=0:3:15; %% Problem #1 Index=1; for t=interval if t==0 p(Index)=1-roll_off_factor+4*roll_off_factor/pi; elseif t== abs(Ts/(4*roll_off_factor))
  • 6. p(Index)=roll_off_factor/sqrt(2) * ((1+2/pi)*sin(pi/ (4*roll_off_factor)) + (1-2/pi)*cos(pi/(4*roll_off_factor))); else N= sin(pi*t * (1-roll_off_factor)/Ts) + 4*roll_off_factor*t * cos(pi*t*(1+roll_off_factor)/Ts)/Ts; D= pi*t * (1-(4*roll_off_factor*t/Ts)^2)/Ts; p(Index)=N/D; end Index=Index+1; end figure subplot(211) plot(interval,p); xlabel('time-->'); ylabel('Amplitude'); title('Impulse response of Root raised cosine filter'); grid on p_kTs=conv(p,p); hold on interval=-T:Ts:T; subplot(212) plot(interval,p_kTs); xlabel('time-->'); ylabel('Amplitude'); title('Impulse response of Raised cosine filter'); grid on axis ([-5*Ts 5*Ts -2 10]) %% Problem # 2 m=randsrc(M,1,[-1 1;0.5 0.5]); % BPSK Symbols 1,-1 oversampled_data=upsample(m,T/Ts); figure; subplot(311); stem(oversampled_data); axis ([200 300 -2 2]) xlabel('n'); ylabel('Amplitude'); title('oversampled data');grid on Tx=conv(oversampled_data,p); subplot(312) plot(Tx); axis ([200 300 -2 2]) xlabel('time'); ylabel('Amplitude'); title('Transmitted data');grid on subplot(313); spec_Tx=fft(Tx,length(Tx)); plot(abs(spec_Tx)); xlabel('f'); ylabel('Amplitude'); title('Spectrum of transmitted data');grid on %% Problem #3 m=randsrc(M,1,[-1 1;0.5 0.5]); % BPSK Symbols 1,-1 c=upsample([1 0.5 -0.1],T/Ts); h=conv(c,p); oversampled_data=upsample(m,T/Ts); figure; subplot(311); stem(oversampled_data); axis ([200 300 -2 2]) xlabel('n'); ylabel('Amplitude'); title('oversampled data');grid on Tx=conv(oversampled_data,h);
  • 7. subplot(312) plot(Tx); axis ([200 300 -2 2]) xlabel('time'); ylabel('Amplitude'); title('Transmitted data');grid on subplot(313); spec_Tx=fft(Tx,length(Tx)); plot(abs(spec_Tx)); xlabel('f'); ylabel('Amplitude'); title('Spectrum of transmitted data');grid on %% Problem #4 BPSK [x y]=size(Tx); j=1; m=(m+1)/2; for i=SNR sgma=sqrt(10^(-i/10)); noise=random('Normal',0,sgma,x,y); Rx=noise+Tx; r_k=conv(Rx,fliplr(h)); r=r_k(80:end-79); rx=sign(downsample(r,T/Ts)); rx=(rx+1)/2; [N,ber]=biterr(m,rx); e_bpsk(j)=ber; j=j+1; end % Problem #4 4-QAM rl=1/sqrt(2)*randsrc(M,1,[-1 1;0.5 0.5]); mg=1/sqrt(2)*randsrc(M,1,[-1 1;0.5 0.5]); % BPSK Symbols 1,-1 m=rl+mg*1j; % 4-QAM symbols oversampled_data=upsample(m,T/Ts); Tx=conv(oversampled_data,h); [x y]=size(Tx); j=1; rl=(sqrt(2)*rl+1)/2; mg=(sqrt(2)*mg+1)/2; for i=SNR sgma=sqrt(10^(-i/10)); noise=random('Normal',0,sgma,x,y)+random('Normal',0,sgma,x,y)*1j; Rx=noise+Tx; r_k=conv(Rx,fliplr(h)); r=r_k(80:end-79); rxr=sign(downsample(real(r),T/Ts)); rxm=sign(downsample(imag(r),T/Ts)); rxr=(rxr+1)/2; rxm=(rxm+1)/2; [N,ber1]=biterr(rl,rxr); [N,ber2]=biterr(mg,rxm); e_4qam(j)=(ber1+ber2)/2; j=j+1; end figure; semilogy(SNR,e_bpsk,'-o'); hold on; semilogy(SNR,e_4qam,'-*'); legend('BPSK', '4-QAM'); xlabel('SNR in dB'); ylabel('BER'); title('BER comparison of BPSK and 4-QAM in MLSD detector'); grid on