# Orthogonality using MATLAB

See attachment for full problem description.

w=2πf

t = n/256 (t goes from 0 to 1 in increments of 1/256)

x(t)= cos wt frequency= 2Hz

y(t)= cos wt frequency= 16Hz

When you need to find the dot product of two vectors x and y which will be equivalent to the inner product of the two functions x(t) and y(t):

then use xy = x*y' in MATLAB

This operation is equivalent to the matrix operation xyT, in which each element of x is multiplied by each element of y and the products are summed. The resultant value xy is a scalar. The corresponding inner product for x(t) and y(t) is

This corresponds roughly to the dot product when you think of the integration as a summation of sampled functions. The integration limits will depend upon extent of support of the functions x(t) and y(t), i.e., the integral will cover those times when both functions are non-zero.

(1) What is the value for xy?

(2) Are the two arrays x and y orthogonal?

(3) Are the two corresponding functions {x(t) and y(t)} orthogonal?

(4) Compute x(t) and y(t) using the above formula

(5) Find a function x1(t) which is orthogonal to x(t) and has the same frequency as x(t). Create the corresponding MATLAB array x1 and verify computationally (in MATLAB) that x1 is orthogonal to x.

#### Solution Summary

It investigates orthogonality using MATLAB. The solution is detailed and was rated '5/5' by the student who originally posted the questions.