Professional Documents
Culture Documents
Cdigo matlab:
n=[-3,-2,-1,0,1,2,3,4]; x1=[3,4,7,0,-3,-4,-7,4];
stem(n,x1)
8
6
4
2
0
-2
-4
-6
-8
-3
-2
-1
[ ]
Cdigo matlab:
n=[-7,-6,-5,-4,-3,-2,-1,0,1]; x=[2,-2,0,-1,-2,7,5,7,3];
stem(n,x)
7
6
5
4
3
2
1
0
-1
-2
-7
-6
-5
-4
-3
-2
-1
[ ]
Cdigo matlab:
n=[-1,0,1,2,3,4,5,6,7,8]; x=[3,2,-2,-1,2,-3,2,1,-1,-2];
stem(n,x)
3
-1
-2
-3
-1
[ ]
Cdigo Matlab
n = [-5:5]; x = (1/9)*[(n) == 0];
stem(n,x)
0.12
0.1
0.08
0.06
0.04
0.02
0
-5
-4
-3
-2
-1
[ ]
Cdigo matlab:
k=9;
n = [0:20]; x = k*[(n-k) == 0];
stem(n,x)
9
8
7
6
5
4
3
2
1
0
10
[ ]
12
14
Cdigo matlab
k=9;
n = [-20:0]; x = -k*[(n+k) == 0];
stem(n,x)
0
-1
-2
-3
-4
-5
-6
-7
-8
-9
-20
-18
-16
-14
-12
-10
-8
-6
-4
-2
16
18
20
[ ]
[ ]
[ ]
[ ]
Cdigo matlab:
k=9;
n = [-10:10];
x4=(1/k)*[(n) == 0];
x5 = k*[(n-k) == 0];
x6 = -k*[(n+k) == 0];
xA=x4+x5+x6;
stem(n,xA)
10
8
6
4
2
0
-2
-4
-6
-8
-10
-10
-8
-6
-4
-2
Escaln Unitario
[ ]
Cdigo matlab:
k=9;
n1=0; n2=20; n0=0;
n = [n1:n2]; x = (k^-1)*[(n-k) >= 0];
stem(n,x)
10
0.12
0.1
0.08
0.06
0.04
0.02
[ ]
10
[ ]
12
14
16
18
20
Cdigo de matlab:
k=9;
n1=-5; n2=15; n0=0;
n = [n1:n2]; x = k*[(n) >= 0]-k*[(n-k) >= 0];
stem(n,x)
9
8
7
6
5
4
3
2
1
0
-5
10
15
[ ]
[ ]
[ ]
Codigo de matlab:
k=9;
n1=-5; n2=15; n0=0;
n = [n1:n2];
x7 = (k^-1)*[(n-k) >= 0];
x8 = k*[(n) >= 0]-k*[(n-k) >= 0];
xB=x7-x8;
stem(n,xB)
1
0
-1
-2
-3
-4
-5
-6
-7
-8
-9
-5
10
15
x 10
0
0
0.5
1.5
[ ]
2.5
3.5
4.5
Codigo de matlab:
k=9;
n = [-15:15]; x = (k.^n).*([(n+k) >= 0]-[(n-k) >= 0]);
stem(n,x)
4.5
x 10
4
3.5
3
2.5
2
1.5
1
0.5
0
-15
-10
-5
10
15
Secuencia Sinusoidal
Para el intervalo 0<=n<=24
[ ]
Explique el por qu del nmero de muestras en un ciclo completo de la funcin coseno en
[ ].
Codigo matlab:
k=9;
n = [0:24]; x = k*cos(pi*n/4);
stem(n,x)
10
8
6
4
2
0
-2
-4
-6
-8
-10
10
15
20
25
una ciclo completo de la funcin coseno, y sto se da cuando n=8, es decir, obtenemos un
ciclo completo de la funcin coseno con 8 muestras como se puede apreciar en la grfica.
[ ]
Explique el por qu del nmero de muestras en un ciclo completo de la funcin coseno en
[ ] y por qu su valor en n=0 es diferente de k.
Cdigo matlab
k=9;
n = [0:24]; x = k*cos((pi*n/8)+pi/2);
stem(n,x)
10
8
6
4
2
0
-2
-4
-6
-8
-10
10
15
20
25
Igual al anlisis para la grfica anterior, obtenemos un ciclo completo de la funcin coseno
cuando
[ ]
Cdigo matlab:
k=9;
n = [-10:10]; x = [(n+2) == 0]+2*[(n+1) == 0]+k*[(n) == 0]2*[(n-1) == 0]-[(n-2) == 0];
stem(n,x)
10
-2
-10
[ ]
-8
-6
-4
-2
[ ]
10
Codigo matlab:
k=9;
n = [-10:10]; x = -2*[(n+3) == 0]-4*[(n+4) == 0]-k*[(n) ==
0]+4*[(n-3) == 0]-3*[(n-4) == 0];
stem(n,x)
-2
-4
-6
-8
-10
-10
-8
-6
-4
-2
10
[ ]
Para x14:
k=9;
n = [-10:10]; x = -2*[(n+3) == 0]-4*[(n+4) == 0]-k*[(n) ==
0]+4*[(n-3) == 0]-3*[(n-4) == 0];
Ex = sum(abs(x) .^ 2)
Ex=126
Cdigo matlab:
1- n1=-10; n2=10; N=5;
2- n=[n1:n2];
3- tri=[abs(n)<=N].*[1-abs(n)/N];
4- stem(n,tri)
1
0.9
0.8
0.7
0.6
0.5
0.4
0.3
0.2
0.1
0
-10
-8
-6
-4
-2
10
N=7
1
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0
-10
0.1
-8
-6
-4
-2
10
0
-10
-8
-6
-4
-2
10
N=8
0.9
0.9
0.8
0.8
0.7
0.7
0.6
0.6
0.5
0.5
0.4
0.4
0.3
0.3
0.2
0.2
0.1
0.1
0
-10
-8
-6
-4
-2
10
0
-20
-15
-10
-5
10
15
20