Sie sind auf Seite 1von 18

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

Experiment No:-[1]
EXPERIMENT: - To generate line equation and signal with AWGN noise.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:Here a straight line equation having slope m and constant c is generated . Secondly a cosine signal
is generated and after addition of AWGN(Additive White Gaussian Noise) its response is shown.
MATLAB CODE:close all;
clear all;
clc;
% RAMP FUNCTION
t=0:0.01:5;
a=4;
N=a*t;
subplot(2,2,1);
plot(t,N);
title('Ramp Funcion');
xlabel('Time');
ylabel('Amplitude');
%SINE FUNCTION
f=1;
y=sin(2*pi*f*t);
subplot(2,2,2);
plot(t,y);
xlabel('Time');
ylabel('Amplitude');
title('Sine Funcion');
%Noise addition
z=awgn(y,5);
subplot(2,2,3);
plot(t,z);
xlabel('Time');
ylabel('Amplitude');
title('Noise signal');
subplot(2,2,4);
plot(t,y,t,z);
xlabel('Time');
ylabel('Amplitude');
title('Noise & sine signal');

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

RESULTS:-

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

Experiment No:-[2]
EXPERIMENT: - To generate ASK signal.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:ASK is a type of modulation or shift keying in which the strength (amplitude) of the carrier wave is
varied to represent 1 or 0 pulses. Here a high amplitude represents a 1 and a low amplitude is a 0.
MATLAB CODE:clear all;
close all;
clc;
x=input('Enter the input digital sequence');
N=length(x);
t=0.01:0.01:N;
% Carrier generate
c=sin(2*pi*t);
% Binary sequence generate
for i=1:1:N
m((i-1)*100+1:i*100)=x(i);
end
% ASK generation
y=c.*m;
% Display Binary sequence
subplot(3,1,1);
plot(m);
xlabel('time');
ylabel('amplitude');
title('digital input signal');
% Display Carrier signal
subplot(3,1,2);
plot(c);
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal');
subplot(3,1,3);
plot(y);
xlabel('time');
ylabel('amplitude');
title('ASK modulated signal');

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

RESULTS: Enter the input digital sequence [1 0 1 0 1 0 1 0 0 1 0 1 0 1 0 1]

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

Experiment No:-[3a]
EXPERIMENT: - To generate BPSK signal.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:In BPSK phase of the carrier is switched depending upon the input digital signal. The waveform
produced here is a NRZ(non-return-to-zero) binary waveform, produced through NRZ level encoder.
MATLAB CODE:close all;
clear all;
clc;
x=input('Enter the input binary sequence');
N=length(x);
% Binary sequence generate
x(x==0)=-1;
t=0.01:0.01:N;
% Carrier generate
c=sin(2*pi*t);
for i=1:1:N
m((i-1)*100+1:i*100)=x(i);
end
% PSK generation
y=c.*m;
subplot(3,1,1);
plot(t,m);
xlabel('time');
ylabel('amplitude');
title('digital input signal');
subplot(3,1,2);
plot(t,c);
xlabel('time');
ylabel('amplitude');
title('sinusoidal signal');
subplot(3,1,3);
plot(t,y);
xlabel('time');
ylabel('amplitude');
title('PSK modulated signal');

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

RESULTS: Enter the input binary sequence [1 0 1 0 1 0 1 0 1 0 1 0 1 0 1]

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

Experiment No:-[3b]
EXPERIMENT: - Performance evaluation of BPSK in AWGN environment.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:After generating BPSK signal it is passed through noise and at different SNR values the BER(Bit
Error Rate) is shown.
MATLAB CODE:%transmitt
L=input('how much length do you want: ');
x=randint(L,1,2);
L1=input('how much range of snr do you want in db: ');
y=pskmod(x,2);%psk modulation
m=1:L1;
ber=zeros(1,L1);
for snr=1:L1
y1 = awgn(y,snr); % Add white Gaussian noise while through channel.
y2=zeros(length(y1),1);
%receive
for i=1:length(y1)
if real(y1(i))>0
y2(i)=1;
else
y2(i)=-1;
end
end
z=pskdemod(y2,2);% psk demodulation
n=0;
for i=1:L
if(x(i)~=z(i))
n=n+1;
end
end
ber(snr)=(n/L);
end
figure;
semilogy(m,ber);
RESULTS: how much length do you want: 100000
how much range of snr do you want in db: 20

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

Experiment No:-[4]
EXPERIMENT: - To generate FSK signal.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:In FSK binary 1 is represented by high frequency carrier and binary 0 is represented by low
frequency carrier and for the generation of FSK, NRZ coding will be used.
MATLAB CODE:close all;
clear all;
clc;
fc1=input('Enter the freq of 1st carrier:');
fc2=input('Enter the freq of 2nd carrier:');
fp=input('Enter the freq of Periodic Binary pulse:');
amp=input('Enter the amplitude:');
amp=amp/2;
t=0:0.001:1;
% For Generating 1st Carrier Sine wave
c1=amp.*sin(2*pi*fc1*t);
% For Generating 2nd Carrier Sine wave
c2=amp.*sin(2*pi*fc2*t);
subplot(4,1,1);
plot(t,c1)
xlabel('Time')
ylabel('Amplitude');
title('1st Carrier signal');
subplot(4,1,2)
plot(t,c2);
xlabel('Time');
ylabel('Amplitude');
title('2nd Carrier signal');
m=amp.*square(2*pi*fp*t)+amp;%For message signal
subplot(4,1,3)
plot(t,m);
xlabel('Time');
ylabel('Amplitude');
title('message signal');
for i=0:1000 %here we are generating the fsk
if m(i+1)==0
mm(i+1)=c2(i+1);
else
mm(i+1)=c1(i+1);
end
end
subplot(4,1,4) %For Plotting The Modulated wave
plot(t,mm)
xlabel('Time')
ylabel('Amplitude')
9

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

title('FSK Modulated Wave')


Enter the freq of 1st carrier:40
Enter the freq of 2nd carrier:20
Enter the freq of Periodic Binary pulse:5
Enter the amplitude:2
RESULTS: -

10

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

Experiment No:-[5]
EXPERIMENT: - Performance evaluation of QPSK in AWGN environment.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:After generating QPSK signal it is passed through noise and at different SNR values the BER(Bit
Error Rate) is shown.
MATLAB CODE:%QPSK Transmitt
L=input('how much length do you want: ');
x=randint(L,1,4);
L1=input('how much range of snr do you want in db: ');
y=pskmod(x,4,0,'gray');
scatterplot(y);
m=1:L1;
ber=zeros(1,L1);
y3=unique(y);
L3=length(y3);
y4=zeros(1,L3);
for snr=1:L1
y1 = awgn(y,snr);
% Add white Gaussian noise while through channel.
y2=zeros(length(y1),1);
%QPSK Receive
for i=1:length(y1)
for j=1:L3
y4(j)=abs(y1(i)-y3(j));
end
a=find(y4==min(y4));
y2(i)=y3(a);
end
z=pskdemod(y2,4,0,'gray');
n=0;
for i=1:L
if(x(i)~=z(i))
n=n+1;
end
RESULTS: how much length do you want: 100000
how much range of snr do you want in db: 20

11

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

12

2014

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

Experiment No:-[6]
EXPERIMENT: - To generate QAM with AWGN noise.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:Quadrature amplitude modulation (QAM) is both an analog and a digital modulation scheme. It
conveys two analog message signals, or two digital bit streams, by changing (modulating)
the amplitudes of two carrier waves, using the amplitude-shift keying (ASK) digital modulation
scheme or amplitude modulation (AM) analog modulation scheme. The two carrier waves,
usually sinusoids, are out of phase with each other by 90 and are thus called quadrature carriers or
quadrature components hence the name of the scheme. The modulated waves are summed, and the
final waveform is a combination of both phase-shift keying (PSK) and amplitude-shift keying (ASK),
or (in the analog case) of phase modulation (PM) and amplitude modulation. In the digital QAM
case, a finite number of at least two phases and at least two amplitudes are used.
TRANSMITTER

RECEIVER

MATLAB CODE:close all;


clear all;
clc;
% Create a random digital message
M=input('Enter the value of M : ');
%M = 16;
% Alphabet size
x = randi([0 M-1],500,1); % Random symbols
% Use M-QAM modulation.
hMod = modem.qammod(M);
hDemod = modem.qamdemod(hMod);
% Create a scatter plot and show constellation
scatterPlot = commscope.ScatterPlot('SamplesPerSymbol',1,...
'Constellation',hMod.Constellation);
scatterPlot.PlotSettings.Constellation = 'on';
13

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

% Modulate
y = modulate(hMod,x);
plot(x,y);
title('modulated signal');
xlabel('time axis');
ylabel('amplitude');
% Transmit signal through an AWGN channel.
ynoisy = awgn(y,1,'measured');
% Create scatter plot from noisy data.
update(scatterPlot,ynoisy);
% Demodulate ynoisy to recover the message.
z=demodulate(hDemod,ynoisy);
plot(x,z);
title('Demodulated signal');
xlabel('time axis');
ylabel('amplitude');
% Check symbol error rate.
[num,rt] = symerr(x,z);
RESULTS: Enter the value of M : 4
num = 126
rt = 0.2520

14

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

15

2014

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

Experiment No:-[7]
EXPERIMENT: - To simulate the transmitter and receiver for ASK BPSK, FSK QPSK and QAM
and measure BER.
SOFTWARE REQUIRED: - Matlab 7.12.0.
THEORY:In Simulink, it is very straightforward to represent and then simulate a mathematical model
representing a physical system. Models are represented graphically in Simulink as block diagrams.
One of the primary advantages of employing Simulink (and simulation in general) for the analysis of
dynamic systems is that it allows us to quickly analyze the response of complicated systems that may
be prohibitively difficult to analyze analytically. Simulink is able to numerically approximate the
solutions to mathematical models that we are unable to, or don't wish to, solve "by hand."
In general, the mathematical equations representing a given system that serves as the basis for a
Simulink model can be derived from physical laws.
MATLAB SIMULINK MODEL:ASK

16

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

BPSK

FSK

QPSK

17

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

EC-555 ADVANCED COMMUNICATION SYSTEM

2014

QAM

RESULTS: - We successfully simulate the transmitter and receiver for ASK BPSK, FSK QPSK
and QAM and measure BER.

18

Department of Elect. and Comm. Engg. , Dr. B R Ambedkar National Institute of Technology, Jalandhar

Das könnte Ihnen auch gefallen