Signals Processing convolution graph
1 view (last 30 days)
Show older comments
conv(x(t),&(t+t0) what is the eqaul of this equation and how can i plot this equation's graph?
0 Comments
Answers (1)
Ganapathi Subramanian
on 25 Apr 2023
Hi Emir,
It is my understanding that you are working on convolution and want to know how to perform convolution on time shifted signal [x(t)*x(t+t0)] and plot the graph. Below is the code to perform convolution for time shifted signal.
% Time step to make it a continuous signal
step=0.01;
t=-10:step:10;
% Let the input be a unit step signal
% x(t)
x=t>=0;
subplot(3,1,1);
plot(t,x);
% Let t0 be the value of time shift
% x(t+t0)
% Let t0 be 5
t0=5;
% Time shifted signal => x(t+t0) = x1(t1)
t0=-t0;
if(t0>0)
t1=t(1):step:t(end)+t0;
x1=[zeros(1,t0/step) x];
mini=t(1);
maxi=t1(end);
else
t1=t(1)+t0:step:t(end);
x1=[x zeros(1,abs(t0)/step)];
mini=t1(1);
maxi=t(end);
end
subplot(3,1,2);
plot(t1,x1);
% Convolution of x(t) and x(t+t0)
y=conv(x,x1);
% ty is the variable scale that matches length(y) with the time of input signal
ty=mini:(maxi-mini)/(length(y)-1):maxi;
% Plot the convolution result
subplot(3,1,3);
plot(ty,y);
0 Comments
See Also
Categories
Find more on Spectral Measurements in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!