Prévia do material em texto
1 Atividade Prática Sinais e Sistemas Resumo: Este relatório descreve a resolução das questões propostas na Atividade Prática de Sinais e Sistemas. SOLUÇÃOES DAS QUESTÕES ATIVIDADE 1 RU1 RU2 RU3 RU4 RU5 RU6 RU7 0 0 0 0 0 0 0 a1 1,5 b1 3,5 c1 0,3 d1 0,1 e1 0,5 Questão 1. // Gerar o vetor t de zero a 2*pi com intervalo de 0,01 t = 0:0.01:2*%pi; // Definir os valores dos parâmetros a1 = 1.5; b1 = 3.5; c1 = 0.3; d1 = 0.1; 2 e1 = 0.5; // Definir as funções x = cos(a1 * %pi / 6 * t) + 2 * sin(a1 * %pi / 6 * t); y = b1 * sin(%pi / 6 * t) + 2^(-b1 * t); v = exp(c1 * t); w = 2^(-d1 * t) .* sin(e1 * t); // Plotar todas as funções na mesma figura usando subplot: subplot(221); plot(t, x); title('x(t)'); xlabel('t'); ylabel('amplitude'); subplot(222); plot(t, y); title('y(t)'); xlabel('t'); ylabel('amplitude'); subplot(223); plot(t, v); title('v(t)'); xlabel('t'); ylabel('amplitude'); subplot(224); plot(t, w); title('w(t)'); xlabel('t'); ylabel('amplitude'); 3 Questão 2. // Definindo os valores de ru1 a ru7 ru1=0; 4 ru2=0; ru3=0; ru4=0; ru5=0; ru6=0; ru7=0; // Gerando o vetor t de zero a 2*pi com intervalo de 0,01 t = 0:0.01:2*%pi; // Definindo as funções x1 = ru1 * cos(t); x2 = (ru2/3) * sin(2 * t); x3 = (ru3/6) * cos(3 * t); x4 = (ru4/9) * sin(4 * t); x5 = (ru5/12) * cos(5 * t); x6 = (ru6/15) * sin(6 * t); x7 = (ru7/18) * cos(7 * t); // Soma das funções h = x1 + x2 + x3 + x4 + x5 + x6 + x7; // Plotando as funções individuais e a soma no mesmo gráfico clf; plot(t, x1, 'r', t, x2, 'g', t, x3, 'b', t, x4, 'm', t, x5, 'c', t, x6, 'y', t, x7, 'k', t, h, 'LineWidth', 2); title('Sinais Somados'); xlabel('t'); ylabel('Amplitude'); legend('x1', 'x2', 'x3', 'x4', 'x5', 'x6', 'x7', 'h'); 5 ATIVIDADE 2 // Passo 1: Gerar o vetor n de -10 a 10 com intervalo de 1 n = -10:1:10; // Passo 2: Definir as funções x[n], y[n] e z[n] RU1 = 0; RU2 = 0; RU3 = 0; RU4 = 0; RU5 = 0; RU6 = 0; RU7 = 0; a2 = 6; b2 = 0.6; // Função x[n] x = zeros(1, length(n)); x((n == RU1) | (n == RU2) | (n == RU3)) = 1; x((n == -RU4) | (n == -RU5) | (n == -RU6) | (n == -RU7)) = -1; // Função y[n] u_RU1 = (n >= RU1); u_8 = (n >= 8); y = (2 - b2 * n .* sin(0.3 * n)) .* (u_RU1 - u_8); 6 // Função z[n] z = zeros(1, length(n)); for i = 1:length(n) if (n(i) >= -RU1 && n(i) <= a2) index = i + a2; if (index >= 1 && index <= length(n)) z(i) = x(index) - x(i); end end end // Passo 3: Calcular as funções o[n], p[n] e q[n] o = x + y + z; p = x - y .* z; q = x .* (y + z); // Passo 4: Plotar os gráficos na mesma figura usando subplot subplot(321) plot2d3(n, x, style = 1) title("x(n)") ylabel("Amplitude") xlabel("n") xstring(n($), x($), 'x(n)', 'left') subplot(322) plot2d3(n, y, style = 2) title("y(n)") ylabel("Amplitude") xlabel("n") xstring(n($), y($), 'y(n)', 'left') subplot(323) plot2d3(n, z, style = 3) title("z(n)") ylabel("Amplitude") xlabel("n") xstring(n($), z($), 'z(n)', 'left') subplot(324) plot2d3(n, o, style = 4) title("o(n)") ylabel("Amplitude") xlabel("n") xstring(n($), o($), 'o(n)', 'left') subplot(325) plot2d3(n, p, style = 5) title("p(n)") ylabel("Amplitude") 7 xlabel("n") xstring(n($), p($), 'p(n)', 'left') subplot(326) plot2d3(n, q, style = 6) title("q(n)") ylabel("Amplitude") xlabel("n") xstring(n($), q($), 'q(n)', 'left')