CONVOLUCION
CONVOLUCION
%% Limpiar
clc;
close all;
clear all;
%% inicializar variables:
fs = 150;
t = linspace(-8,8,fs);
ax = [-8 8 -1 8];
ax_tau = [-10 10 -1 8];
ax_conv = [-10 12 -1 30];
figure(1)
plot(t,h,'Color','blue','LineWidth',2),axis(ax);
grid on;
xlabel('\tau','FontSize', 16)
ylabel('h(\tau)','FontSize', 16)
subplot(2,2,1:2)
hold off;
plot(tau,x_tau,'Color','red','LineWidth',2),axis(ax_tau)
;
hold on;
plot(tau,h_modif,'Color','blue' ,'LineWidth',2),axis(ax_
tau);
grid on;
xlabel('\tau', 'FontSize', 16);
ylabel('h(t - \tau)', 'FontSize', 16);
subplot(2,2,3:4)
hold off
plot(tau(1:i),convolution(1:i),'Color','black','LineWidt
h',2),axis(ax_conv);
grid on;
xlabel('\tau', 'FontSize', 16);
ylabel('\int x(\tau)h(t - \tau)d\tau', 'FontSize',
16);
pause(0.01)
end
%% Convolucion:
figure(4)
plot(tau,convolution,'Color','black','LineWidth',2),axis
(ax_conv);
grid on;
xlabel('t', 'FontSize', 16);
ylabel('h(t) * x(t)', 'FontSize', 16);
%% Titulos de frames:
figure(1)
title('Señal o Función h(\tau) ');
figure(2)
title('Señal o Función x(\tau) ');
figure(4)
title('Convolución ');