Você está na página 1de 9

PRACTICAS

DE LABORATORIO

INTRODUCTORIAS

EN ENTORNO MATLAB

PARA TRATAMIENTO

DISCRETO

Seales Digitales en MATLAB


PRCTICA 1 Tema: Las seales bsicas Planteamiento del problema: Generar las funciones bsicas como el impulso unitario, escaln unitario, rampa, exp, el sen, y cos y mostrar la salida en la pantalla. Descripcin: El Impulso unitario o la muestra unitaria se define por la relacin u0 (n) =0 =1 n0 n=0

La secuencia de Escaln Unitario se define como u (-1) (n) = 1 n 0 =0 n <0

La funcion rampa Unitaria se define por, r (n) = N, = 0, n0 n <0

La funcin exponencial se define por, x (n) = a n = 0, n 0 n <0

La funcin seno se define por, y = sen (), donde es un ngulo. L a funcin del coseno se define por, y = cos (), donde es un ngulo.

Funciones del MATLAB:


stem(x,y) Plots x versus the columns y. x and y are vectors or matrices of same size. zeros(m,n) Returns an m-by-n matrix of zeros ones(m,n) Returns an m-by-n matrix of ones exp(x)
DOCENTE: ING. Luis Pacheco Cribillero U.R.P: Ingeniera Mecatrnica Ingeniera de Control Digital 1

PRACTICAS

DE LABORATORIO

INTRODUCTORIAS

EN ENTORNO MATLAB

PARA TRATAMIENTO

DISCRETO

Returns the exponential for each element of X. sin(x) Returns the circular sine of the elements of X. cos(x) Returns the circular cosine of the elements of X.

Programa Fuente: clc; clear all; close all; n=input('Enter the value for n'); a=input('Enter the value for a in exponential function'); % Unit Impulse Response t=-2:1:2; %t=[-2,2] y=[zeros(1,2),ones(1,1),zeros(1,2)]; subplot(5,2,1); stem(t,y); title('UNIT IMPULSE SIGNAL'); ylabel('Amplitude'); xlabel('n'); %Unit Step Response t=-2:1:n-1; y=[zeros(1,2),ones(1,n)]; subplot(5,2,2); stem(t,y); title('UNIT STEP SEQUENCE'); ylabel('Amplitude'); xlabel('n'); %Ramp Sequence t=0:1:n-1; subplot(5,2,5); %y=[zeros(1,2) stem(t,t); title('RAMP SEQUENCE'); ylabel('Amplitude');
DOCENTE: ING. Luis Pacheco Cribillero U.R.P: Ingeniera Mecatrnica Ingeniera de Control Digital 2

PRACTICAS

DE LABORATORIO

INTRODUCTORIAS

EN ENTORNO MATLAB

PARA TRATAMIENTO

DISCRETO

xlabel('n'); %Exponential t=0:1:n-1; y=exp(a*t); subplot(5,2,6); plot(t,y); title('EXPONENTIAL SEQUENCE'); ylabel('Amplitude'); xlabel('n');

%Sine Sequence t=0:0.01:pi; y=sin(2*pi*t); subplot(5,2,9); plot(t,y); title('SINE SEQUENCE'); ylabel('Amplitude'); xlabel('n'); %Cosine Sequence t=0:0.05:pi; y=cos(2*pi*t); subplot(5,2,10); plot(t,y); plot(t,y); title('COSINE SEQUENCE'); ylabel('Amplitude'); xlabel('n');

OUTPUT: Enter the value for n 7 Enter the value for a in exponential function -0.3

DOCENTE: ING. Luis Pacheco Cribillero

U.R.P: Ingeniera Mecatrnica

Ingeniera de Control Digital

PRACTICAS

DE LABORATORIO

INTRODUCTORIAS

EN ENTORNO MATLAB

PARA TRATAMIENTO

DISCRETO

PRACTICA 2 Topico : Transformada Z

Enunciado del Problema : Calcule la transformada z de las siguientes expresiones utilizando el mtodo de fracciones parciales y mostrar la grfica de polos y ceros.

1. X(z) = z-1/pow((z-0.7071),2) 2. X(z) = pow(z,4)-1/pow(z,4)+1 3. X(z)= pow(z,3)-pow(z,2) + z-1/pow((z+0.9),3)

Description:

La transformada z de una seal x (n) tiempo discreto se define como la serie de potencias. n=- X(z) = x(n) z-n n= donde Z es una variable compleja.
DOCENTE: ING. Luis Pacheco Cribillero U.R.P: Ingeniera Mecatrnica Ingeniera de Control Digital 4

PRACTICAS

DE LABORATORIO

INTRODUCTORIAS

EN ENTORNO MATLAB

PARA TRATAMIENTO

DISCRETO

MATLAB functions

residuez(b,a) Encuentra los residuos, los polos, y trminos directos de una expansin de fracciones parciales de la relacin de dos polinomios, b (z) y a (Z). Los Vectores a y b y especifican los coeficientes de los polinomios del sistema b(z) / a (z) en tiempo discreto en potencias descendentes de z. roots(c) Devuelve un vector columna cuyos elementos son las races del polinomio c. El vector Fila c contiene los coeficientes de un polinomio, ordenado en potencias descendentes. zplane(B,A) B y A son vectores fila que contiene la funcin de transferencia de los coeficientes del polinomio y representa los polos y ceros de B (z) / A (z). Ntese que si B y A son ambos escalares sern interpretados como Z y P.

Source Program clc; clear all;close all; b = [1 -1]; a = [1 -(2*0.7071) ((0.7071)^2)]; [r,p,k] = residuez(b,a); r = roots(b); zplane(r,p); axis([-1.5 1.5 -1.5 1.5]) title('Pole-Zero Plot of X(z) = (z - 1)/(z - 0.7071)^2'); %Numerator Coefficients %Denominator Coefficients

b = [1 0 0 0 -1]; a = [1 0 0 0 1]; [r,p,k] = residuez(b,a); r = roots(b); figure; zplane(r,p); axis([-1.5 1.5 -1.5 1.5])

%Numerator Coefficients %Denominator Coefficients

title('Pole-Zero Plot of X(z) = (z^4 - 1)/(z^4 + 1)');

b = [1 -1 1 -1];
DOCENTE: ING. Luis Pacheco Cribillero

%Numerator Coefficients
U.R.P: Ingeniera Mecatrnica Ingeniera de Control Digital 5

PRACTICAS

DE LABORATORIO

INTRODUCTORIAS

EN ENTORNO MATLAB

PARA TRATAMIENTO

DISCRETO

a = [1 2.7 2.43 0.729]; [r,p,k] = residuez(b,a); r = roots(b); figure; zplane(r,p); axis([-1.5 1.5 -1.5 1.5])

%Denominator Coefficients

title('Pole-Zero Plot of X(z) = (z^3 - z^2 + z - 1) / (z + 0.9)^3');

OUTPUT:

PRACTICAL 3 Topic : N-DFT Problem Statement: Compute the N-point DFT of the following.Vary the value of N and visualize the effect with N=8, 16, 24, 64,128,256

1. S(n) = 3 * pow(e(-0.1*n),1) 2. S(n) = 2 * cos( 2 * pi* (0.15) * n) + sin(2 * pi * (0.4) * n)


DOCENTE: ING. Luis Pacheco Cribillero U.R.P: Ingeniera Mecatrnica Ingeniera de Control Digital 6

PRACTICAS

DE LABORATORIO

INTRODUCTORIAS

EN ENTORNO MATLAB

PARA TRATAMIENTO

DISCRETO

3. S(n) = 4 * sin ( 4* pi * (0.4) * n) + sin( 2 * pi * (0.2) * n)

Description

The Discrete Fourier Transform (DFT) computes the values of the z-transform for evenly spaced points around the unit circle for a given sequence.

MATLAB functions

fft(X,n) Returns the n-point DFT. If the length of X is less than n, X is padded with trailing zeros to length n. If the length of X is greater than n, the sequence X is truncated. When X is a matrix, the length of the columns is adjusted in the same manner.

length(X) Returns the size of the longest dimension of X. If X is a vector, this is the same as its length.

Source Program clc; clear all; close all; N=input('Enter value for N'); t=0:1:N-1; len=length(t); for n=1:len, x1(n)=3*power(exp(-0.1*t(n)),1); x2(n)=2* cos(2*pi*(0.15)*t(n))+sin(2*pi*(0.4)*t(n)); x3(n)=4*sin(4*pi*(0.4)*t(n))+sin(2*pi*(0.2)*t(n)); end t1=fft(x1,N); t2=fft(x2,N); t3=fft(x3,N); figure; stem(t,t1); title(N DFT of x1(n)=3*power(exp(-0.1*t(n)),1)); figure;
DOCENTE: ING. Luis Pacheco Cribillero U.R.P: Ingeniera Mecatrnica Ingeniera de Control Digital 7

PRACTICAS

DE LABORATORIO

INTRODUCTORIAS

EN ENTORNO MATLAB

PARA TRATAMIENTO

DISCRETO

stem(t,t2); title(N DFT of x2(n)=2* cos(2*pi*(0.15)*t(n))+sin(2*pi*(0.4)*t(n))); figure; stem(t,t3); title(N DFT of x3(n)=4*sin(4*pi*(0.4)*t(n))+sin(2*pi*(0.2)*t(n)));

OUTPUT:

DOCENTE: ING. Luis Pacheco Cribillero

U.R.P: Ingeniera Mecatrnica

Ingeniera de Control Digital

PRACTICAS

DE LABORATORIO

INTRODUCTORIAS

EN ENTORNO MATLAB

PARA TRATAMIENTO

DISCRETO

DOCENTE: ING. Luis Pacheco Cribillero

U.R.P: Ingeniera Mecatrnica

Ingeniera de Control Digital

Você também pode gostar