% This program calculates the numerical values of q1 of ECE 633 mt 2015
clear;clc;
syms A T real %%% Defining A and T as real
assume(A > 0)  %%% Specifying A as positive
assume(T > 0)  %%% Specifying T as positive
s1t = [A -A];  %%% Defining s_1(t)
Fi1 = [sqrt(2)/sqrt(T) 0]; %%% Defining Psi_1(t)
Fi2 = [0 sqrt(2)/sqrt(T)];%%% Defining Psi_2(t)
s11 = 0.5*T*s1t*Fi1'; %%% Finding s_11 coefficient by integration
s12 = 0.5*T*s1t*Fi2'; %%% Finding s_12 coefficient by integration
%simplify([s11 s12])  %%% Simplifying
%%%% For orthogonal waveforms
s1pt = [2*A 0 0 0];s2pt = [0 2*A 0 0];s3pt = [0 0 2*A 0];s4pt = [0 0 0 2*A];
%tso = 0.25*T*s1pt*s2pt'
s1wt = [A A A A A A A A];s2wt = [A A A A -A -A -A -A];s3wt = [A A -A -A A A -A -A];
s4wt = [A -A A -A A -A A -A];
% tso = 0.125*T*s1wt*s2wt'
% tso = 0.125*T*s1wt*s3wt'
% tso = 0.125*T*s1wt*s4wt'
Psip1 = [2/sqrt(T) 0 0 0];Psip2 = [0 2/sqrt(T) 0 0];
cfo = 0.25*T*Psip1*Psip2'
epsilons = 0.25*T*Psip1*Psip1'