Advertisement
Ostu

Untitled

May 5th, 2021
375
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MatLab 0.21 KB | None | 0 0
  1. h=[-1, 3, 4, 2]
  2. x=[1, 3, -1, 2, 5]
  3. y=conv(x,h)
  4. H=numel(h)
  5. X=numel(odx)
  6. C=H+X-1
  7. Y=0*(1:C)
  8. x = [x,0*(1:(C-X))]
  9. h = [h,0*(1:(C-H))]
  10. for n=0:C-1
  11.     for k=0:n
  12.        Y(1+n)=Y(1+n)+x(1+k)*h(1+n-k)
  13.     end
  14. end
  15.  
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement