Está en la página 1de 9

UNAPEC

DECANATO DE CIENCIAS E INGENIERÍAS


LABORATORIO PROCESAMIENTO DIGITAL DE SEÑALES I
TEC-604
ILUSTRACIÓN CONCEPTOS DEL FILTRADO
ASIGNACIÓN No.7(2DO. PARCIAL)
JOSE OSVALDO RODRIGUEZ SEPULVEDA A00103781

clf;
N=300;
n=0:N-1;
x1 = cos(2*pi*10*n/256);
x2 = cos(2*pi*100*n/256);
x = x1 + x2;
%*********************************************************************
*****
% Modify Program P2_9AA by changing the input sequence to a swept
% sinusoidal sequence (length 301, minimum frecuency 0, and maximum
% frecuency pi)

% w= 2an + b= 0 y n=0 → b=0 y; w= 2a(300) = pi


% → a=pi/(600);

%N=301;
%n=0:N-1;
%a= pi/600;
%b=0;
%arg = a*n.^2 + b*n;
%x = cos(arg);
%*********************************************************************
*****

% Compute the output sequences


num1 = [0.5 0.27 0.77];
y1 = filter(num1,1,x);% Output the System No. 1
den2 = [1 -0.53 0.46];
num2 = [0.45 0.5 0.45];
UNAPEC
DECANATO DE CIENCIAS E INGENIERÍAS
LABORATORIO PROCESAMIENTO DIGITAL DE SEÑALES I
TEC-604
ILUSTRACIÓN CONCEPTOS DEL FILTRADO
ASIGNACIÓN No.7(2DO. PARCIAL)
y2 = filter(num2,den2,x);% Output the System No. 2
% Plot the output sequences
subplot(211);
plot(n,y1); axis([0 300 -3 3]);xlabel('Time index n');
ylabel('Amplitude');
title('Output of System No.1'); grid;
subplot(212);
plot(n,y2); axis([0 300 -3 3]);xlabel('Time index n');
ylabel('Amplitude');
title('Output of System No.2'); grid;

SOLUTION:
UNAPEC
DECANATO DE CIENCIAS E INGENIERÍAS
LABORATORIO PROCESAMIENTO DIGITAL DE SEÑALES I
TEC-604
ILUSTRACIÓN CONCEPTOS DEL FILTRADO
ASIGNACIÓN No.7(2DO. PARCIAL)
Q2.34

• El filtro con mejores características para la supresión de las altas frecuencias es el


Sistema #2.
UNAPEC
DECANATO DE CIENCIAS E INGENIERÍAS
LABORATORIO PROCESAMIENTO DIGITAL DE SEÑALES I
TEC-604
ILUSTRACIÓN CONCEPTOS DEL FILTRADO
ASIGNACIÓN No.7(2DO. PARCIAL)
Q 2.35

clf;
x1 = cos(2*pi*10*n/256);
x2 = cos(2*pi*100*n/256);
x = x1 + x2;
%*********************************************************************
*****
% Modify Program P2_9AA by changing the input sequence to a swept
% sinusoidal sequence (length 301, minimum frecuency 0, and maximum
% frecuency pi)
% w= 2an + b= 0 y n=0 ? b=0 y; w= 2a(300) = pi
% ? a=pi/(600);
N=301;
n=0:N-1;
a= pi/600;
b=0;
arg = a*n.^2 + b*n;
x = cos(arg);
% Compute the output sequences
num1 = [0.5 0.27 0.77];
y1 = filter(num1,1,x);% Output the System No. 1
den2 = [1 -0.53 0.46];
num2 = [0.45 0.5 0.45];
y2 = filter(num2,den2,x);% Output the System No. 2
% Plot the output sequences
subplot(211);
plot(n,y1); axis([0 300 -3 3]);xlabel('Time index n');
ylabel('Amplitude');
title('Output of System No.1'); grid;
subplot(212);
plot(n,y2); axis([0 300 -3 3]);xlabel('Time index n');
ylabel('Amplitude');
title('Output of System No.2'); grid;
UNAPEC
DECANATO DE CIENCIAS E INGENIERÍAS
LABORATORIO PROCESAMIENTO DIGITAL DE SEÑALES I
TEC-604
ILUSTRACIÓN CONCEPTOS DEL FILTRADO
ASIGNACIÓN No.7(2DO. PARCIAL)

• El filtro con mejores características para la supresión de las altas frecuencias


componente de la señal de entrada x[n] es el Sistema #2.
UNAPEC
DECANATO DE CIENCIAS E INGENIERÍAS
LABORATORIO PROCESAMIENTO DIGITAL DE SEÑALES I
TEC-604
ILUSTRACIÓN CONCEPTOS DEL FILTRADO
ASIGNACIÓN No.7(2DO. PARCIAL)

Project 2.7 Convolution


The convolution operation of Eq. (2.5) is implemented in MATLAB by the command conv,
provided the two sequences to be convolved are of finite length. For example, the output
sequence of an FIR system can be computed by convolving its impulse response with a given
finite-length input sequence. The following MATLAB program illustrates this approach.

y[n] = h[n]∗ x[n], (2.5)

% Program P2_7
clf;
h = [3 2 1 -2 1 0 -4 0 3]; % impulse response
x = [1 -2 3 -4 3 2 1]; % input sequence
y = conv(h,x);
n = 0:14;
subplot(2,1,1);
stem(n,y);
xlabel('Time index n'); ylabel('Amplitude');
title('Output Obtained by Convolution');grid;
x1 = [x zeros(1,8)];
y1 = filter(h,1,x1);
subplot(2,1,2);
stem(n,y1);
xlabel('Time index n'); ylabel('Amplitude')
title('Output Generated by Filtering');grid;
d = y-y1;
figure;stem(d);
title('diference d');grid

Questions:

Q2.28 Run Program P2 7 to generate y[n] obtained by the convolution of the sequences
h[n] and x[n], and to generate y1[n] obtained by filtering the input x[n] by the FIR
filter h[n]. Is there any difference between y[n] and y1[n]? What is the reason for using
x1[n] obtained by zero-padding x[n] as the input for generating y1[n]?

Q2.29 Modify Program P2 7 to develop the convolution of a length-15 sequence h[n]


with a length-10 sequence x[n], and repeat Question Q2.28. Use your own sample values
for h[n] and x[n].

SOLUTION:
UNAPEC
DECANATO DE CIENCIAS E INGENIERÍAS
LABORATORIO PROCESAMIENTO DIGITAL DE SEÑALES I
TEC-604
ILUSTRACIÓN CONCEPTOS DEL FILTRADO
ASIGNACIÓN No.7(2DO. PARCIAL)
Q 2.28

• No hay diferencia en el resultado obtenido por el filtrado y por la convolución. Ya que


la grafica de diferencia es igual a 0
• La razón para usar x1[n] como entrada, obtenida mediante el relleno con ceros de x[n],
para generar y1[n] es: para dos secuencias de longitud N1 y N2, el comando conv
devuelve la secuencia resultante de longitud N1+N2- 1. Por el contrario, el filtro acepta
una señal de entrada y una especificación del sistema. El resultado devuelto tiene la
misma longitud que la señal de entrada.
UNAPEC
DECANATO DE CIENCIAS E INGENIERÍAS
LABORATORIO PROCESAMIENTO DIGITAL DE SEÑALES I
TEC-604
ILUSTRACIÓN CONCEPTOS DEL FILTRADO
ASIGNACIÓN No.7(2DO. PARCIAL)
Q 2.29

% Program P2_7
clf;
h = [5 9 -6 2 0 4 3 2 1 -2 1 0 -4 0 3]; % impulse response
x = [6 2 -8 1 -2 3 -4 3 2 1]; % input sequence
y = conv(h,x);
n = 0:23;
subplot(2,1,1);
stem(n,y);
xlabel('Time index n'); ylabel('Amplitude');
title('Output Obtained by Convolution');grid;
x1 = [x zeros(1,14)];
y1 = filter(h,1,x1);
subplot(2,1,2);
stem(n,y1);
xlabel('Time index n'); ylabel('Amplitude')
title('Output Generated by Filtering');grid;
d = y-y1;
figure;stem(d);
title('diference d');grid
UNAPEC
DECANATO DE CIENCIAS E INGENIERÍAS
LABORATORIO PROCESAMIENTO DIGITAL DE SEÑALES I
TEC-604
ILUSTRACIÓN CONCEPTOS DEL FILTRADO
ASIGNACIÓN No.7(2DO. PARCIAL)

• No hay ninguna diferencia entre las gráficas de la convolución aplicada ni el filtrado,


por la cual el resultado de la diferencia es = 0

También podría gustarte