Experiment 8
Experiment 8
Complex Basics
Complex numbers are the numbers that are expressed in the form of a+ jb where, a , b
are real numbers and ‘i ’ is an imaginary number called “iota”. The value of j=( √−1).
For example, 2+3 i is a complex number, where 2 is a real number (Re) and 3 j is an
imaginary number (Im).
Any number which is present in a number system such as positive, negative, zero,
integer, rational, irrational, fractions, etc. are real numbers. It is represented as Re().
For example: 12, -45, 0, 1/7, 2.8, √5, etc., are all real numbers.
The numbers which are not real are imaginary numbers. When we square an imaginary
number, it gives a negative result. It is represented as Im(). Example: √ −2 , √−7 , √ −11
are all imaginary numbers.
The complex numbers were introduced to solve the equation x 2+ 1=0 . The roots of the
equation are of form x=± √ −1 and no real roots exist. Thus, with the introduction of
complex numbers, we have Imaginary roots. We denote √ −1 with the symbol ‘ j’ , which
denotes Iota (Imaginary number).
By definition, we have
and so on. Thus, the sequence x ( n ) ≜ j n , n=0 , 1 , 2, … is a periodic sequence with period
4, since j n +4 = j n j 4 = j n. Every complex number z can be written as:
z=x + jy
where x and y are real numbers. We call x the real part and y the imaginary part. We
may also use the notation:
ℜ ( z )=x ¿
ℑ ( z )= y ¿
Complex Number Manipulation
Let's run through a few elementary manipulations of complex numbers in GNU
Octave:
>> x = 1;
>> y = 2;
>> z = x + j * y
Output (screenshot):
>> 1/z
Output (screenshot):
>> z^2
Output (screenshot):
>> conj(z)
Output (screenshot):
>> z*conj(z)
Output (screenshot):
>> abs(z)^2
Output (screenshot):
norm(z)^2
Output (screenshot):
angle(z)
Output (screenshot):
r = abs(z)
Output (screenshot):
theta = angle(z)
Output (screenshot):
Observations
Output (screenshot):
z
Output (screenshot):
z/abs(z)
Output (screenshot):
exp(j*theta)
Output (screenshot):
z/conj(z)
Output (screenshot):
exp(2*j*theta)
Output (screenshot):
imag(log(z/abs(z)))
Output (screenshot):
theta
Output (screenshot):
Here are some manipulations involving two complex numbers:
>> x1 = 1;
>> x2 = 2;
>> y1 = 3;
>> y2 = 4;
>> z1 = x1 + j * y1;
>> z2 = x2 + j * y2;
>> z1*z2
Output (screenshot):
>> z1/z2
Output (screenshot):
Another thing to note about GNU Octave syntax is that the transpose operator ' (for
vectors and matrices) conjugates as well as transposes. Use .' to transpose without
conjugation:
>>x = [1:4]*j
Output (screenshot):
>>x'
Output (screenshot):
>> x.'
Output (screenshot):
Observations
In the second example in terms of imaginary exponential I was able to use new
commands like operators in the vectors and matrices.
Output (screenshot):
Observations
In the vector interpretation of complex number, I’ve learn that you can input
numbering in the so that you can org
Projection
The projection of the Length-N column-vector y onto the Length-N column-vector x may
therefore be computed as follows:
yx = (x' * y) * (x' * x) ^ (-1) * x
It is called the projection matrix. Subspace projection is an example in which the power
of matrix linear algebra notation is evident.
Example 1:
>> X = [[1;2;3],[1;0;1]]
Output (screenshot):
>> PX = X * (X' * X)^(-1) * X'
Output (screenshot):
>> y = [2;4;6]
Output (screenshot):
>> yX = PX * y
Output (screenshot):
Since y in this example already lies in the column-space of X, orthogonal projection onto
that space has no effect.
Example 2:
Let X and PX be defined as Example 1, but now let
>> y = [1;-1;1]
Output (screenshot):
>> yX = PX * y
Output (screenshot):
Output (screenshot):
>> eps
Output (screenshot):
Observations
Screenshots of the Selfie while working with the experiments