0% found this document useful (0 votes)
30 views

Lab 6 Sns

This document provides a method to convolve two arbitrary length signals without using conv or for loops by using the Toeplitz command. It demonstrates convolving signals x and y, of lengths 5 and 5 respectively, by multiplying the lower triangular Toeplitz matrix of x with y flattened into a column vector, and shows it produces the same result as using conv.

Uploaded by

Irfan Haider
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Lab 6 Sns

This document provides a method to convolve two arbitrary length signals without using conv or for loops by using the Toeplitz command. It demonstrates convolving signals x and y, of lengths 5 and 5 respectively, by multiplying the lower triangular Toeplitz matrix of x with y flattened into a column vector, and shows it produces the same result as using conv.

Uploaded by

Irfan Haider
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Write a program without using conv command and for loop to convolve two

arbitrary length signals. (Hint: Use Toeplitz command).

x = 1:5,y=rand(1,5),
Answer
x =

1 2 3 4 5
y =

0.1576 0.9706 0.9572 0.4854 0.8003

c1=(tril(toeplitz(x))*y(:)).'
answer

c1 =

0.1576 1.2858 3.3712 5.9419 9.3130

c2=conv(x,y);c2=c2(1:numel(c1))

Answer
c2 =

0.1576 1.2858 3.3712 5.9419 9.3130

You might also like