This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
DSP/TP1b/DiogoEliseuHugo_TP2_11.m

20 lines
459 B
Mathematica
Raw Normal View History

2020-10-21 01:28:09 +01:00
%% Inicialização do ambiente
clear ; close all; clc
%% Exercício 11
2020-10-24 18:20:32 +01:00
n = 0:255;
x = cos(20*pi*n/256)+cos(200*pi*n/256);
2020-10-21 01:28:09 +01:00
2020-10-24 18:20:32 +01:00
cx1 = [0.5,0.4,0.3];
y1 = filter(cx1,1,x);
2020-10-21 01:28:09 +01:00
2020-10-24 18:20:32 +01:00
cx2 = [0.4,0.5,0.4];
cy2 = [1,-0.5,0.4];
y2 = filter(cx2,cy2,x);
2020-10-21 01:28:09 +01:00
2020-10-24 18:20:32 +01:00
subplot(3,1,1),plot(n,x)
xlabel('n'),ylabel('Amplitude'),title('x[n]')
subplot(3,1,2),plot(n,y1)
xlabel('n'),ylabel('Amplitude'),title('y1[n]')
subplot(3,1,3),plot(n,y2)
xlabel('n'),ylabel('Amplitude'),title('y2[n]')