Professional Documents
Culture Documents
02 Signal Processing Fundamental Mathematics
02 Signal Processing Fundamental Mathematics
&
Signal Processing
Chapter 2. Fundamental Mathematics
7‐Mar‐23
In this case, we represent numbers in a list with a notation of
the form
where the symbol i is called “subscript”.
For example
x i , i = 1, 2,, 5 x 1 , x 2 , x 3 , x 4 , x 5
The first subscript refers to the row that the particular value is
in, the second subscript refers to the column.
It is also a matrix form(three row and three column)
start index
In the above expression, the i is the summation index, 1 is the
start value, N is the stop value.
The start index is not necessarily to be 1.
5 5
å xi = x1 + x 2 + x 3 + x 4 + x 5 å xi = x 3 + x 4 + x 5
i =1 i =3
The Second Constant Rule of Summation Algebra
The Distributive Rule
The Second Constant Rule of Summation Algebra
N æ ö÷ N
ç ÷
åax i = ax ax 3 + + ax N = a ççx
1 + ax 2 +
x 3 + + x N ÷ = a å x i
1 + x 2 + ÷÷
i =1 N
çè N ø i =1
The Distributive Rule
N
å (x i + yi ) = (x1 + y1 ) + (x 2 + y2 ) + + (x N + yN )
i =1
= (x1 + x 2 + + x N ) + (y1 + y2 + + yN )
N N
N N
= å x i + å yi
i =1 i =1
close all; %% close all the figure
clear; %% clear all the variable in workspace
clc; %% clear command screen
A = 5 + randn(20,1); %% add white noise
4.9209 A_sum = sum(A);
A_avg = sum(A)/length(A);
plot(A,'o')
axis([0 20 0 10])
xlabel('Sample Data')
ylabel('Values')
For the element deviation, it is defined by
N
4.9209
å[dx ]i = 0
i =1
Proof:
Recall that by definition
1 N N
x· = å xi å xi = N ⋅ x ·
N i =1 i =1
Therefore
N N N N
å[dx ]i =å[x i - x · ] = å x i - å x ·
i =1 i =1 i =1 i =1
N
= å xi - N ⋅ x ·
i =1
= N ⋅ x· - N ⋅ x· = 0
How to take a summation of these elements by using a single
notation? 3 3 3
å å x ij = å (x i 1 + x i 2 + x i 3 )
i =1 j =1 i =1
= (x 11 + x 12 + x 13 ) for i = 1
+ (x 21 + x 22 + x 23 ) for i = 2
+ (x 31 + x 32 + x 33 ) for i = 3
9 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Summation Algebra(ex.)
Take care about the location of power
n
N æ N ö
å i ¹ çççå x i ÷÷÷
x n
i =1 èi =1 ø
For example, xi = i
5
å x i2 = 12 + 22 + 32 + 42 + 52 = 55
i =1
æ 5 ö÷2
ççå x i ÷ = (1 + 2 + 3 + 4 + 5)2 = 152 = 225
çèi =1 ÷ø
Apparently 5 æ 5 ö2
å x i2 ¹ çççå x ÷÷÷
i =1 èi =1 ø
https://electronicsclub.info/acdc.htm
11 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
AC and DC signals
Alternating Current (AC) flows one way, then the other way,
continually reversing direction.
An AC voltage is continually changing between positive (+) and
negative (‐).
The rate of changing direction is called the frequency of the
AC and it is measured in hertz (Hz), which is the number of
forwards‐backwards cycles per second.
https://electronicsclub.info/acdc.htm
12 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
DC and AC signals (Ex.)
The RMS value of a function over the range [T1,T2] can be
defined as 1 T2 2
fRMS = ò ( f (t )) dt
T2 -T1 T1
The corresponding RMS can be calculated as follows
Consider x1 = x 2 = = x n Ex.
1 2 1 2
x RMS =
n
(x 1 + x 22 + + x n2 ) x RMS =
n
(x1 + x 22 + + x n2 )
1 1 2
=
n
(n ⋅x 2) =
5
( 3 + 32 + 32 + 32 + 32 )
= x2 = x 1
=
5
(5 ⋅ 32 )
RMS for a constant value serial number
= 32 = 3
is equal to its signal element
The corresponding RMS can be calculated as follows
1 2
x RMS =
n
(x1 + x 22 + + x n2 )
1 2
=
5
( 2 2
2 + (-3) + 12 + (-4) + 52 )
= 3.32
RMS Energy Averaging
16 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Root Mean Square (ex.)
RMS of a sine function : f (t ) = A sin (wt )
T Î [ 0, 2p ]
1 2p 2 2
fRMS = ò A sin (wt )dt
2p 0
A2 2 p 1
= ò (cos (wt - wt ) - cos (wt + wt ))dt
2p 0 2
product-to-sum
2
A 2p 1
= ò (cos (0) - cos (2wt ))dt
2p 0 2
A2 2 p 1
= ò (1 - cos (2wt ))dt
2p 0 2
sum-to-product
2 2p
A æç 1 1 ö÷ A
= t - sin (2 wt ) ÷÷ = = 0.707A
2p çè 2 4w ø0 2
1 T 2 2 T Î [ 0, ¥ ]
fRMS = ò A sin (wt )dt
T 0
T
A2 æç 1 1 ö÷
= T - sin (2wT )÷÷
T çè 2 4w ø0
1 2p 2
fRMS = ò est
A sin 2
(wt )dt A
2p 0
A
= est
2
Therefore
Aest = fRMS ⋅ 2
fRMS
PS: the correct way is to filter out the noise before computing .
19 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Crest Factor
Crest factor is the peak amplitude of the waveform divided by
the RMS value of the waveform:
x peak
CF =
x RMS
Crest factor is a measure of a waveform, such as alternating
current or sound, showing the ratio of peak values to the
effective value. In other words, crest factor indicates how
extreme the peaks are in a waveform.
CF =1 indicates no peaks, such as direct current(that is DC
component).
High crest factors indicate obvious peaks included in the signal.
For example, shock waves tend to have high crest factors.
20 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Crest Factor (ex.)
Consider the following two signals
Acc_RMS = 0.0158
CF_Acc = 6.4091 load A20160218_145435.txt
A = A20160218_145435(:,1);
t=1:length(A);
time = t/8192;
%%... Impulse Force
Acc_RMS = sqrt(sum(A.^2)/length(A))
CF_Acc = max(abs(A))/Acc_RMS
%%... Harmonic Vibration
y = 0.2*sin(2*pi*5*time);
y_RMS = sqrt(sum(y.^2)/length(y))
CF_y = max(abs(y))/y_RMS
figure
subplot(2,1,1)
plot(time, A)
ylabel('Impact Force(g)')
subplot(2,1,2)
plot(time,y)
y_RMS = 0.1414 xlabel('Time(s)')
CF_y = 1.4142 ylabel('Harmonic Vibration(g)')
For a smooth harmonic vibration
The CF will be 1.414
Why??
y_RMS = 0.1414
CF_y = 1.4142
22 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Crest Factor (ex.)
For the following two hamming data, what’s the difference?
Acc_RMS = 0.0165
CF_Acc = 6.9660
x peak
CF =
x RMS
Acc_RMS = 0.1687
CF_Acc = 8.3782
交換律
結合律
分配律
Vector Norm X = [x 1 x 2 x n ] = x 12 + x 22 + + x n2
A norm is a function that assigns a length, or size, to a vector
For example, let X = [1 2] and Y = [3 4], we have
é1ù é 3ù
X = ê ú = 12 + 22 = 5 > 0, Y = ê ú = 32 + 42 = 25 = 5 > 0
êë2úû êë 4úû
The norm of a scalar is equivalent to the corresponding
absolute value. vector norm is
[ ]
X = 10 = 102 = 10
non-negative
25 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
X = [x 1 x 2 x n ] Î n
Vector Norm X = [x 1 x 2 x n ] = x 12 + x 22 + + x n2
A norm is a function that assigns a length, or size, to a vector
For example, let X = [1 2] and a negative scaling factor ‘‐5’.
Considering the scalability, we have
é1ù é -5 ù
X = -5 ⋅ = ê
ê ú ú = (-5)2 + (-10)2 = 125 = 5 5 > 0
êë2úû êë-10úû
é1ù é 1ù
X = -5 ⋅ ê ú = -5 ⋅ ê ú = 5 ⋅ 12 + 22 = 5 5 > 0 a⋅X = a ⋅ X
êë2ûú ëê2ûú
26 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
X = [x 1 x 2 x n ] Î n
Vector Norm X = [x 1 x 2 x n ] = x 12 + x 22 + + x n2
A norm is a function that assigns a length, or size, to a vector
For example, let X = [1 2] and Y = [‐3 ‐4].
Considering the triangle inequality, we have
é1ù é-3ù é-2ù
X+Y = ê ú + ê ú = ê ú = (-2)2 + (-2)2 = 8 = 2 2 > 0
êë2úû êë-4úû êë-2úû
é 1ù é-3ù
X + Y = ê ú + ê ú = 5 +5 X+Y £ X + Y
êë2ûú êë-4ûú
original vector
x
xN =
x
magnitude of the vector
The size of the normalized vector is always unit.
Therefore, it is also referred to as unit vector.
The normalized/unit vector only shows the direction.
Consider another vector
é 1ù é 1ù
ê ú ê ú
ê2 ú ê2 ú
é1ù ê ú ê ú é1 / 14 ù
ê ú ê 3ú ê 3ú ê ú æ 1 ö÷2 æ 2 ö÷2 æ 3 ö÷2
xN = ë û ë û
= = 2 / 14 ú
ê xN = çç ÷÷ + çç ÷÷ + çç ÷÷ = 1
x = ê2ú Î 3´1 é1ù 14 ê ú è14 ø è14 ø è14 ø
ê ú ê ú ê 3 / 14ú
ê 3ú ê2 ú ë û
ë û
ê ú
ê 3ú
ë û
What does inner product means?
T T
x = [x 0 , x 1 ] , y = [y 0 , y1 ]
Law of cosines
Following is the proof that ⇀
𝐴 ,⇀
𝐴 0
Proof:
A, B ^
Since Aproj = ProjB (A) = B Aproj = A - ProjB (A)
B,B
One has
^ ^
B ( )( B ( ))
Aproj , Aproj = ATproj Aproj = ProjT
A A - Proj A
æ
A, B ç A, B ÷ A, B ö A, B A, B T
= BT ççA - B ÷÷ = BT A - B B
B,B çè B , B ÷÷ø B , B B,B B,B
A, B A, B A, B A, B
= - B,B
B,B B,B B,B
A, B A, B A, B A, B
= - =0
B,B B,B
35 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Vector Norms Visualization
So far, we already use the “2‐norm” to measure the size of a
vector. Actually, there are some different measurement metrics.
Following we consider a comparison of different norms.
T
By definition, for a given vector x = [x1 x 2 xm ] Î m
1‐norm m
x 1 = å x i = x1 + x 2 + + x m
i =1
2‐norm 1/ 2
æ m 1/ 2
ö 1/ 2
x 2 = x, x
x 2 = ççå x i2 ÷÷÷ = (x12 + x 22 + + x m2 )
çèi =1 ø 2
x 2 = x, x = xT x
‐norm
x ¥ = max { x 1 , x 2 , x 3 ,, x m }
x1 Î [-1 +1] x1
x 2 Î [-1 +1] (-1,-1) (1,-1)
To visualization the pattern of the norms of the vector x, we
are going to find “the changing of x1 & x2”, such that the
following conditions (or constraints) are satisfied.
m
x 1 = å xi = 1 x 1 = x1 + x 2 = 1
i =1
1/ 2
m =2 æ 2 2 ö÷1/2
æ m 2 ö÷ x 2 = ççå x i ÷÷ = x12 + x 22 = 1
x 2 = ççå x i ÷÷ =1 çèi =1 ø
èçi =1 ø 2D case
x ¥ = max { x 1 , x 2 ,, x m } = 1 x ¥ = max { x 1 , x 2 } = 1
ìï +0.0 + +1.0 = 1 ì
ï -0.0 + +1.0 = 1 ì
ï -0.0 + -1.0 = 1 ìï +0.0 + -1.0 = 1
ïï ï ï ïï
ïï +0.1 + +0.9 = 1 ï
ï ï
ï ïï +0.1 + -0.9 = 1
ï -0.1 + +0.9 = 1 ï -0.1 + -0.9 = 1 ïï
ïï ï
ï ï
ï
ïï +0.2 + +0.8 = 1 ï -0.2 + +0.8 = 1 ï -0.2 + -0.8 = 1 ïï +0.2 + -0.8 = 1
L1 í ï
L2 í ï
L3 í L4 í
ïï ï ï ïï
ïï ï
ï ï
ï ï
ï ï ïï +0.9 + -0.1 = 1
ïï +0.9 + +0.1 = 1 ï
ï - 0.9 + + 0.1 = 1 ï
ï - 0.9 + - 0.1 = 1 ïï
ïï ï
ï ï
ï ïï +1.0 + -0.0 = 1
ïî +1.0 + +0.0 = 1 ï
î - 1.0 + + 0.0 = 1 ï
î - 1.0 + - 0.0 = 1 î
x2 x2 x2 x2
+1 +1
L1 L2
-1 +1
x1 x1 x1 x1
+1 -1
L3 L4
-1 -1
38 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
x1 Î [-1 +1]
x 2 Î [-1 +1]
Vector Norms Visualization
For the “‐norm”, there are four cases we have to consider
x2
Case‐1 : L1
Following we put all the charts in a single figure given the
x2
constraints
x 1 = x1 + x 2 = 1 1-norm diamond
æ 2 2 ö÷1/2 x1
x 2 = ççå x i ÷÷ = x12 + x 22 = 1
çèi =1 ø 2-norm circle
x ¥ = max { x 1 , x 2 } = 1 -norm square
éx 1 ù
Consider the following 2D case, where x = ê ú Î 2´1
êëx 2 úû
2 2
1-norm : x 1 = x1 + x 2 x1 + x2
æ 2 2 ö÷1/2
2-norm : x 2 = ççå x i ÷÷ = x12 + x 22
çèi =1 ø x2
-norm : x ¥ = max { x 1 , x 2 }
x1
41 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Vector Norms
In Linear Algebra, a “norm” refers to the length of all the
vectors in a space.
So far, we already introduced that there are different ways to
measure the magnitude of vectors, including:
1‐norm
m
x 1 = å x i = x1 + x 2 + + x m
i =1
2‐norm 1/ 2
æ m ö 1/ 2
1/ 2
x 2 = x, x
x 2 = ççå x i2 ÷÷÷ = (x12 + x 22 + + x m2 )
çèi =1 ø 2
x 2 = x, x = xT x
‐norm
x ¥ = max { x 1 , x 2 , x 3 ,, x m }
v2 , u1 v ,u v ,u v , u v2 , u1 T
= u1 , v2 - 2 1 u1 = 2 1 uT1 v2 - 2 1 u1 u 1
u1 , u1 u1 , u1 u1 , u1 u1 , u1 u1 , u1
v 2 , u1 v , u v 2 , u1
= v2 , u 1 - 2 1 u1 , u1
u1 , u1 u1 , u1 u1 , u1
v 2 , u1 v ,u
= v2 , u 1 - 2 1 v2 , u1 = 0
u1 , u1 u1 , u1
Following illustrates the geometric procedure of the GSP:
Z Z
u3
v3
v2
Proju1 (v2 ) Proju1 (v 3 )
u1 = v1 X u1 X
u1 = v1
u2 = v2 - Proju1 (v2 ) u 3 = v 3 - (Proju1 (v 3 ) + Proju2 (v 3 ))
u1 = v1 u2
u2
u 2 = v2 - Proju1 (v2 ) u3
u 3 = v 3 - Proju1 (v3 ) - Proju2 (v 3 ) u3
Please note that the computation may yield poor results when
some of the vectors {vi} are almost linearly dependent.
1st column
The entry in the i‐th row and j‐th column of a matrix A is
sometimes referred to as the i,j, (i,j), or (i,j)th entry of the
matrix, and most commonly denoted as ai,j, or aij.
Or a column
%%... 1st column
é 11 22 33ù é 11 22 33ù é 11 22 33ù A1 = A(:,1)
ê ú ê ú ê ú %%... 2nd column
A = ê 44 55 66ú A = ê 44 55 66ú A = ê 44 55 66ú A2 = A(:,2)
ê ú ê ú ê ú %%... 3rd column
ê77 88 99ú ê77 88 99ú ê77 88 99ú A3 = A(:,3)
ë û ë û ë û
52 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Matrix
Specially, one can also extract a sub matrix from the given
matrix.
é 11 22 33 44 ù é 11 22 33 44 ù
ê ú ê ú
ê 55 66 77 88 ú ê 55 66 77 88 ú
A=ê ú Î Â 4´4 A= ê ú Î Â 4´4
ê 99 0 -11 -22ú ê 99 0 -11 -22ú
ê ú ê ú
ê-33 -44 -55 -66ú ê-33 -44 -55 -66ú
ë û ë û
A_sub = A(1:2,1:2) A_sub = A(2:4,2:4)
é 11 22 33 44 ù é 11 22 33 44 ù
ê ú ê ú
ê 55 66 77 88 ú ê 55 66 77 88 ú
A= ê ú Î Â 4´4 A= ê ú Î Â 4´4
ê 99 0 -11 -22ú ê 99 0 -11 -22ú
ê ú ê ú
ê-33 -44 -55 -66ú ê-33 -44 -55 -66ú
ë û ë û
A_sub = A(:,2:3) A_sub = A(2:4,:)
Case. B : underdetermined : if there are fewer equations
than unknowns infinity solutions
usually minimum distance (norm) solution is prefer
Case. C : overdetermined : if there are more equations than
unknowns no exact solution
but there still exists an optimal one
A=[1 1 1;1 ‐2 1;1 1 ‐1];
b=[8;4;‐4];
x_ans = inv(A)*b
Case. B : underdetermined (under‐constrained):
11⋅ x 1 + 22 ⋅ x 2 + 33 ⋅ x 3 = 10 éx ù
44 ⋅ x1 + 55 ⋅ x 2 + 66 ⋅ x 3 = 11 é11 22 33ù ê 1 ú é10ù
ê ú êx 2 ú = ê ú
êë 44 55 66úû ê ú êë11úû
êx 3 ú
A=[11 22 33;44 55 66]; A ëû b
X
b=[10;11]; Non-square
x_ans = pinv(A)*b
Case. C : overdetermined case (over‐constrained):
1⋅ x1 + 1⋅ x 2 = 1
1⋅ x1 - 1⋅ x 2 = 3 é 1 1ù é 1ù
ê ú éx1 ù ê ú
-1 ⋅ x 1 + 2 ⋅ x 2 = - 2 ê 1 -1ú ê ú = ê 3ú
ê ú êëx 2 úû ê ú
ê-1 2úû êë-2úû
ë X
A=[1 1;1 ‐1; ‐1 2];
A b
b = [1;3;‐2]
x_ans = pinv(A)*b Non-square
Finally, it is easy to obtain the optimal solution by substituting
into
2 ()
AT AT -1
xopt := - l =- -2(AA ) b T
2
l
-1
= AT (AAT ) b = A+b
T -1
A := A (AA )
† T
Note that the term is called pseudo inverse.
( )
T -T
= bT (AAT )
T
(xs - xopt ) xopt A (xs - xopt ) = 0
0
Form the geometric point of view, it follows
xs = xopt + Dx xs = xopt + Dx xs
T
Dx := xs - xopt
xTs xs = (xopt + Dx) (xopt + Dx)
= xTopt xopt + 2 xTopt Dx + DxT
Dx
³0 xopt
³0 0
2 2 2 2 2 2
xs = xopt + Dx xopt = xs - Dx
Therefore, it is evident that for any .
Dx ¹ 0 Dx ³ 0
xs ³ xopt
This concludes that minimum norm solution.
66 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Underdetermined Matrix Solution
Consider the following examples
éx1 ù
éx1 ù é11 22 33ù ú é10ù
ê
Ex.1 1 1] ê ú = 1
[ Ex.2 ê ú êx ú = ê ú
êëx 2 úû b êë 44 55 66úû ê 2 ú êë11úû
A1 1 êx 3 ú
x1 A2 ëû b2
x2
Taking the formula of the minimum norm solution
-1
xopt = AT (AAT ) b = A†b
gives the associated solutions æ ö÷-1
çç ÷
é1ù çç é1ù ÷÷ é 0. 5 ù
÷
xopt 1 = ê ú çç[1 1] ê ú ÷ 1 = ê ú
x1 + x 2 = 1 êë1úû ç êë1úû ÷÷ b êë 0.5úû
çç A1 ÷÷
AT 1 è
ç AT 1 ø
÷
min x 2 (0.5, 0.5) the shortest distance
solution é-0.4141ù
- 1 ê ú
xopt 2 = A2 (A2A2 ) b2 = 0.0101 ú
T T ê
ê ú
ê 0.4343 ú
ë û
67 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Underdetermined Matrix Solution
An engineering application: a multi‐rotor force generation
problem
Here we have a force distribution matrix
é F1 ù
ê ú
Thrust éu ù é 1 1 1 1 1 1 êF2 ú
ù
ê ú ê úê ú
Roll torque ê tj ú ê-lc cos (qH ) lc cos (qH ) 1 lc cos (qH ) -lc cos (qH ) -1ú êF3 ú
ê ú=ê úê ú
ê tq ú ê -l sin (q ) -l sin (q ) 0 l sin (q ) l sin (q ) 0 ú êêF4 úú
Pitch torque ê ú ê c H c H c H c H ú
êty ú ê m -m m -m m -mú êF ú
Yaw torque ëû ë û ê 5 ú
b A êF ú
ë 6û
X
68 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Underdetermined Matrix Solution
An engineering application: a multi‐rotor force generation
problem
There are 6 variables but only 4 constraints!
é F1 ù
ê ú
éu ù é 1 1 1 1 1 1 ù êF2 ú
ê ú ê úê ú
ê tj ú ê-lc cos (qH ) lc cos (qH ) 1 lc cos (qH ) -lc cos (qH ) -1ú êF3 ú
ê ú=ê úê ú
ê tq ú ê -l sin (q ) -l sin (q ) 0 l sin (q ) l sin (q ) 0 ú êêF4 úú
ê ú ê c H c H c H c H ú
êt ú ê m -m m -m m -múû êêF5 úú
ë yû ë
b A êF ú
ë 6û
X
generated by flight controller
Problem statement : given “b” and “A”, please find “X”.
The minimum norm solution is
-1
xopt = AT (AAT ) b = A†b
Based on the property of the orthonormal set, one has
xTi x j = 0 i¹j
if
xTi x j = 1 i=j
Therefore, we can obtain that
é xT ù éxT x xT x xT1 xn ùú é1 0 0ù
ê ú1 ê 1 1 1 2
ê Tú ê T ú êê0 1 0ú
ú
ê x2 ú ê x2 x1 xT2 x2 T
x 2 xn ú
Q Q = ê ú [ x1 , x2 , xn ] = ê ú = êê ú = In´n
T
ê ú ê ú ê ú
ê Tú ê T ú ê ú
êë xn úû êëxn x1 xTn x2 xn xn úû ë0
T 0 1úû
Based on the property of the orthonormal set, one has
xTi x j = 0 i¹j
if
xTi x j = 1 i=j
Theorem:
If Q is an orthogonal matrix, then Q is invertible and QT=Q‐1
QT Q = In´n QT = Q-1
Preservation of angles
æ(Qx)T (Qx)ö÷ æ xT y ö÷
-1 ç ÷÷ = cos çç
-
(Qx, Qy) = cos çç 1
÷ = ( x, y )
çè Qx ⋅ Qy ÷ø÷ èç x ⋅ y ÷ø÷
V3 V2' = R FV2
V2
V3' = R FV3 V1
V2
V1 V1'
after
rotation
74 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Orthogonal Matrix (Ex.)
V1' = R FV1
V2' = R FV2
V3' = R FV3
The transition behavior is different.
But, the steady state is the same
79 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Orthogonal Matrix (Ex.)
Rotation w.r.t the Body Frame Rotation w.r.t the Body Frame
Sometimes, the given two functions(or signals) are also
referred to as independent (or uncorrelated) if they are
mutually orthogonal.
In addition, the individual function is said to be orthonormal
over the interval [T1, T2] if
2 æ T2 ö÷2
x (t ) , x (t ) = x (t ) = çç òT1 x (t )x (t )dt ÷÷ = 1
è ø
2 æ T2 ö÷2
y (t ), y (t ) = y (t ) = çç òT1 y (t )y (t )dt ÷÷ = 1
è ø
81 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Orthogonal Function
If two functions are orthogonal, they can also be referred as
mutually independent.
Orthogonal Function (ex.)
Consider the cosine functions
km
k=m
2p 1 2p
ò0 sin (nx ) cos (mx ) = ò (sin ((n + m )x ) + sin ((n - m )x ))dx
2 0
é 2p ù
1 1 1
= - êê cos ((n + m )x ) + cos ((n - m )x ) úú
2 ê(n + m ) (n - m ) 0 úû
ë
éæ 1 1 ö÷ù
êçç ÷ú
êçè(n + m ) cos ((n + m )⋅ 2p) + (n - m ) cos ((n - m ) ⋅ 2p)÷÷øú
1
= - êê ú
ú
2ê æ 1 1 ö ú
ê-ççç cos ((n + m )⋅ 0) + cos ((n - m )⋅ 0)÷÷÷ ú
êë è(n + m ) (n - m ) ÷ø ú
û
=0
Thus we have
2p 2p 2p
ò0 (y (t )sin(w1t ))dt ò0 (y (t )sin(w2t ))dt ò0 (y (t )sin(w3t ))dt
A1 = A2 = A3 =
p p p
Further application will be extended for Fourier Transform
(spectrum analysis)
N ⋅2 p
ò0 sin (nx )sin (nx ) = N ⋅ p
N ⋅2 p
ò0 cos (nx ) cos (mx ) = N ⋅ p
Proof: N ⋅2 p N ⋅2 p
ò0 sin (nx ) sin (nx )dx = ò0 sin 2 (nx )dx
N ⋅2 p
1 N ⋅2p 1æ 1 ö
= ò0 (1 - cos 2nx )dx = ççx - sin 2nx ÷÷÷
2 2è 2n ø0
1æ 1 ö
= ççN ⋅ 2p - sin 2N ⋅ 2p÷÷÷
2è 2n ø
= N ⋅p
close all; clear; clc
A1 = 3; A2 = 4; A3 = 5;
w1 = 6; w2 = 7; w3 = 8;
dT = 0.001; N = 1;
t = 0:dT:N*2*pi;
y1 = sin(w1*t);
y2 = sin(w2*t);
2p
y3 = sin(w3*t);
ò0 (y (t )sin(w1t ))dt
y = A1*y1 + A2*y2 + A3*y3; A1 =
subplot(4,1,1); plot(t,y); axis([0 2*pi ‐15 15]); ylabel('y'); N ⋅p
subplot(4,1,2); plot(t,A1*y1,'r'); axis([0 2*pi ‐5 5]); ylabel('A1*y1'); 2p
subplot(4,1,3); plot(t,A2*y2,'g'); axis([0 2*pi ‐5 5]); ylabel('A2*y2'); ò0
(y (t )sin(w2t ))dt
subplot(4,1,4); plot(t,A3*y3,'m'); axis([0 2*pi ‐5 5]); ylabel('A3*y3'); A2 =
N ⋅p
xlabel('Time');
2p
A1_est = sum(y.*y1*dT)/(N*pi) A1_est = 3.0000 ò0
(y (t )sin(w3t ))dt
A2_est = sum(y.*y2*dT)/(N*pi)
A2_est = 4.0000 A3 =
A3_est = sum(y.*y3*dT)/(N*pi) N ⋅p
A3_est = 5.0000
3. Please calculate the corresponding unit vectors. (5%)
x = [1 2 3 4 ]
y = [-2 3 1 -5 7 10 ]
5. Determine if the following matrices satisfy the orthogonality.
(Please provide the computation detail.) (20%)
é 3 / 5 0 -4 / 5ù é cos q -sin q 0ù
é 0 1ù é1 -1ù ê ú ê ú
A. Q = ê ú B. Q = ê ú ê
C. Q = 0 1 0 ú D. Q = sin q cos q 0ú
ê
êë-1 0úû êë1 1 úû ê ú ê ú
ê4 / 5 0 3 / 5 ú ê 0 0 1úû
ë û ë
Please give a proof that the matrix is orthogonal. (5%)
RTF = R-F 1
Hint :
RTF R F = I
The 6th column is the z‐axis gyroscope data.
xlabel('Time')
ylabel('\omega_x(rad/s)')
Please use crest factor ‘CF’ to evaluate which of the axis was
contaminated (by abrupt perturbations) the most; and which
of them has the most minor contamination. (5%)
Please plot all the time responses for the gyroscope. (5%)
93 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Homework
8. Consider the given file “Signal.mat”, please plot the time response signal
and further recover the amplitudes A1~A4 of the harmonic component.
Note that the period of the signal N = 3. (10%)
Please provide your MATLAB Code!
y (t ) = A1 sin(10t ) + A2 sin(13t ) + A3 sin(20t ) + A4 sin(30t )
Hint: A1 = ?
Load the “Signal.mat” in
your MATLAB workspace. A2 = ?
There are two variables in
A3 = ?
the file “t” & “y” A4 = ?
Please proof that (10%)
ui , u j = 0, when i ¹ j
That is
u1 , u 2 = 0
u2 , u 3 = 0
u1 , u 3 = 0
Note: detail derivations MUST be given!
95 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Homework
10. For the multi‐rotor UAV, suppose that
Given é u ù é10ù
ê ú ê ú ìïlc = 0.3
ê tj ú ê 3 ú ïï
Y = ê ú = ê ú, íqH = p / 6
ê tq ú ê 4 ú ïï
ê ú ê ú ïïîm = 0.05
ê ú ê ú
ëty û ë 5 û
Please find (5%)
T
X = [F1 F2 F3 F4 F5 F6 ] = ?
where é F1 ù
ê ú
éu ù é 1 1 1 1 1 1 êF2 ú
ù
ê ú ê úê ú
ê tj ú ê-lc cos (qH ) lc cos (qH ) 1 lc cos (qH ) -lc cos (qH ) -1ú êF3 ú
ê ú=ê úê ú
ê tq ú ê -l sin (q ) -l sin (q ) 0 l sin (q ) l sin (q ) 0 ú êêF4 úú
ê ú ê c H c H c H c H ú
êty ú ê m -m m -m m -mú êF ú
ëû ë û ê 5 ú
b A êF ú
ë 6û
X
96 Dr. C. C. Peng (ccpeng@mail.ncku.edu.tw)
Homework
11. Please gives the proof of the following properties: (5%)