Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Do in MATLAB!. Please provide a detailed working code! simplified_convolution_ru

ID: 2249293 • Letter: D

Question

Do in MATLAB!. Please provide a detailed working code!

simplified_convolution_runtime.m:

close all

clear all

clc

%% signal: x, impulse response: h

x1=@(t) 2*(t>=0 & t<3);

h=@(t) 3*(exp(-t/5).*sin(2*t)).*(t>=3);

%

dtau = 0.1;

tau = -10:dtau:40;

dT=0.5;

t = -10:dT:40;

%%

figure (1)

y1 = NaN(1, length (t));

for ii=1:length(t) % evaluating integration of x(tau)*h(t-tau)

x1h = h(t(ii)-tau).*x1(tau);

y1(ii)=trapz(tau,x1h);

  

% plotting

subplot (211)

plot(tau, x1(tau), 'k-', tau, h(t(ii)-tau), 'b--', t(ii), 0, 'ok');

xlabel(' au');

legend('x1( au)','h(t- au)');

  

subplot (212)

plot (t, y1, 'k', t (ii), y1(ii), 'ok');

xlabel ('t'); ylabel ('y1(t) = int x1( au)h(t- au) d au');

drawnow;

  

end

At dt at 2. Consider the following input signal 5, 0

Explanation / Answer

simplified_convolution_runtime.m:
close all
clear all
clc
%% signal: x, impulse response: h
x1=@(t) 2*(t>=0 & t<3);
h=@(t) 3*(exp(-t/5).*sin(2*t)).*(t>=3);
%
dtau = 0.1;
tau = -10:dtau:40;
dT=0.5;
t = -10:dT:40;
%%
figure (1)
y1 = NaN(1, length (t));
for ii=1:length(t) % evaluating integration of x(tau)*h(t-tau)
x1h = h(t(ii)-tau).*x1(tau);
y1(ii)=trapz(tau,x1h);
  
% plotting
subplot (211)
plot(tau, x1(tau), 'k-', tau, h(t(ii)-tau), 'b--', t(ii), 0, 'ok');
xlabel(' au');
legend('x1( au)','h(t- au)');
  
subplot (212)
plot (t, y1, 'k', t (ii), y1(ii), 'ok');
xlabel ('t'); ylabel ('y1(t) = int x1( au)h(t- au) d au');
drawnow;
  
end

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote