Convolution of rect pulses with impulses
7 views (last 30 days)
Hello friends i want to implement this scheme below but seems like i do something wrong cause i get wrong output.
can you help me what do i do wrong.
thanks in advance
Ts is 1, tau is 0.5s.
t=-5: Tsample :5; % time vector
Arthi Sathyamurthi on 27 Jul 2021
Edited: Arthi Sathyamurthi on 27 Jul 2021
The error “Incorrect dimensions for matrix multiplication” obtained from simulating your code occurs when the two matrices have dimensions that cannot be multiplied. Click on this link to know more about the error.
Use the following code to resolve your error and to obtain the output as intended. Replace the last 3 lines of your code with the following code
ts = -5: Tsample/2 :5; % time vector with equal number of data points as the variable s
x_interpolated = interp1(t,x,ts); % Interpolate x to have equal number of data points as s
v=s.*x_interpolated; % The .* ensures each bit is multiplied correspondingly