Professional Documents
Culture Documents
1
Mutirate signal processing ............................................................................................................. 1
Sine wave Decimate ...................................................................................................................... 2
Cosine wave Decimate ................................................................................................................... 5
Interpolation ................................................................................................................................. 8
Down Sampling.............................................................................................................................. 9
Upsampling ................................................................................................................................. 10
Interpolation ............................................................................................................................... 11
Resampling changes quantisation level ........................................................................................ 12
Exercise: Upsample a signal by 5 and then downsample by 5 and verify x=y ................................ 13
Down sample by 5 and upsample by 5 and verify x is not equal to 5 ............................................ 15
enter signal upsample by 20 and then down sample by 5 is equal ................................................ 16
Department of Electronics Engineering
%Yeshwantrao Chavan College of Engineering
%Name:CHETAN SETIYA
%Roll no :143
%Reg no :20010248
%Batch : B3
%Date of performance:07/11/2022
%Experiment no: 8
n =
Columns 1 through 7
Columns 8 through 14
Columns 15 through 21
Columns 22 through 28
0.2100 0.2200 0.2300 0.2400 0.2500 0.2600 0.2700
Columns 29 through 35
Columns 36 through 42
Columns 43 through 49
Columns 50 through 56
Columns 57 through 63
Columns 64 through 70
Columns 71 through 77
Columns 78 through 84
Columns 85 through 91
Columns 92 through 98
x =
Columns 1 through 7
Columns 8 through 14
Columns 15 through 21
-0.8443 -0.5878 -0.2487 0.1253 0.4818 0.7705 0.9511
Columns 22 through 28
Columns 29 through 35
Columns 36 through 42
Columns 43 through 49
Columns 50 through 56
Columns 57 through 63
Columns 64 through 70
Columns 71 through 77
Columns 78 through 84
Columns 85 through 91
Columns 92 through 98
n =
Columns 1 through 7
Columns 8 through 14
Columns 15 through 21
Columns 22 through 28
0.2100 0.2200 0.2300 0.2400 0.2500 0.2600 0.2700
Columns 29 through 35
Columns 36 through 42
Columns 43 through 49
Columns 50 through 56
Columns 57 through 63
Columns 64 through 70
Columns 71 through 77
Columns 78 through 84
Columns 85 through 91
Columns 92 through 98
x =
Columns 1 through 7
Columns 8 through 14
Columns 15 through 21
0.5358 0.8090 0.9686 0.9921 0.8763 0.6374 0.3090
Columns 22 through 28
Columns 29 through 35
Columns 36 through 42
Columns 43 through 49
Columns 50 through 56
Columns 57 through 63
Columns 64 through 70
Columns 71 through 77
Columns 78 through 84
Columns 85 through 91
Columns 92 through 98
D =
xd =
1 3 5 7
Upsampling
L=2
X=[1,2,3,4,5,6,7,8]
XL=upsample(X,L)
L =
X =
1 2 3 4 5 6 7 8
XL =
Columns 1 through 13
1 0 2 0 3 0 4 0 5 0 6 0 7
Columns 14 through 16
0 8 0
Interpolation
x=1:25;
L=2;
xL=upsample(x,L)
xd=interp(x,L)
subplot(2,2,1)
stem(x)
title('Orignal Signal')
subplot(2,2,2)
stem(xL)
title('Upsample Signal')
subplot(2,2,[3,4])
stem(xd)
title('Interpolated signal')
xL =
Columns 1 through 13
1 0 2 0 3 0 4 0 5 0 6 0 7
Columns 14 through 26
0 8 0 9 0 10 0 11 0 12 0 13 0
Columns 27 through 39
14 0 15 0 16 0 17 0 18 0 19 0 20
Columns 40 through 50
0 21 0 22 0 23 0 24 0 25 0
xd =
Columns 1 through 7
Columns 8 through 14
Columns 15 through 21
Columns 22 through 28
Columns 29 through 35
Columns 43 through 49
Column 50
25.4928
x =
1 2 3 4 5 6 7
L =
D =
xd =
X =
1 2 3 4 5 6 7 8
L =
XL =
Columns 1 through 13
1 0 0 0 0 2 0 0 0 0 3 0 0
Columns 14 through 26
0 0 4 0 0 0 0 5 0 0 0 0 6
Columns 27 through 39
0 0 0 0 7 0 0 0 0 8 0 0 0
Column 40
D =
xd =
1 2 3 4 5 6 7 8
y =
1 2 3 4 5 6 7 8
X==y
Down sample by 5 and upsample by 5 and verify x is not equal to 5
X=[1,2,3,4,5,6,7,8,0,0]
D=5
xd=downsample(X,D)
L=5
XL=upsample(xd,5)
subplot(2,2,1)
stem(X)
title('Orignal Signal')
subplot(2,2,2)
stem(xd)
title('Upsampled Signal')
subplot(2,2,[3,3])
stem(XL)
title('Downsample Signal')
y=XL
if(X==y)
disp('X==y')
else
disp('not same')
end
X =
1 2 3 4 5 6 7 8 0 0
D =
5
xd =
1 6
L =
XL =
1 0 0 0 0 6 0 0 0 0
y =
1 0 0 0 0 6 0 0 0 0
not same
X =
Columns 1 through 13
1 2 3 4 5 6 7 8 9 10 11 12 13
Columns 14 through 20
14 15 16 17 18 19 20
L =
20
XL =
Columns 1 through 13
1 0 0 0 0 0 0 0 0 0 0 0 0
Columns 14 through 26
0 0 0 0 0 0 0 2 0 0 0 0 0
Columns 27 through 39
0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 40 through 52
0 3 0 0 0 0 0 0 0 0 0 0 0
Columns 53 through 65
0 0 0 0 0 0 0 0 4 0 0 0 0
Columns 66 through 78
0 0 0 0 0 0 0 0 0 0 0 0 0
Columns 79 through 91
0 0 5 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 6 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 7 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 8 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 9 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 10 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 11 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 12
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 13 0 0 0 0 0 0
14 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 15 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 16 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 17 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 18 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 19 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 20 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0
D =
xd =
Columns 1 through 13
1 0 0 0 2 0 0 0 3 0 0 0 4
Columns 14 through 26
0 0 0 5 0 0 0 6 0 0 0 7 0
Columns 27 through 39
0 0 8 0 0 0 9 0 0 0 10 0 0
Columns 40 through 52
0 11 0 0 0 12 0 0 0 13 0 0 0
Columns 53 through 65
14 0 0 0 15 0 0 0 16 0 0 0 17
Columns 66 through 78
0 0 0 18 0 0 0 19 0 0 0 20 0
Columns 79 through 80
0 0
XD =
Columns 1 through 13
1 2 3 4 5 6 7 8 9 10 11 12 13
Columns 14 through 20
14 15 16 17 18 19 20
y =
Columns 1 through 13
1 2 3 4 5 6 7 8 9 10 11 12 13
Columns 14 through 20
14 15 16 17 18 19 20
X==y
Published with MATLAB® R2022a