MATLAB Simulation For Digital Signal Processing PDF
MATLAB Simulation For Digital Signal Processing PDF
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-50
-40
-30
-20
-10
10
20
30
40
B.
Impulse Signal:
MATLAB SCRIPT:
n=-49:49;
delta=[zeros(1,49),1,zeros(1,49)];
www.ijarcce.com
5208
50
stem(n,delta)
1
0.8
1
0.6
0.9
0.4
0.8
0.2
0.7
0.6
-0.2
0.5
-0.4
0.4
-0.6
0.3
-0.8
0.2
-1
-20
0.1
0
-50
-40
-30
-20
-10
10
20
30
40
-15
-10
-5
10
15
20
50
C.
Ramp Signal
MATLAB SCRIPT:
n=0:10;
r=n;
stem(n,r)
E.
Exponential Signal
MATLAB SCRIPT
c=1; alpha=0.8; n=-10:10;
x=c*alpha.^n;
stem(n,x)
10
10
9
0
-10
D.
Sin Signal
MATLAB SCRIPT:
n=-18:18;
f=1/12;
stem(n,sin(2*pi*f*n))
Copyright to IJARCCE
-8
-6
-4
-2
10
10
5209
16
14
8
7
12
6
10
5
8
4
6
3
4
0
-3
-2
-1
0
-3
-2
-1
16
14
12
10
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0
-3
-2
-1
0.2
0.1
Copyright to IJARCCE
10
12
14
16
18
20
5210
y=filter(a,b,x,ic);
stem(n,y)
stem(nx,x);
title('Input sequence x[n]');
subplot(3,1,2);
stem(nh,h);
xlabel('Time');ylabel('Amplitude');
title('Impulse response of the system h[n]');
subplot(3,1,3);
stem(nz,z);
xlabel('Time');ylabel('Amplitude');
title('Linear Convolution');
Enter:
5
4.5
4
3.5
3
2.5
2
1.5
x[n]:[1 2 3 1];
h[n]:[1 2 1 -1];
1
0.5
0
10
12
14
16
18
20
2
0.5
1.5
2.5
1
0
1
-1
0.8
0.5
1.5
Time
Linear Convolution
2.5
3
Time
0.6
10
Amplitude
Imaginary Part
0.4
0.2
2
5
0
-0.2
-5
-0.4
-0.6
-0.8
-1
-1
-0.5
0
Real Part
0.5
5211
xlabel('Time');ylabel('Amplitud')
title('Input sequence x[n]');
subplot(3,1,2);
stem(nh,h);
xlabel('Time');ylabel('Amplitude
title('Impulse response of the system h[n]');
subplot(3,1,3);
stem(nz,z);
xlabel('Time');ylabel('Amplitude)
title('Circular Convolution');
Enter
x[n]:[2 1 2 1];
h[n]:[1 2 3 4]
VII. CONCLUSION
Fig. 12. Circular Convolution of two sequences
www.ijarcce.com
5212