0% found this document useful (0 votes)
9 views35 pages

01 Matika

Uploaded by

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

01 Matika

Uploaded by

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

Mathematical fundamentals

for ISS
Honza Černocký, ÚPGM FIT VUT

Please open Python notebooks matika and cos_jexp.

1
Functions and sequences
• Signals with continuous time (analog, real world) are defined for all
times t. Signály se spojitým časem, spojité signály.
• From math point of view, they are functions x(t)  round brackets
• Signals with discrete time (computer, digital world), sampled signals
are defined only for integer times (sample numbers) n. Signály s
diskrétním časem, diskrétní signály, vzorkované signály.
• From math point of view, they are sequences x[n]  square brackets.

2 / 35
How is it done in Python ? Just 4 steps …
1. Generate the independent variable - 1 line of Python code
2. Generate or read the signal - 1 line of Python code
3. Do something with the signal - 1 line of Python code
4. Show the result - 1 line of Python code (or more if you want to have
it nice)

3 / 35
Operations with functions
• As you know them from primary school, just do it for all times:
• Addition
• Subtraction
• Multiplication
• Mind the “masking effect” of zeros

#basicops

4 / 35
Operations with sequences
• As you know them from primary school, just do it for all times.
• Addition
• Subtraction
• Multiplication
• Mind the “masking effect” of zeros
• When plotting in Python, use stem rather than plot to show that we have
discrete values.
• But remember this is a lecture example, in normal life, we’ll be happily using
plot also with discrete signals 

#basicops_seq 5 / 35
Linear function
• Parameter a – slope (směrnice, sklon)
• Parameter b – offset, bias (posun).

#linear

6 / 35
Derivations and integrals
• Example on a simple quadratic function:

• Derivation done analytically

• Primitive function (antiderivative, primitivní funkce) done analytically

#deriv_int_anal

7 / 35
Derivation done numerically
• Analytical form of derivation might not exist, or we are given an input
signal, or just too lazy …
• Make use of the definition of derivation

• and just estimate the derivative from 2 points close to each other …

#deriv_num

8 / 35
Finite integral from t1 to t2
• Analytically using the primitive function:

• But we will rather meet the numerical approximation of integral:


• Finite integral is the surface under the function (plocha pod křivkou)
• Define a time step ∆, filling the interval t1 to t2 N times.
• Approximate the integral as the sum of surfaces of “noodles”, and simplify as the width
of all noodles is the same:

9 / 35
#int_anal_num
Cosine function (cosínusovka) – continuous
time
• Basic cosine

• has
• Period (perioda) 2π rad – we are measuring angles in radians.
• Magnitude (amplituda) 1
• Phase shift (fázové posunutí, fáze) 0

#cosine_basic

10 / 35
Cosine with more interesting parameters
• Setting the number of periods per second: frequency (frekvence,
kmitočet) f1 in Hertz.
• The period (in seconds) then becomes

• Making the cosine do f1 periods in second: multiply its argument by

• This value is called angular or circular frequency or velocity


(kruhová / úhlová frekvence / rychost) and is measured in rad/s
11 / 35
Cosine with more interesting parameters II
• Changing the magnitude - just multiply the cosine by constant C1.
• Changing the phase – add angle Φ1 to the argument
• Positive – shift to the left - advancing the signal (předběhnutí)
• Negative – shift to the right – delaying the signal (zpoždění)
• After adding / subtracting 2π, we obtain the same, as the periodicity of cosine is
2π.
• Full cosine:

#cosine_full
12 / 35
Cosine sequence – discrete time
• Sequence
• Not very interesting - something like 6.28 samples per period ???
• Enforcing the number of samples in one period to be N:

• 2π/N is called normalized angular frequency (normovaná kruhová


frekvence) – also denoted as ω1.
• Similarly as for the continuous one, we can change the magnitude
and phase
#cosine_disc 13 / 35
Complex numbers – basics
• The real numbers are 1D – real axis
• Complex numbers are 2D – lay in the complex plane (komplexní
rovina) with two dimensions – the real one and the imaginary one
• Mathematicians use i, electrical (and IT) engineers use j

14 / 35
Complex unit
• Is defined as
• Has “circular property”

15 / 35
Complex number as a vector and its two
forms
• It is convenient to imagine complex numbers as vectors starting in
0+0j and going to the given complex number.
• Component form (složkový tvar) of a complex number
• a is real component
• b is imaginary component
• Polar form (polární nebo goniometrický tvar)
• r is magnitude or absolute value (modul, absolutní
hodnota, magnituda)
• φ is phase (fáze, úhel, argument)

16 / 35
Conversion of forms using basic geometry
• From polar to component
… so the component form can be written as
• From component to polar

• Be careful about the inverse tangens and always check that you have got the
result correctly.
• See the 1st numercical exercise.
• Python (and all other languages supporting math) have appropriate
functions
• np.abs(), np.angle()
17 / 35
Exponential form of complex number
• or (if lazy to type in LaTeX)

or (el. engineers)

18 / 35
Operations with complex numbers
• Addition and subtraction in composite form
• Easy to imagine as vectors in the complex plane !

19 / 35
Operations with complex numbers II
• Multiplication
• Possible in component form, but too complicated …

• Much more convenient in the exponential form: multiply the magnitudes and
sum the phases !

• Division: similar

20 / 35
Operations with complex numbers III
• Complex conjugation (komplexní sdružení)
• Component form: imaginary part swapped
• Exponential form: phase swapped
• Sum of complex-conjugated complex numbers is a real number

• Product of complex-conjugated complex


numbers is the square of their magnitude
• Will be handy in determing powers and energies

• np.conj(x) * x is faster to write and to compute than


np.power(np.abs(x), 2.0)
21 / 35
Unit circle (jednotková kružnice) r = 1

• Useful to derive some formulas in case you forget them …

22 / 35
Complex exponential
• For zero phase:
• The point then starts moving counter-clock-wise
(proti směru hodinových ručiček)
• Much better to see it on a physical model
the „complex bottle“

• and visualize it in Python 23 / 35


Operations with complex exponential
Showing that it can be really decomposed into cos and sin …

turning in opposite direction:


• instead of

#complex_exp_minus

24 / 35
Operations with complex exponential II
Changing the magnitude – just multiply with a constant
#complex_exp_magnitude
Changing the phase – just multiply with a complex number laying on
the unit circle with the desired phase
• the complex exponential will acquire the desired phase
#complex_exp_phase
Changing both – multiply with a complex number of which the
magnitude will be the desired magnitude change, and phase will be the
desired phase change
#complex_exp_magnitude_phase
25 / 35
Complex exponential with period different
from 2π
• Exactly the same as for the cosine: multiply time by angular
frequency so that

• the angular frequency can be even negative, in this case, the complex
exponential will “turn” in the opposite direction

#complex_exponential_ang_freq
26 / 35
Complex exponential – the whole thing
• the complex coefficient c1
• Its magnitude determines the magnitude of resulting complex exponential.
• Its phase determines the phase of resulting complex exponential.

• the angular frequency ω1 determines the number of revolutions


of the complex exponential per second.

27 / 35
Breaking a cosine into two complex
exponentials
• Using the well known formula
• The cosine without initial phase can be decomposed as

• Don’t be scared by the negative angular frequency !


#cos_decomposition
• And the full one similarly making use of

• and are complex constants.


#cos_decomposition_full 28 / 35
Complex exponential - discrete-time
• Very similar to discrete cosine … for 1 period in N samples
• k periods in N samples:
#complex_exp_discrete
#complex_exp_discrete_2

29 / 35
General complex exponential with discrete
time
• Similarly as for the continuous-time one,
• magnitude of c determines the magnitude of resulting complex exponential.
• phase of c determines the phase of resulting complex exponential.
• k determines the number of periods (“turns”) in N samples

#complex_exp_discrete_general

30 / 35
Decomposing a discrete cosine into two
complex exponentials
• Again using the well known formula

• Complex numbers and are again


complex coefficients.
• The example is for

#discrete_cos_decomposition
31 / 35
Physical model for discrete complex
exponential
• Use whatever long object and put something into it …

32 / 35
Sum of discrete complex exponential over
one period
• Examples for N = 2, 4, 8, and 16.
• Obvious that the blue parts will cancel out with the red ones => zero

• It generalizes also for other N’s. In case more math needed, here it is !

33 / 35
Sum of a continuous complex exponential
over one period
• Red and blue parts cancel out
(integral is nothing but a sum …)

• If you really want a proof, here it is:

34 / 35
Summary
• ISS is actually an applied math course (sometimes also dubbed “Fourier hell” …)
• Cosines, sines and complex exponentials are the very basis of spectral analysis.
• It is good to write equations but writing 2 lines of Python code, and visualizing
the result, helps understanding the math!
• Funny TODO: Impress your friends in a pub by creating a physical model of a
complex exponential (and send me photos).
• Serious TODO: think about the relations of regular and normalized frequencies
when one samples a continuous signal with sampling frequency F s.
• Consider both standard and angular ones.
• What are their units ?
• How to convert one to another ?

35 / 35

You might also like