so i am getting the answer 100 times bigger than it shoud , as the true peak is 0.6366 and not 63.66 , how to fix or whats the problem ? thanks
%here is my code:
clear;
close all;
%%X(t)
dt=0.01;t = [-10: dt: 10];x = zeros(1,length(t));for i = 1 : length(t) if t(i) >=0 && t(i) <= 2 x(i) = sin( pi * t(i) ) ; end %if
end %for
figure plot(t,x);title('x(t)') xlabel('t')ylabel('x(t)')%% Define h(t)
h = zeros(1,length(t));for i = 1 : length(t) if t(i) >=-8 && t(i) <=-3 h(i) = 1 ; end %if end %for figure plot(t,h, '.');title('h(t)') xlabel('t')ylabel('h(t)')%%define y
y = conv(x,h, 'same');figure plot(t,y);title('y(t)') xlabel('t')ylabel('y(t)')
Best Answer