Use the Matlab code discussed in class to build a simulator for the digital modu
ID: 2083648 • Letter: U
Question
Use the Matlab code discussed in class to build a simulator for the digital modulation scheme assigned to your group. Once finished, run the simulations required to plot BER curves with a minimum probability of bit-error of 10^-4. You will need to turn in a project report that must include the following: a. BER vs SNR (dB) plot - in the same graph, plot at least 4 BER curves corresponding to different values of symbol periods and pulse widths. b. Transmitted signal plot - plot the transmitted signal corresponding to 3 bits. c. Received signal plots - for the transmitted signal (3 bits), plot the received noisy signal for at least 4 values of SNR (e.g. 0 dB, 10 dB, 20 dB, 30 dB). a. Create a presentation page including at least: names and 10s of group members, institution name, project title, course number and title, and date. b. Write an introduction section. c. Search for information (books, publications, online reliable sources, etc.) and develop a theory section that fully explains your assigned modulation scheme including, but not limited to, the modulation and demodulation processes. d. Develop a section of results and analysis. This section must explain the different simulations and present a profound analysis of the results. The plot of BER curves must be included in this section along with any other plots or tables that you consider relevant. e. Write a conclusion section. f. Include in your report an appendix with at least the following: i. Matlab code ii. Essay (300-500 words) describing current or possible practical applications for your assigned modulation scheme.Explanation / Answer
b)bpsk transmitter matlab code corresponding to 3 bits
clear all;
close all;
T=1;%Bit rate is assumed to be 1 bit/s;
%bits to be transmitted
b=[1 0 1];%b is the number of bits to be transmitted i.e 3 bits
NRZ_out=[];
%Vp is the peak voltage +v of the NRZ waveform
Vp=1;
%Here we encode input bitstream as Bipolar NRZ-L waveform
for index=1:size(b,2)
if b(index)==1
NRZ_out=[NRZ_out ones(1,200)*Vp];
elseif b(index)==0
NRZ_out=[NRZ_out ones(1,200)*(-Vp)];
end
end
%Generated bit stream impulses
figure(1);
stem(b);
xlabel('Time (seconds)-->')
ylabel('Amplitude (volts)-->')
title('Impulses of bits to be transmitted');
figure(2);
plot(NRZ_out);
xlabel('Time (seconds)-->');
ylabel('Amplitude (volts)-->');
title('Generated NRZ signal');
%generation of modulated signal
t=0.005:0.005:5;
f=5; %Frequency of the carrier
%Here we generate the modulated signal by multiplying it with carrier (basis function)
s=NRZ_out.*(sqrt(2/T)*cos(2*pi*f*t));
figure;
plot(s);
xlabel('Time (seconds)-->');
ylabel('Amplitude (volts)-->');
title('BPSK Modulated signal');
c) bpsk receiver matlab code
y=[];
%We begin demodulation by multiplying the received signal again with the carrier (basis function)
demodulated=Modulated.*(sqrt(2/T)*cos(2*pi*f*t));
%Here we perform the integration over time period T using trapz
%Integrator is an important part of correlator receiver used here
for i=1:200:size(demodulated,2)
y=[y trapz(t(i:i+199),demodulated(i:i+199))];
end
received=y>0;
figure;
stem(received)
title('Impulses of Received bits');
xlabel('Time (seconds)-->');
ylabel('Amplitude (volts)')
%demodulation over a noisy signal
Eb_N0_dB = 0 ;% Normalized bit SNR in dB.
Eb_N0=10^(Eb_N0_dB/10);% convert the given Eb_No_dB to linear scale
%compute the noise variance which is the same as noise power
M=2;% BPSK is a binary signaling scheme(two symbols)
fs=1000;
T=1;%Data rates (bits/sec)
Ts=T/log2(M);% symbol rate (or modulation rate D) in symbols/sec (bauds)
R=1/Ts;% symbol time (equals bit time in Binary signaling e.g. BPSK)
A=5;% baseband (NRZ-L) pulse amplitude ;
E=A^2*T;% Energy per symbol
ts=1/fs;
t=0:ts:1
noiseVariance=E*fs/(2*log2(M)*Eb_N0);
sigma_n=sqrt(noiseVariance);% standard deviation of noise
n = sigma_n*randn(1,length(s));% generate noise samples
r = s+n ;% received noisy signal array
% plot the received bandpass signal.
subplot(4,1,4);
plot(t,r);
axis([0 MaxPlotTime min(r) max(r)]);
grid on;
xlabel('time');
ylabel('r(t)');
title('Received Bandpass BPSK signal r(t)');
%repeat the simulation using Eb_N0=10db,20db,30db
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.