0
$\begingroup$

I am studying convolution from book of alex palamides but i am confused because he uses time step(in this case 0.01) in his code for continuous convolution as shown highlighted in attached photo but he does not uses step when he perform discrete convolution

Here is his code from book for discrete convolution

% Discrete time convolution

%  x=[1,2,3,4,5],0<=n<=4
%  h=[1,2,1],-1<=n<=1




 n=-1:4;
 x=[0,1,2,3,4,5];
 h=[1,2,1,0,0,0];
 subplot(121);
 stem(n,x);
 axis([-1.1 4.1 -.1 5.1]);
 legend('x[n]')
 subplot(122);
 stem(n,h);
 axis([-1.1 4.1 -.1 5.1]);
 legend('h[n]')

 figure
 y=conv(x,h);
 stem(-2:8,y)
 axis([-2.5 8.5 -.5 16.5]);
 legend('y[n]')

enter image description here

$\endgroup$
  • $\begingroup$ hi! did you mean stem ? I can't see step in your code ? $\endgroup$ – Fat32 May 11 at 19:13
  • $\begingroup$ this is step size $\endgroup$ – Fat32 May 11 at 19:14
  • $\begingroup$ no i mean 0.01 for "step" $\endgroup$ – engr May 11 at 19:14
  • $\begingroup$ but why only we use it for continuous time? $\endgroup$ – engr May 11 at 19:15
  • 1
    $\begingroup$ As you also know, you cannot compute a continuous-time convolution using the digital computer. You have to approximate it and that step (size) is the discretization you apply to the continuous time so that cont. convolution is digitally computed... And you don't need a discretization step for an already discrete-time convolution... $\endgroup$ – Fat32 May 11 at 19:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.