Sample the signal ut 9

Sample the signal u(t) -9<t<=9 with a sampling time of 1s and store the sampled data in an array with the same name. Build the array u1 and u-1 knowing that u1(t) = u(t-1) and u-1(t) = u(t+1), respectively. Build arrays u9 to u-8 and concatenate them in one square matrix putting u9 at the very top and u-8 at the very bottom. What is the determinant of the matrix you built?

I need help setting this up on MatLab. I don\'t quite know how to start it.

Solution

Solution :

U(t) when sampled at a sampling time of 1s we get the folowing array in the interval -9< t < 9.

U= [ 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 ] i.e 8 zeros followed by 10 ones.

U1 is the array obtained by shifting U to right by one sample

U1= [ 0 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 ] i.e 9 zeros followed by 9 ones.

U1 is the array obtained by shifting U to left by one sample

U_1 = [ 0 0 0 0 0 0 0 0 1 1 1 1 1 1 1 1 1 1 ] i.e 7 zeros followed by 11 ones.

The MATLAB code for the problem description is given below

---------------------------------------------------------------------------------------------------------------

U =[zeros(1,8) ones(1,10) ];
U1=[zeros(1,9) ones(1,9) ];
U2=[zeros(1,10) ones(1,8) ];
U3=[zeros(1,11) ones(1,7) ];
U4=[zeros(1,12) ones(1,6) ];
U5=[zeros(1,13) ones(1,5) ];
U6=[zeros(1,14) ones(1,4) ];
U7=[zeros(1,15) ones(1,3) ];
U8=[zeros(1,16) ones(1,2) ];
U9=[zeros(1,17) ones(1,1) ];
U_1=[zeros(1,7) ones(1,11) ];
U_2=[zeros(1,6) ones(1,12) ];
U_3=[zeros(1,5) ones(1,13) ];
U_4=[zeros(1,4) ones(1,14) ];
U_5=[zeros(1,3) ones(1,15) ];
U_6=[zeros(1,2) ones(1,16) ];
U_7=[zeros(1,1) ones(1,17) ];
U_8=[zeros(1,0) ones(1,18) ];

M2= [U9; U8 ;U7 ; U6 ;U5; U4 ;U3 ; U2 ;U1; U ; U_1 ; U_2 ; U_3 ; U_4 ; U_5 ; U_6 ; U_7 ; U_8 ];
d2= det(M2)

------------------------------------------------------------------------------------------------------------------------------------

The ouput is

d2 =

-1

-----------------------------------------------------------------------------------------------------------------------------------

The same task can be performed efficiently using for loop where we need not define the arrays individually. It is shown below

----------------------------------------------------------------------------------------------------

t=-8:1:9;
U=[zeros(1,8) ones(1,10)];
M=zeros(18,18);
for i=1:18
M(i,:)=[zeros(1,18-i) ones(1,i)];
  
end

d=det(M)

-----------------------------------------------------------------------------------------------------------------------

The output is

d =

-1

Sample the signal u(t) -9<t<=9 with a sampling time of 1s and store the sampled data in an array with the same name. Build the array u1 and u-1 knowing th
Sample the signal u(t) -9<t<=9 with a sampling time of 1s and store the sampled data in an array with the same name. Build the array u1 and u-1 knowing th

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site