Post on 13-Jul-2020
COMS21202 - SPS
COMS21202: Symbols, Patterns and Signals
Signals and Fourier Analysis
1Animation from https://giphy.com
2-7 -6 -5 -4 -3 -2 -1 1 5 730 4 6 8
7
123456
8
-2-3-4-5-6-7
So a function is even when
Reminder: Even Functions have y-axis Symmetry
COMS21202 - SPS
y = f(x) = f(โx)
2
x
y
2-7 -6 -5 -4 -3 -2 -1 1 5 730 4 6 8
7
123456
8
-2-3-4-5-6-7
So a function is odd when
Reminder: Odd Functions have origin Symmetry
COMS21202 - SPS
y = f(x) = โf(โx)
3
x
y
Examples: odd or even?
COMS21202 - SPS
๐ ๐ฅ = 3๐ฅ! โ 7๐ฅ" + 1๐ โ๐ฅ = 3(โ๐ฅ)! โ 7(โ๐ฅ)" + 1 = 3๐ฅ! โ 7๐ฅ" + 1
Even
๐ ๐ฅ = 4๐ฅ# โ ๐ฅ๐ โ๐ฅ = 4(โ๐ฅ)# โ (โ๐ฅ) = โ4๐ฅ# + ๐ฅ
Odd
4
๐ ๐ฅ = 5๐ฅ! + 3๐ฅ" + 1๐ โ๐ฅ = 5(โ๐ฅ)! + 3(โ๐ฅ)" + 1 = 5๐ฅ! + 3๐ฅ" + 1
๐ ๐ฅ = โ3๐ฅ! โ ๐ฅ๐ โ๐ฅ = โ3(โ๐ฅ)$ โ (โ๐ฅ) = 3๐ฅ$ + ๐ฅ
Odd
Even
Function Decomposition
COMS21202 - SPS
Even Part
Odd Part
Any function f(x)โ 0 can be expressed as the sum of an even function fe(x) and an odd function fo(x).
๐(๐ฅ) = ๐%(๐ฅ) + ๐&(๐ฅ)
๐%(๐ฅ) =12 [๐(๐ฅ) + ๐(โ๐ฅ)]
๐&(๐ฅ) =12 [๐(๐ฅ) โ ๐(โ๐ฅ)]
6
Example
COMS21202 - SPS
Even Part
Odd Part
๐(๐ฅ) = 0๐'( ๐ฅ > 00 ๐ฅ < 0
๐%(๐ฅ) =
12 ๐
'( ๐ฅ > 012 ๐
( ๐ฅ < 0
๐&(๐ฅ) =
12 ๐
'( ๐ฅ > 0
โ12 ๐
( ๐ฅ < 0
๐(๐ฅ) = ๐%(๐ฅ) + ๐&(๐ฅ)
7
x
x
x
One period2ฯ
0 3ฯ2ฯฯโ2ฯ
โฯโ3ฯ
sin ฮธ
ฮธ
sin ฮธ is an odd function as it is symmetric wrt the origin. sin(ฮธ) = โsin(โฮธ)
sine function
8
cos ฮธ is an even function as it is symmetric wrt to the y-axis. cos(ฮธ) = cos(โฮธ)
cos function
ฮธฯ 3ฯโ2ฯ 2ฯโฯโ3ฯ 0
cos ฮธ
One period2ฯ
9
Signals as Functions
Wavelength or period
amplitude a
๐ก
๐ข =1๐
Example: sine function
From giphy.com
COMS21202 - SPS
Reminder: Linear Systemsโ For a linear system, output of the linear combination of many inputsignals is the same linear combination of the outputs ร superposition
10
COMS21202 - SPS
Characteristics of sound in audio signals:โ High pitch - rapidly varying signalโ Low pitch - slowly varying signal
How do you interpret these musical instrument signals?
11
COMS21202 - SPS
Frequency AnalysisTrigonometric Fourier Series: Any periodic function can be expressed
as the sum of sines and/or cosines of different frequencies, each multiplied by a different coefficient. ร Jean Baptiste Joseph Fourier (1822).
โ A function with period T is represented by two infinite sequences of coefficients. n is the no. of cycles/period.
โ The sines and cosines are the Basis Functions of this representation. an and bn are the Fourier Coefficients.
โ The sinusoids are harmonically related: each oneโs frequency is an integer multiple of the fundamental frequency of the input signal.
๐ ๐ฅ = $!"#
$
๐! cos2๐๐๐ฅ๐ + ๐! sin
2๐๐๐ฅ๐
12
COMS21202 - SPS
Expressing a periodic function as a sum of sinusoids
13
COMS21202 - SPS
The Trigonometric Fourier Series once moreโฆ
A trigonometric Fourier series is an expansion of a periodic function f(x). This expansion is in terms of an infinite sum of sines and cosines.
The Fourier series allows any arbitrary periodic function to be broken into a set of simple terms that can be solved individually, and then combined to obtain the solution to the original problem or an approximation to it.
a0 is often referred to as the DC term or the average of the signal.
๐ ๐ฅ = ๐# +$!"%
$
๐! cos2๐๐๐ฅ๐ + ๐! sin
2๐๐๐ฅ๐
cf. with slide 12 โ when n=0 the sin term disappears and the cos term is 1, so we can rewrite the equation as above.
14
COMS21202 - SPS
Fourier Series solutionA Fourier series provides an equivalent representation of the function:
The coefficients are:
One period
Example periodic function on -T/2, +T/2
x
f(x)
๐) =2๐
8'*/"
,*/"
๐(๐ฅ) sin(2๐๐๐ฅ๐ )๐๐ฅ
๐) =2๐
8'*/"
,*/"
๐(๐ฅ) cos(2๐๐๐ฅ๐
)๐๐ฅ
๐ ๐ฅ = ๐" +&#$%
&
๐# cos2๐๐๐ฅ๐
+ ๐# sin2๐๐๐ฅ๐
โT/2 +T/2
15
0
COMS21202 - SPS
Fourier Series Example: Square Waveโ f(x) is a square wave
f(x)
x
f(x)
x
f(x)
x
f(x)
x
f(x)
x
n = 1n = 1,3n = 1,3,5n = 1,3,5,7,โฆ
๐ ๐ฅ =4๐โ sin
2๐๐ฅ๐
+43๐
โ sin 3 โ 2๐๐ฅ๐
+45๐
โ sin 5 โ 2๐๐ฅ๐
+ ...
๐(๐ฅ) =+1
โ๐2โค ๐ฅ < 0
โ1 0 โค ๐ฅ <๐2
0
x
dxTnxT
dxTnxT
dxTnxxfT
a
T
T
T
Tn
)/2cos(1)/2cos(1
)/2cos()(1
2/
0
0
2/
2/
2/
pp
p
รฒรฒ
รฒ+
-
+
-
-=
=
รฏรฎ
รฏรญ
รฌ=
= รฒ+
-
even 0
odd 4
)/2sin()(1 2/
2/
n
nn
dxTnxxfT
bT
Tn
p
p
โT/2 +T/2
f(x)
= 0
16
2
2
2
COMS21202 - SPS
1.2
1.0
0.8
0.6
0.4
0.2
bn
403020100n
Fourier Series Example: Square Wave
โ The set of Fourier-space coefficients bn contain complete information about the function
โ Although f(x) is periodic to infinity, bn is negligible beyond a finite range
โ Sometimes the Fourier representation is more convenient to use, or just view
bn
n
17
COMS21202 - SPS
Frequency Analysisโ The aim of processing a signal using Fourier analysis is to
manipulate the spectrum of a signal rather than manipulating the signal itself.
โ Example: simple compression
โ Functions that are not periodic can also be expressed as the integral of sines and/or cosines weighted by a coefficient. In this case we have the Fourier transform.
โ The Fourier transform provides a way of representing a signal in a different space - i.e., in the frequency domain.
18
COMS21202 - SPS
Fourier Transform Applicationsโ Applications wide ranging and ever present in modern life:
โ Telecomms/Electronics/IT - cellular phones, digital cameras, satellites, etc.
โ Entertainment - music, audio, multimedia devices
โ Industry - X-ray spectrometry, Car ABS, chemical analysis, radar design
โ Medical - PET, CAT, & MRI machines
โ Image and Speech analysis (voice activated โdevicesโ, biometry, โฆ)
โ and many other fields...
19
COMS21202 - SPS
1D Fourier Transformโ The Fourier Transform of a single variable continuous
function f(x) is:
โ Conversely, given F(u), we can obtain f(x) by means of the inverse Fourier Transform:
๐(๐ฅ) = )89
9
๐น(๐ข) ๐:;<=>๐๐ข
These two equations are also known as the Fourier Transform Pair.Note, they constitute a lossless representation of data.
๐น(๐ข) = )89
9
๐(๐ฅ) ๐8:;<=>๐๐ฅ
20
COMS21202 - SPS
1D Fourier Transform: Discrete Formโ The Fourier Transform of a discrete function of one
variable, f(x), x=0,1,2โฆ,N-1 is:
โ Conversely, given F(u) , we can obtain f(x) by means of the inverse Fourier Transform:
These two equations are also known as the Fourier Transform Pair.Note, they constitute a lossless representation of data.
( ) .1,...,2,1,0for 1)(21
0-==
--
=รฅ Nuexf
NuF N
uxjN
x
p
( ) .1,...,2,1,0for )(21
0-==รฅ
-
=
NxeuFxf NuxjN
u
p
21
COMS21202 - SPS
1D Fourier Domainโ The concept of the frequency domain follows from Eulerโs
Formula:
โ Thus each term of the Fourier Transform is composed of the sum of all values of the function f(x) multiplied by sines and cosines of various frequencies:
๐./0 = cos ๐ โ ๐ sin ๐
๐น ๐ข =1๐3>?@
A8B
๐(๐ฅ) cos2๐๐ข๐ฅ๐
โ ๐ sin2๐๐ข๐ฅ๐
We have transformed from a time domain to a frequency domain representation.for ๐ข = 0,1,2, . . . , ๐ โ 1.
22
COMS21202 - SPS
Example: Low and High FrequencyCharacteristics of sound in audio signals.
23
Freq.
COMS21202 - SPS
Spectrogram
Example: Acoustic Data Analysis
24
COMS21202 - SPS
1D Fourier Transform
โ F(u) is a complex number & has real and imaginary parts:
โ Magnitude or spectrum of the FT:
โ Phase angle or phase spectrum:
โ Expressing F(u) in polar coordinates:
๐น(๐ข) = ๐ (๐ข) + ๐๐ผ(๐ข)
๐น(๐ข) = ๐ "(๐ข) + ๐ผ"(๐ข)
๐(๐ข) = tan.=๐ผ(๐ข)๐ (๐ข)
๐น(๐ข) = ๐น(๐ข) ๐/>(?)
25
COMS21202 - SPS
Simple 1D example
time domain frequency domain time domain frequency domain
time domain frequency domain
bc
d = a + b + ca
time domain frequency domain
26
COMS21202 - SPS
Frequency Spectrum
โ Distribution of |F(u)| ร frequency spectrum of signal.
โ Slowly changing signals ร spectrum concentrated
around low frequencies.
โ Rapidly changing signals ร spectrum concentrated around high frequencies.
โ Hence low and high frequency signals.
โ Also bandlimited signals ร frequency content confined
within some frequency band.
27
COMS21202 - SPS
Very Simple Application exampleโ Automatic speech recognition between two
speech utterances x(n) and y(n).โ Naรฏve approach:
๐ธ =?โA
๐ฅ(๐) โ ๐ฆ(๐) "
Problems with this approach?x(n)=Ky(n),yet Eโ 0
(K being a scaling parameter)
x(n)=y(n-m),yet Eโ 0(m causing a delay shift)
28
One solution could be Dynamic Time Warping(recall from earlier lecture)
COMS21202 - SPS
Frequency domain features
โ Take the Fourier transform of both utterances to get X(u)and Y(u).
โ Then consider the Euclidean distance between their magnitude spectrums: |X(u)| and |Y(u)|:
๐N =?โ?
|๐(๐ข)| โ |๐(๐ข)| "
29
COMS21202 - SPS
Frequency domain analysis
โ Still a difficult task even in the frequency domain.
a tot a dot otto30
COMS21202 - SPS
DNA sequence FT example
โ The analysis of correlations in DNA sequences is used to identify protein coding genes in genomic DNA.
โ Locating and characterizing repeats and periodic clusters provides certain information about the structural and functional characteristics of the molecule.
โ DNA sequences are represented by letters, A, C, G or T, and - .
โ e.g. ACAATG-GCCATAAT-ATGTGAAC--GCTCAโฆ
31
COMS21202 - SPS
DNA sequence FT exampleโ Consider the periodic sequence
A--A--A--A--..... where blanks can be filled randomly by A, C, G or T. This shows a periodicity of 3.
โ The spectral density of such a sequence is significantly non-zero only at one frequency (0.33) which corresponds to the perfect periodicity of base A(1/0.333=3.0).
โ Destroy the perfect repetition by randomly replacing the Aโs with all lettersโฆ
32
COMS21202 - SPS
Letโs practice: DNA sequence analysisโ The computation of Fourier and other linear transforms of symbolic data
is a big problem. โ The simplest solution is to map each symbol to a number. The difficulty
with this approach is the dependence on the particular labeling adopted.
โ This clearly shows that some of the relevant harmonic structure can be exposed by the symbolic-to-numeric labelling.
Consider, for example, the following symbolic periodic sequence:s = (ATAGACATAGAC . . .).
The mapping A ร 1, T ร 0, PeriodG ร 0, TwoC ร 0,
The mapping A ร 1, T ร 2, PeriodG ร 3, SixC ร 4,
33