Digital Communication Lab
Digital Communication Lab
ADC Lab
1
INDEX
4 To perform modulation and demodulation of BPSK and draw its scatter plot . 43
2
EXPERIMENT-1
Exercise-1
>> p=[14678]
p=
14678
>> q=[1;2;5;1;6;]
q=
>> r=p*q
r=
3
14678
29356
73390
14678
88068
>> s=q*p
s=
14678
29356
73390
14678
88068
>> t=p.*q
t=
14678
29356
73390
14678
88068
4
>> p=[1 4 6 7 8]
p=
1 4 6 7 8
q=
>> s=q*p
s=
1 4 6 7 8
2 8 12 14 16
5 20 30 35 40
1 4 6 7 8
6 24 36 42 48
5
>> t=p.*q
>> t=p*q
t=
94
>> t=q*p
t=
1 4 6 7 8
2 8 12 14 16
5 20 30 35 40
1 4 6 7 8
6 24 36 42 48
Exercise-2
>> p-q
6
>> p=[14678]
p=
14678
>> q=[1;2;5;1;6;;]
q=
>> t=p.*q
t=
14678
29356
73390
14678
88068
7
>> p-q
ans =
14677
14676
14673
14677
14672
>> p+q
ans =
14679
14680
14683
14679
14684
>> p-t
ans =
8
-14678
-58712
-73390
>> p+t
ans =
29356
44034
88068
29356
102746
>> p^2
ans =
215443684
>> p.^2
ans =
215443684
9
Exercise-3
>> p=[14678]
p=
14678
>> sqrt(p)
ans =
121.1528
a=
1 3 5
2 1 7
9 0 2
>> a(2,3)
10
ans =
>> a(2:3;1:2)
??? a(2:3;1:2)
>> a=(2:2,1:3)
??? a=(2:2,1:3)
>> a(2:3,1:3)
ans =
2 1 7
9 0 2
>> a(2:3,1:2)
ans =
11
2 1
9 0
>> a(:,2)=[]
a=
1 5
2 7
9 2
>> a(2:3,1:2)
ans =
2 7
9 2
>> a(:,2)
ans =
12
Exercise-4
>> zeros(2,3)
ans =
0 0 0
0 0 0
>> ones(2,3)
ans =
1 1 1
1 1 1
>> eye(3)
ans =
1 0 0
0 1 0
0 0 1
13
ans =
-2 2
ans =
-3 2
ans =
-2 3
ans =
-2 3
ans =
14
-2 3
ans =
-3 2
>> m=0.5;
>> c=-2;
>> x=[0,1.5,3,4,5,7,9,10];
>> y=m*x+c;
>> y=m*x+c
y=
Exercise-5
a=
1 3 5
15
2 1 7
9 0 2
>> a*3
ans =
3 9 15
6 3 21
27 0 6
>> a(2,2)
ans =
>> linspace(2,10,5)
ans =
2 4 6 8 10
>> x=linspace(0,2*pi,9)
x=
16
0 0.7854 1.5708 2.3562 3.1416 3.9270 4.7124 5.4978 6.2832
>> linspace(0,10,2)
ans =
0 10
>> linspace(0,10,5)
ans =
>> linspace(0,10,6)
ans =
0 2 4 6 8 10
>> linspace(4,10,7)
ans =
4 5 6 7 8 9 10
17
Exercise-6
>> a=[1;2;3;4;]
a=
>> b=[5 6 7 8]
b=
5 6 7 8
>> a*b
ans =
5 6 7 8
10 12 14 16
15 18 21 24
20 24 28 32
18
>> b*a
ans =
70
>> a.*b
>> b.*a
>> a^2
>> a.^2
ans =
16
19
>> b^2
>> b.^2
ans =
25 36 49 64
Exercise-7
>> linspace(10,-10,9)
ans =
>> linspace(25,45,5)
ans =
25 30 35 40 45
20
Exercise 8
t=linspace(1,10,10)
t=
1 2 3 4 5 6 7 8 9 10
>> sin(t)
ans =
Columns 1 through 9
Column 10
-0.5440
>> x=t*sin(t)
21
>> a=sin(t)
a=
Columns 1 through 9
Column 10
-0.5440
>> x=t.*a
x=
Columns 1 through 9
Column 10
-5.4402
22
>> x=t.*sin(t)
x=
Columns 1 through 9
Column 10
-5.4402
>> y=(t-1)/(t+1)
y=
0.7426
>> y=(t-1)./(t+1)
y=
Columns 1 through 9
23
Column 10
0.8182
>> t^2
>> t.^2
ans =
1 4 9 16 25 36 49 64 81 100
>> z=sin.(t^2)
>> z=sin(t.^2)
z=
Columns 1 through 9
Column 10
24
-0.5064
>> z=sin(t.*t)
z=
Columns 1 through 9
Column 10
-0.5064
>> z=.sin(t.^2)
??? z=.sin(t.^2)
>> z=sin.(t.^2)
??? Argument to dynamic structure reference must evaluate to a valid field name
>> z=sin(t.^2)./t.^2
25
z=
Columns 1 through 9
Column 10
-0.0051
Exercise 9
x=linspace(0,2*pi,100);
>> y=sin(x);
>> plot(x,y)
0.8
0.6
0.4
0.2
-0.2
-0.4
-0.6
-0.8
-1
0 1 2 3 4 5 6 7
26
>> exp(3)
ans =
20.0855
>> exp(1)
ans =
2.7183
>> log(exp(3))
ans =
>> log(exp(3))/log(10)
ans =
1.3029
>> log10(exp(3))
27
ans =
1.3029
>> exp(pi*sqrt(163))
ans =
2.6254e+017
>> sin(pi/6)
ans =
0.5000
>> cos(pi/6)
ans =
0.8660
>> tan(pi/2)
ans =
28
1.6331e+016
>> x=32*pi;
>> y=cosh^2(x)-sinh^2(x)
??? y=cosh^2(x)-sinh^2(x)
>> y=cosh^2x-sinh^2x
??? y=cosh^2x-sinh^2x
>> y=cosh(x)*cosh(x)-sinh(x)*sinh(x)
y=
>> y=(coshx)^2-(sinhx)^2
>> y=cosh(x)^2-sinh(x)^2
29
y=
>> x=linspace(0,4*pi,10);
>> y=exp(-0.4*x).*sin(x)
y=
Columns 1 through 9
Column 10
-0.0000
>> x=linspace(0,4*pi,10);
>> y=exp(-0.4*x).*sin(x);
>> plot(x,y)
30
0.6
0.5
0.4
0.3
0.2
0.1
-0.1
-0.2
0 2 4 6 8 10 12 14
>> x=linspace(0,4*pi,50);
>> y=exp(-0.4*x).*sin(x);
>> plot(x,y)
31
0.6
0.5
0.4
0.3
0.2
0.1
-0.1
-0.2
0 2 4 6 8 10 12 14
>> x=linspace(0,4*pi,100);
>> y=exp(-0.4*x).*sin(x);
>> plot(x,y)
0.6
0.5
0.4
0.3
0.2
0.1
-0.1
-0.2
0 2 4 6 8 10 12 14
32
>> a=0:10:100
a=
0 10 20 30 40 50 60 70 80 90 100
>> a=[1,2;3,4]
a=
1 2
3 4
>> nthroot(a,3)
ans =
1.0000 1.2599
1.4422 1.5874
>> a=[8]
a=
33
>> nthroot(a,3)
ans =
>> a=[1,2;3,4]
a=
1 2
3 4
>> asqrt=sqrt(a)
asqrt =
1.0000 1.4142
1.7321 2.0000
34
EXPERIMENT-2
Code:
t=0:pi/100:2*pi;
>> a=1;
>> y=a*sin(t);
>> ylabel('a')
>> plot(t,y)
0.8
0.6
0.4
0.2
0
a
-0.2
-0.4
-0.6
-0.8
-1
0 1 2 3 4 5 6 7
time axis
35
For a=10
>> t=0:pi/100:2*pi;
>> a=10;
>> y=a*sin(t);
>> ylabel('a')
>> plot(t,y)
10
-2
-4
-6
-8
-10
0 1 2 3 4 5 6 7
>> t=0:pi/100:2*pi;
>> a=10;
36
>> y=a*cos(t);
>> ylabel('a')
>> plot(t,y)
10
-2
-4
-6
-8
-10
0 1 2 3 4 5 6 7
37
EXPERIMENT-3
Code:
>> t=0:pi/100:2*pi;
>> a=1;
>> y=a*sin(t);
>> y1=a*sin(t-0.25);
>> y1=a*sin(t-0.5);
>> y1=a*sin(t-0.25);
>> y2=a*sin(t-0.5);
>> y3=a*sin(t+0.25);
>> y4=a*sin(t+0.5);
>> plot(t,y,t,y1,t,y2,t,y3,t,y4);
>> xlabel('time');
>> ylabel('amplitude');
38
delayed sine waves
1
0.8
0.6
0.4
0.2
amplitude
-0.2
-0.4
-0.6
-0.8
-1
0 1 2 3 4 5 6 7
time
Add On:
>> t=0:pi/100:2*pi;
>> a1=1;
>> a2=3;
>> a3=6;
>> a4=10;
>> y1=a1*sin(t-0.25);
>> y2=a2*sin(t-0.5);
>> y3=a3*sin(t+0.25);
39
>> y4=a4*sin(t+0.5);
>> plot(t,y,t,y1,t,y2,t,y3,t,y4);
2
amplitude
-2
-4
-6
-8
-10
0 1 2 3 4 5 6 7
time
40
>> h = legend('y1','y2','y3','y4');
2
amplitude
-2
-4
-6
-8
-10
0 1 2 3 4 5 6 7
time
>> t=0:pi/100:2*pi;
>> a1=1;
>> a2=3;
>> a3=6;
>> y1=a1*sin(t-0.25);
>> y2=a2*sin(t-0.45);
>> y3=a3*sin(t+0.25);
>> plot(t,y1,'-ro',t,y2,'-.b',t,y3,'-g*');
41
>> xlabel('time');
>> ylabel('amplitude');
>> h = legend('y1','y2','y3');
2
amplitude
-2
-4
-6
0 1 2 3 4 5 6 7
time
42
EXPERIMENT-4
Aim: To perform modulation and demodulation of BPSK and draw its scatter plot .
Code:
(For M=2)
>> M=2;
>> y=[0:M-1];
>> y1=pskmod(y,M);
>> scatterplot(y1);
S c a t t e r p lo t
0.8
0.6
0.4
Q u a d ra t u re
0.2
-0 . 2
-0 . 4
-0 . 6
-0 . 8
-1
-1 -0 . 5 0 0.5 1
In -P h a s e
(For M=4)
S c a t t e r p lo t
1
0.8
0.6
0.4
0.2
Q u a d ra t u re
-0 . 2
-0 . 4
-0 . 6
-0 . 8
-1
-1 -0 . 5 0 0.5 1
In -P h a s e
43
For M=8
S c atter plot
1
0.8
0.6
0.4
0.2
Q uadrature
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.5 0 0.5 1
In-P has e
For M=16
Scatter plot
0.8
0.6
0.4
0.2
Quadrature
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.5 0 0.5 1
In-Phase
44
EXPERIMENT-5
Code:
For SNR=1
>> M=4;
>> x=randint(1000,1,M);
>> y1=pskmod(x,M);
>> scatterplot(y1);
>> y2=awgn(y1,1);
>> scatterplot(y2);
S c atter plot
1
0.8
0.6
0.4
0.2
Q uadrature
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.5 0 0.5 1
In-P has e
45
Scatter plot
3
1
Quadrature
-1
-2
-3
-3 -2 -1 0 1 2 3
In-Phase
>> y3=pskdemod(y2,M);
>> [numerr,errrate]=symerr(x,y3)
numerr =
253
errrate =
0.2530
46
For SNR=5
Scatter plot
2.5
1.5
0.5
Quadrature
-0.5
-1
-1.5
-2
-2.5
-2 -1 0 1 2
In-Phase
>> y3=pskdemod(y2,M);
>> [numerr,errrate]=symerr(x,y3)
numerr =
75
errrate =
0.0750
47
For SNR=20
Scatter plot
0.5
Quadrature
-0.5
-1
-1 -0.5 0 0.5 1
In-Phase
>> y3=pskdemod(y2,M);
>> [numerr,errrate]=symerr(x,y3)
numerr =
errrate =
48
Add on:
>> M=4;
>> x=randint(100,1,M);
>> y1=pskmod(x,M);
>> scatterplot(y1);
>> y2=awgn(y1,5);
>> scatterplot(y2);
>> y3=pskdemod(y2,M);
>> [numerr,errrate]=symerr(x,y3)
numerr =
errrate =
0.0100
>> M=8;
>> x=randint(100,1,M);
>> y1=pskmod(x,M);
>> scatterplot(y1);
>> y2=awgn(y1,5);
>> scatterplot(y2);
>> y3=pskdemod(y2,M);
>> [numerr,errrate]=symerr(x,y3)
numerr =
49
32
errrate =
0.3200
>> M=16;
>> x=randint(100,1,M);
>> y1=pskmod(x,M);
>> scatterplot(y1);
>> y2=awgn(y1,5);
>> scatterplot(y2);
>> y3=pskdemod(y2,M);
>> [numerr,errrate]=symerr(x,y3)
numerr =
66
errrate =
0.6600
>> M=32;
>> x=randint(100,1,M);
>> y1=pskmod(x,M);
>> scatterplot(y1);
>> y2=awgn(y1,5);
>> scatterplot(y2);
>> y3=pskdemod(y2,M);
50
>> [numerr,errrate]=symerr(x,y3)
numerr =
83
errrate =
0.8300
>> M=4;
>> x=randint(100,1,M);
>> y1=qammod(x,M);
>> scatterplot(y1);
>> y2=awgn(y1,5);
>> scatterplot(y2);
>> y3=qamdemod(y2,M);
>> [numerr,errrate]=symerr(x,y3)
numerr =
errrate =
0.0100
51
Scatter plot
1
0.8
0.6
0.4
0.2
Quadrature
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.5 0 0.5 1
In-Phase
Scatter plot
1.5
0.5
Quadrature
-0.5
-1
-1.5
-2
-2 -1 0 1 2
In-Phase
52
>> M=8;
>> x=randint(100,1,M);
>> y1=qammod(x,M);
>> scatterplot(y1);
>> y2=awgn(y1,5);
>> scatterplot(y2);
>> y3=qamdemod(y2,M);
>> [numerr,errrate]=symerr(x,y3)
numerr =
errrate =
Scatter plot
3
1
Quadrature
-1
-2
-3
-3 -2 -1 0 1 2 3
In-Phase
53
Scatter plot
4
1
Quadrature
-1
-2
-3
-4
-4 -2 0 2 4
In-Phase
>> M=16;
>> x=randint(100,1,M);
>> y1=qammod(x,M);
>> scatterplot(y1);
>> y2=awgn(y1,5);
>> scatterplot(y2);
>> y3=qamdemod(y2,M);
>> [numerr,errrate]=symerr(x,y3)
numerr =
errrate =
0.0300
54
>> M=32;
>> x=randint(100,1,M);
>> y1=qammod(x,M);
>> scatterplot(y1);
>> y2=awgn(y1,5);
>> scatterplot(y2);
>> y3=qamdemod(y2,M);
>> [numerr,errrate]=symerr(x,y3)
numerr =
errrate =
0.0400
>> M=64;
>> x=randint(100,1,M);
>> y1=qammod(x,M);
>> scatterplot(y1);
>> y2=awgn(y1,5);
>> scatterplot(y2);
>> y3=qamdemod(y2,M);
>> [numerr,errrate]=symerr(x,y3)
numerr =
55
errrate =
0.0100
>> M=128;
>> x=randint(100,1,M);
>> y1=qammod(x,M);
>> scatterplot(y1);
>> y2=awgn(y1,5);
>> scatterplot(y2);
>> y3=qamdemod(y2,M);
>> [numerr,errrate]=symerr(x,y3)
numerr =
errrate =
56
EXPERIMENT-6
Aim: To plot a QPSK signal with different delay using for loop.
Code:
>> Es=50;
>> T=10;
>> fc=6/T;
>> t=(0:pi/1000:2*pi);
>> M=4;
y=sqrt(2*Es/T)*cos(2*pi*fc*t+2*pi*m/M);
subplot(2,2,m+1);
plot(y);
xlabel('time');
ylabel('amplitude');
end
57
qpsk with different delay using for loop qpsk with different delay using for loop
4 4
2 2
amplitude
amplitude
0 0
-2 -2
-4 -4
0 1000 2000 3000 0 1000 2000 3000
time time
qpsk with different delay using for loop qpsk with different delay using for loop
4 4
2 2
amplitude
0 amplitude 0
-2 -2
-4 -4
0 1000 2000 3000 0 1000 2000 3000
time time
58
EXPERIMENT-7
Aim: To plot a PSK signal with different delay using for loop.
Code:
>> Es=50;
>> T=10;
>> fc=6/T;
>> t=(0:pi/1000:2*pi);
>> M=2;
y=sqrt(2*Es/T)*cos(2*pi*fc*t+2*pi*m/M);
subplot(2,1,m+1);
plot(y);
end
59
psk with different delay using for loop
4
2
amplitude
-2
-4
0 500 1000 1500 2000 2500
time
psk with different delay using for loop
4
2
amplitude
-2
-4
0 500 1000 1500 2000 2500
time
Add On:
Aim: To plot a PSK signal with different delay and SNR=5 using for loop
>> Es=50;
>> T=10;
>> fc=6/T;
>> t=(0:pi/1000:2*pi);
>> M=2;
y=sqrt(2*Es/T)*cos(2*pi*fc*t+2*pi*m/M);
y1=awgn(y,5);
xlabel('time');
ylabel('amplitude');
subplot(2,1,m+1);
60
plot(y1);
end
1
amplitude
-1
-2
-3
-4
-5
0 500 1000 1500 2000 2500
time
1
amplitude
-1
-2
-3
-4
-5
0 500 1000 1500 2000 2500
time
>> Es=50;
>> T=10;
>> fc=6/T;
>> t=(0:pi/1000:2*pi);
>> M=2;
y=sqrt(2*Es/T)*cos(2*pi*fc*t+2*pi*m/M);
y1=awgn(y,5);
61
y2=awgn(y,10);
y3=awgn(y,1);
y4=awgn(y,100);
subplot(4,1,1);
plot(y1);
xlabel('time');
ylabel('amplitude');
subplot(4,1,2);
plot(y2);
xlabel('time');
ylabel('amplitude');
subplot(4,1,3);
plot(y3);
xlabel('time');
ylabel('amplitude');
subplot(4,1,4);
plot(y4);
xlabel('time');
ylabel('amplitude');
end;
62
psk with SNR=5 and different delay-creatde by gaurav
5
amplitude
-5
-10
0 500 1000 1500 2000 2500
time
psk with SNR=10 and different delay-creatde by gaurav
5
amplitude
-5
0 500 1000 1500 2000 2500
time
psk with SNR=1 and different delay-created by gaurav
10
5
amplitude
-5
-10
0 500 1000 1500 2000 2500
time
psk with SNR=100 and different delay-created by gaurav
4
2
amplitude
-2
-4
0 500 1000 1500 2000 2500
time
63
EXPERIMENT-8
Code:
>> T=1;
>> M=8;
>> Es=T/2;
>> fc=6/T;
>> N=100;
>> delta_T=T/(N-1);
>> t=0:delta_T:T;
>> u0=sqrt(2*Es/T)*cos(2*pi*fc*t);
>> u1=sqrt(2*Es/T)*cos(2*pi*fc*t+2*pi/M);
>> u2=sqrt(2*Es/T)*cos(2*pi*fc*t+4*pi/M);
>> u3=sqrt(2*Es/T)*cos(2*pi*fc*t+6*pi/M);
>> u4=sqrt(2*Es/T)*cos(2*pi*fc*t+8*pi/M);
>> u5=sqrt(2*Es/T)*cos(2*pi*fc*t+10*pi/M);
>> u6=sqrt(2*Es/T)*cos(2*pi*fc*t+12*pi/M);
>> u7=sqrt(2*Es/T)*cos(2*pi*fc*t+14*pi/M);
>> subplot(8,1,1);
>> plot(t,u0);
>> subplot(8,1,2);
>> plot(t,u1);
64
>> subplot(8,1,3);
>> plot(t,u2);
>> subplot(8,1,4);
>> plot(t,u3);
>> subplot(8,1,5);
>> plot(t,u4);
>> subplot(8,1,6);
>> plot(t,u5);
>> subplot(8,1,7);
>> plot(t,u6);
>> subplot(8,1,8);
>> plot(t,u7);
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
1
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
1
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
1
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
1
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
1
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
1
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
1
-1
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1
65
Assignment
>> M=2;
>> x=randint(100,1,M);
>> y1=fskmod(x,M,8,8,32);
>> scatterplot(y1);
>> y2=awgn(y1,5,'measured');
>> scatterplot(y2);
>> y3=fskdemod(y2,M,8,8,32);
>> [numerr,errrate]=symerr(x,y3)
numerr =
errrate =
66
S c a t t e r p lo t
0.8
0.6
0.4
0.2
Q u a d ra t u re
-0 . 2
-0 . 4
-0 . 6
-0 . 8
-1
-1 -0 . 5 0 0.5 1
In -P h a s e
Scatter plot
2.5
1.5
0.5
Quadrature
-0.5
-1
-1.5
-2
-2.5
-2 -1 0 1 2
In-Phase
>> M=4;
>> x=randint(100,1,M);
67
>> y1=fskmod(x,M,8,8,32);
>> scatterplot(y1);
>> y2=awgn(y1,5,'measured');
>> scatterplot(y2);
>> y3=fskdemod(y2,M,8,8,32);
>> [numerr,errrate]=symerr(x,y3)
numerr =
errrate =
S c a tte r p lo t
1
0 .8
0 .6
0 .4
0 .2
Q u a d ra tu re
-0 .2
-0 .4
-0 .6
-0 .8
-1
-1 -0 .5 0 0 .5 1
In -P h a s e
68
Scatter plot
1.5
0.5
Quadrature
-0.5
-1
-1.5
-2
-2 -1 0 1 2
In-Phase
>> M=2;
>> x=randint(100,1,M);
>> y1=fskmod(x,M,16,16,32);
>> y1=fskmod(x,M,8,8,32);
>> scatterplot(y1);
>> y2=awgn(y1,25,'measured');
>> scatterplot(y2);
>> y3=fskdemod(y2,M,8,8,32);
>> [numerr,errrate]=symerr(x,y3)
numerr =
69
0
errrate =
Scatter plot
0.5
Quadrature
-0.5
-1
-1 -0.5 0 0.5 1
In-Phase
>> M=2;
>> x=randint(100,1,M);
>> y1=fskmod(x,M,8,8,32);
>> scatterplot(y1);
>> y2=awgn(y1,10,'measured');
>> scatterplot(y2);
70
>> y3=fskdemod(y2,M,8,8,32);
>> [numerr,errrate]=symerr(x,y3)
numerr =
errrate =
Scatter plot
1.5
0.5
Quadrature
-0.5
-1
-1.5
>> M=2;
>> x=randint(100,1,M);
>> y1=fskmod(x,M,8,8,32);
>> scatterplot(y1);
71
>> y2=awgn(y1,1,'measured');
>> scatterplot(y2);
>> y3=fskdemod(y2,M,8,8,32);
>> [numerr,errrate]=symerr(x,y3)
numerr =
errrate =
0.0200
Scatter plot
2.5
1.5
0.5
Quadrature
-0.5
-1
-1.5
-2
-2.5
-2 -1 0 1 2
In-Phase
72
>> M=2;
>> y1=fskmod(x,M,16,16,32);
>> scatterplot(y1);
>> y2=awgn(y1,10,'measured');
>> scatterplot(y2);
>> y3=fskdemod(y2,M,16,16,32);
>> [numerr,errrate]=symerr(x,y3)
numerr =
errrate =
Scatter plot
1
0.8
0.6
0.4
0.2
Quadrature
-0.2
-0.4
-0.6
-0.8
-1
-1 -0.5 0 0.5 1
In-Phase
73
Scatter plot
1.5
0.5
Quadrature
-0.5
-1
-1.5
>> M=4;
>> y1=fskmod(x,M,16,16,256);
>> scatterplot(y1);
>> y2=awgn(y1,10,'measured');
>> scatterplot(y2);
>> y3=fskdemod(y2,M,16,16,256);
>> [numerr,errrate]=symerr(x,y3)
numerr =
74
0
errrate =
S c a tte r p lo t
0 .8
0 .6
0 .4
0 .2
Q u a d ra tu re
-0 .2
-0 .4
-0 .6
-0 .8
-1
-1 -0 .5 0 0 .5 1
In -P h a s e
S c atter plot
1.5
0.5
Q uadrature
-0.5
-1
-1.5
75
EXPERIMENT -9
Simulink Exercises
Modified model:
76
Scope output:
Add on:
Tx
8-FSK AWGN Error Rate 0.7536
Bernoulli 8-FSK
Calculation
Binary Rx 7537
M-FSK M-FSK
AWGN Error Rate
Bernoulli Binary
1e+004
Generator Modulator Demodulator Calculation
Channel
Baseband Baseband
Display
77
Tx
8-FSK AWGN Error Rate 0.7513
Bernoulli 8-FSK
Calculation
Binary Rx 432
M-FSK M-FSK
AWGN Error Rate
Bernoulli Binary
575
Generator Modulator Demodulator Calculation
Channel
Baseband Baseband
Display
Tx
8-FSK AWGN Error Rate 0.7697
Bernoulli 8-FSK
Calculation
Binary Rx 859
M-FSK M-FSK
AWGN Error Rate
Bernoulli Binary
1116
Generator Modulator Demodulator Calculation
Channel
Baseband Baseband
Display
78
79
3. MSK Modulation and Demodulation and error rate calculation
80
81
4. QPSK Modulation and Demodulation and error rate calculation
82
83