0% found this document useful (0 votes)
14 views10 pages

Experiment 8

The document discusses complex numbers and their manipulations. It introduces complex basics like representation as a + jb and operations like addition, multiplication, conjugation and normalization. It also demonstrates various complex number manipulations and interpretations using the GNU Octave software through examples and screenshots of the output.

Uploaded by

leirbagtwo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views10 pages

Experiment 8

The document discusses complex numbers and their manipulations. It introduces complex basics like representation as a + jb and operations like addition, multiplication, conjugation and normalization. It also demonstrates various complex number manipulations and interpretations using the GNU Octave software through examples and screenshots of the output.

Uploaded by

leirbagtwo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

EXPERIMENT 8

Introduction to Discrete Fourier Transform: Complex Numbers

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

Based on my observation doing the few elementary manipulations of complex


numbers you can run the commands continuously or manipulate the value by typing
specific commands.

Below are some examples involving imaginary exponentials:


r * exp(j * theta)

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.

Vector interpretation of complex number:


Consider the example two-sample signal x=(2 ,3)
>> x = [2 3]; % coordinates of x
>> origin = [0 0]; % coordinates of the origin
>> xcoords = [origin(1) x(1)]; % plot() expects coordinates
>> ycoords = [origin (2) x(2)];
>> plot(xcoords,ycoords); % Draw a line from origin to x

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

More generally, a Length-N column-vector y can be projected onto the $ M$-


dimensional subspace spanned by the columns of the N × M matrix X :
yX = X * (X' * X)^(-1) * X' * y

Orthogonal projection, like any finite-dimensional linear operator, can be represented by


a matrix. In this case, the N × N matrix:
PX = X * (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):

>> yX' * (y-yX)

Output (screenshot):

>> eps
Output (screenshot):

Observations
Screenshots of the Selfie while working with the experiments

Screenshots while presenting it to your professor

You might also like