A Short Introduction to Signal Processing
Tuomas Puoliväli
tuomas.a.b.puolivali@student.jyu.fi
20th of February 2013
Definition of Signal
► A signal is a function of an independent variable such as time,
distance, position, or temperature. Some examples of biomedical
signals are:
▶ Electrocardiogram (ECG), electroencephalogram (EEG) and
magnetoencephalogram (MEG)
► A signal is said to be continuous when its domain is the set of
real numbers, and discrete otherwise
► Discrete signals are presented as sequences of numbers called
samples
► An analog signal is a real-valued continuous signal
► A digital signal is discrete in time and value
A Continuous, Discrete, and Digital Signal
0
2
4
6
8
10
12
14
−1
−0.5
0
0.5
1
Time / s
Amplitude
Sine Wave
Continuous Signal
0
2
4
6
8
10
12
14
−1
−0.5
0
0.5
1
Discrete Signal
0
2
4
6
8
10
12
14
−1
−0.5
0
0.5
1
Digital Signal
Definition of Signal Processing
► Signal processing usually refers to:
▶ Signal generation
▶ Modifying signals
▶ Extracting information from signals
► Signal processing benefits from improvements in the areas of
electrical engineering, applied mathematics, statistics,
mathematical information technology, ..
Definition of Frequency
► ��Frequency is the number of occurrences of a repeating event
per unit time�� –Wikipedia
► The SI unit of frequency is hertz (symbol Hz, 1 Hz = 1 / s)
Sampling, Sampling Rate and Sampling Theorem
► Sampling is the process of converting a continuous signal to a
discrete one
► Sampling rate, usually denoted by fs, is the number of samples
per second collected from a continuous signal
▶ Sampling rate is given in the unit of hertz
► ��If a function x(t) contains no frequencies higher than B hertz, it
is completely determined by giving its ordinates at a series of
points spaced 1
2B
seconds apart�� –Shannon
▶ For example, consider the human hearing sense. The human
hearing range is about from 20 Hz to 20 kHz, so the sampling
frequency of audio signals must be at least 40 kHz to include all
audible frequencies (audio compact discs use 44.1 kHz,
telephones 16 kHz)
Signal Processing Domains
► Signals are usually studied in
▶ time-domain (with respect to time)
▶ frequency-domain (with respect to frequency)
▶ time and frequency domains simultaneously, using some
time-frequency representation (TFR)
► Fourier transforms can be used to transform signals from
time-domain to frequency-domain, and vice versa
► Time-frequency representations can be computed using
short-time Fourier transform (STFT) or wavelets
Discrete Fourier Transform
► The frequency-domain representation of a digital time-domain
signal x[t] can be calculated using the discrete Fourier transform
(referred as DFT or the analysis equation), defined as:
X[k] =
N−1
��
n=0
x[n]e−2��ik n
N
(1)
=
N−1
��
n=0
x[n][cos(−2��k
n
N
) + isin(−2��k
n
N
)]
(2)
where 0 �� k �� N − 1 and i is the imaginary unit. The equation
(2) is obtained through the Euler��s formula
ei�� = cos(��) + isin(��)
(3)
Inverse Discrete Fourier Transform
► The time-domain representation of a frequency-domain signal
X[k] can be calculated using the inverse discrete Fourier
transform (referred as IDFT or the synthesis equation), defined
as:
x[n] =
1
N
N−1
��
k=0
X[k]e−2��ik n
N
(4)
(5)
where 0 �� n �� N − 1 and i is the imaginary unit.
Fast Fourier Transform
► Fast Fourier transform (FFT) is ��the most important algorithm of
our lifetime��. It is needed at least for:
▶ Signal processing (convolution, digital filters)
▶ Fast multiplication of large integers
▶ Solving partial differential equations
▶ Magnetic resonance imaging (MRI)
► The computational complexity of the discrete Fourier transform is
O(N2) where N is the signal length
▶ FFT produces the exact same result in O(N log N) operations
FFT Butterfly Diagram
x0
x4
x2
x6
x1
x5
x3
x7
X0
X1
X2
X3
X4
X5
X6
X7
��
��
��
��
��
��
��
��
Magnitude and Phase Spectrums
► DFT is complex valued �� carries information about magnitude
and phase
► The magnitude spectrum of a frequency-domain signal X is
given by its absolute value |X|
► The phase spectrum of a frequency domain-signal X is given by
it argument arg(X)
Magnitude and Phase Spectrums of Normal ECG
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
5
−4
−2
0
2
Time / s
Amplitude / mV
Normal ECG
0
10
20
30
40
50
60
70
0
50
100
Frequency / Hz
Magnitude
Magnitude Spectrum
0
10
20
30
40
50
60
70
−200
−100
0
100
Phase / Rad
Frequency / Hz
Phase Spectrum
Convolution
► Discrete convolution of signals f and g is defined as:
(f ∗ g)[n] =
��
��
m=−��
f[n] · g[n − m]
(6)
=
��
��
m=−��
f[n − m] · g[m]
(7)
► The resulting new signal is usually viewed as a modified or
filtered version of one of the original signals
Convolution Theorem
► Convolution has an important property known as convolution
theorem. Given two signals f and g the convolution theorem
states that
F{f ∗ g} = F{f} · F{g}
(8)
where F is used to denote DFT. By applying IDFT, denoted by
F
−1, on the both hand sides of the equation (6) one gets
f ∗ g = F−1{F{f} · F{g}}
(9)
so it is possible to calculate convolution efficiently by using
Fourier tranforms.
Digital Filters
► Low-pass filters
▶ Pass low frequencies, attenuate high frequencies
► High-pass filters
▶ Pass high frequencies, attenuate low frequencies
► Band-pass filters
▶ Pass frequencies within a specified range, attenuate frequencies
outside that range
► Band-stop filters
▶ Attenuate frequencies within a specified range, pass frequencies
outside that range
► If a filter is linear and time-invariant, it is completely
characterized and best described by its frequency response
Frequency Response
► If a filter is linear and time-invariant, its frequency response is
given by either
▶ F{y}/F{x}, where x is the input signal and y the output signal
▶ By taking the Fourier transform of the impulse response of the filter,
which is the filter��s response to Kronecker��s delta
��(n) =
{
1, n = 0
0, n = 0