using Matlab Write code that does parts a and b and solve questions on parts c a
ID: 2083624 • Letter: U
Question
using Matlab
Write code that does parts a and b and solve questions on parts c and d for problems 1
Explain reasoning behind quesitons in 1
For Problem 1 you cannot use toeplitz function
1. (100) When the sequences x(n) and hIn) are finite duration N and Nh respectively, then their linear convolution can be implemented using matrix vector multiplication. If elements of y(n) and x n) are arranged in column vectors x and y respectively, then output can be written as Hx Where linear shifts in hCn k) for n 0, ,Nh 1 are arranged as rows in the matrix H. This matrix has an interesting structure and is called a Toeplitz matrix. To investigate this matrix, consider the sequences x (n a) Determine the linear convolution y (a) h(m) x (n) b) Express x(n) as a 4x1 column vector x and y(n) as a 6x1 column vector y. Now determine the 6 x 4 matrix H so that y Hx c) Characterize the matrix H. From this characterization can you give a definition of a Toeplitz matrix? How does this definition compare with that of time invariance? d) What can you say about the first column and the first row of H? (note: You cannot use toeplitz function in Matiab) 2. (100) Let x(n) sin (0.35TTn) 2 cos (0.45TTn). a. Generate 500 samples of x(n) b. Resample the signal x(n) by a factor of 2/5. Plot the resampled signal. (note: you need to avoid any aliasing by choosing a proper filter)Explanation / Answer
x=input('Enter the first sequence - ');
h=input('Enter the second sequence - ');
m=length(x);
n=length(h);
y=zeros(1,m+n-1);
h=[h,zeros(1,m+n-1)];
x=[x,zeros(1,m+n-1)];
cnt=0;
for i=1:1:m+n-1;
cnt=i;
for j=1:1:n
y(1,cnt)=y(1,cnt)+h(j)*x(i)
if cnt<m+n-1
cnt=cnt+1;
end
end
end
disp (y
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.