You are on page 1of 15

1T4: Some basic mathematics

Xavier Serra
Universitat Pompeu Fabra, Barcelona
Index

Sinusoidal functions

Complex numbers

Euler’s formula

Complex sinusoids

Scalar product of sequences

Even and odd functions

Convolution
Sinusoidal functions (sinewaves)

x [n]= A cos(ω nT +ϕ)= A cos(2 π f nT +ϕ)

A: amplitude
ω : angular frequency in radians/seconds
f =ω/2 π :frequency in Hertz (cycles/seconds)
ϕ: initial phase in radians
n : time index
T =1/ f s :sampling period in seconds(t=nT =n/ f s )
Sinewave plot

A = .8
f0 = 1000
phi = np.pi/2
fs = 44100
t = np.arange(­.002, .002, 1.0/fs)
x = A * np.cos(2*np.pi*f0*t+phi)
Complex numbers
(a + jb) a, b: real numbers
j = -1 : imaginary unit
Im


Complex plane:
Re (real axis)
Re
Im (imaginary axis)
Im
Rectangular form:
(a+ jb) b x

a Re

Polar form:
A= √ a +b
2 2
Im
b
ϕ=atan 2( )
a x
A
where: φ
b −1 b
if (a>0) atan 2( )=tan ( )
a a Re
b −1 b
else if (a<0) atan 2( )=tan ( )− pi
a a
Euler's formula
e j ϕ=cos ϕ + j sin ϕ
jϕ − jϕ Im
e +e
cos ϕ =
2 x
e j ϕ =cos(ϕ)+ j sin (ϕ)
jϕ − jϕ
e −e
sin ϕ =
2j ϕ
Re
Complex sinewave
j ( ω nT +ϕ) j ϕ ( j ω nT ) j ( ω nT )
x̄ [n]= A e =Ae e = Xe
= A cos( ω nT +ϕ)+ j Asin ( ω nT +ϕ)

Real sinewave:
j ( ω nT +ϕ) − j ( ω nT +ϕ)
e +e
x [ n]= A cos( ω nT +ϕ)= A( )
2
1 j ( ω nT ) 1 * − j ( ω nT ) 1 1 *
= Xe + X e = x̄ [n]+ x̄ [n]
2 2 2 2
=ℜ{ x̄ [n]}
Scalar (dot) product of sequences

N −1
*
⟨ x , y ⟩= ∑ x [ n] y [n]
n=0

Example:
x [n]=[0, j ,1] ; y [n]=[1, j , j]
⟨ x , y⟩=0×1+ j×(− j)+1×(− j)=0+1+(− j)=1− j
Orthogonality of sequences

x ⊥ y ⇔⟨ x , y ⟩=0

x=(2,2)
2

Example: 1

x [ n]=[2,2] ; y [n]=[2,−2]
1 2 3 4
* * -1
⟨ x , y ⟩=2×2 +2×(−2) =4−4=0
-2 y=(2,-2)
Even and odd functions
f [n] is even if f [-n] = f [n] [symmetric]
f [n] is odd if f [-n] = -f [n] [antisymmetric]
Convolution N −1
y [n]=( x 1 [n]∗x 2 [n ])n = ∑ x 1 [m] x 2 [n−m]
m=0
References and credits
● More information in:
– https://en.wikipedia.org/wiki/Sinusoid
– https://en.wikipedia.org/wiki/Complex_numbers
– https://en.wikipedia.org/wiki/Euler_formula
– http://en.wikipedia.org/wiki/Dot_product
– https://en.wikipedia.org/wiki/Convolution
● Reference for the mathematics of the DFT by Julius O.
Smith: https://ccrma.stanford.edu/~jos/mdft/
● Slides released under CC Attribution-Noncommercial-
Share Alike license and code under Affero GPL license;
available from https://github.com/MTG/sms-tools
1T4: Some basic mathematics

Xavier Serra
Universitat Pompeu Fabra, Barcelona

You might also like