Upcoming SlideShare
Loading in …5
×

# Digitla Communication pulse shaping filter

2,390
-1

Published on

Published in: Education, Technology, Business
0 Comments
0 Likes
Statistics
Notes
• Full Name
Comment goes here.

Are you sure you want to Yes No
Your message goes here
• Be the first to comment

• Be the first to like this

No Downloads
Views
Total Views
2,390
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
117
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

### Digitla Communication pulse shaping filter

1. 1. Digital Communication Systems Homework # 6 Muhammad Irfan AnjumMatlab code is given in the Appendix.BPSK Modulation ±1Sampling frequency fs= 2000 HzSampling interval T=1/fsSymbol duration Ts=20/fsProblem # 1 Matlab script to design root raised cosine filter p(kTs) with roll-off factor 0.5 and convolution oftwo 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 oftwo 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 passingthrough pulse shaping filter shown in Fig.1.Problem # 3 Fig. 3 shows the time and frequency plots of transmitted BPSK symbols before and after passingthrough filter h(t), where h(t)=c(t)*p(t).
2. 2. Fig.1
3. 3. Fig. 2
4. 4. Fig. 3Problem # 4 Fig. 4 shows the BER graphs of BPSK and 4-QAM modulations schemes in case of MLSD. It isclear from the figure that BPSK performs better than 4-QAM in ISI channel.
5. 5. Fig. 4Appendix:%% HomeWork#6, Digital Communication Systems...clcclearclose allroll_off_factor=0.5; % Rolloff factor.fs=2000; % Sampling rrequency.Ts=1/fs; % Sampling rate.T=20/fs; % Symbol durationM=10^5; % Number of symbolsinterval=-T/2:Ts:T/2;SNR=0:3:15;%% Problem #1Index=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. 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;endfiguresubplot(211)plot(interval,p);xlabel(time-->); ylabel(Amplitude); title(Impulse response of Rootraised cosine filter); grid onp_kTs=conv(p,p);hold oninterval=-T:Ts:T;subplot(212)plot(interval,p_kTs);xlabel(time-->); ylabel(Amplitude); title(Impulse response of Raisedcosine filter); grid onaxis ([-5*Ts 5*Ts -2 10])%% Problem # 2m=randsrc(M,1,[-1 1;0.5 0.5]); % BPSK Symbols 1,-1oversampled_data=upsample(m,T/Ts);figure;subplot(311);stem(oversampled_data);axis ([200 300 -2 2])xlabel(n); ylabel(Amplitude); title(oversampled data);grid onTx=conv(oversampled_data,p);subplot(312)plot(Tx);axis ([200 300 -2 2])xlabel(time); ylabel(Amplitude); title(Transmitted data);grid onsubplot(313);spec_Tx=fft(Tx,length(Tx));plot(abs(spec_Tx));xlabel(f); ylabel(Amplitude); title(Spectrum of transmitted data);gridon%% Problem #3m=randsrc(M,1,[-1 1;0.5 0.5]); % BPSK Symbols 1,-1c=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 onTx=conv(oversampled_data,h);
7. 7. subplot(312)plot(Tx);axis ([200 300 -2 2])xlabel(time); ylabel(Amplitude); title(Transmitted data);grid onsubplot(313);spec_Tx=fft(Tx,length(Tx));plot(abs(spec_Tx));xlabel(f); ylabel(Amplitude); title(Spectrum of transmitted data);gridon%% 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-QAMrl=1/sqrt(2)*randsrc(M,1,[-1 1;0.5 0.5]); mg=1/sqrt(2)*randsrc(M,1,[-1 1;0.50.5]); % BPSK Symbols 1,-1m=rl+mg*1j; % 4-QAM symbolsoversampled_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;endfigure;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