You can't use 'macro parameter character #' in math mode
$$
\def\sumi{\sum_{n = -\infty}^\infty}
\def\sinc{,\text{sinc}}
\def\sgn{,\text{sign}}
\def\arg{,\text{arg}}
\def\min{,\text{min}}
\def\Z{\mathbb{Z}}
\def\C{\mathbb{C}}
\def\N{\mathbb{N}}
\def\R{\mathbb{R}}
\def\H#1{\mathcal H{#1}}
\def\abs#1{,\lvert #1\rvert}
\def\norm#1{,\lVert #1\rVert}
$$
GNU General Public License v3.0 licensed. Source available on github.com/zifeo/EPFL.
Spring 2016: Signal Processing
[TOC]
-
signal : description of the evolution of a physical phenomenon
- processing
- analysis : understanding the information carried by the signal
- synthesis : creating a signal to contain the given information
- communication
- reception : analysis of an incoming signal
- transmission : synthesis of an outgoing signal
- processing
-
digital model
- discrete time :
- discrete amplitude : important for storage, processing, transmission
- storage :
- data transmission :
as quantized signals
- discrete time :
-
analog model
- continuous time :
- storage : paper, vinyl, VHS, silver plates
- data transmission :
with repeaters ( after each repetion to avoid noise multiplication)
- continuous time :
-
sampling theorem :
-
discrete-time signal : a sequence of complex numbers
noted as - analysis : periodic measurement
- synthesis : stream of generated samples
- delta signal :
- unit step :
- exponential decay :
with
-
signal classes
- finite-length :
- infinite-length :
- periodic :
, replicated finite-lenght - finite-support : finite-length completed with
's
- finite-length :
-
elementary operators
- scaling :
- sum :
- product :
- shift by
(delay) : , best with periodic extension (circular)
- scaling :
-
energy :
- periodic :
- periodic :
-
power :
- periodic :
- periodic :
-
DSP as building block
- adder :
- multiplier :
- delay :
giving - moving average :
- zero initial conditions : set a start time
, assume input and output are zero for all time before - recursion :
- zero initial conditions : set a start time
- adder :
-
Karplus-Strong algorithm :
with - build a recursion loop with a delay of
( -tap) : controls pitch - choose a signal
that is nonzero only for : controls color (timbre) - choose a decay factor :
controls envelope (decay) - input
to the system - play the output
- frequency :
with time associated to sample interval
- build a recursion loop with a delay of
-
vector spaces : usefull in approximation and compression, easy sampling, interpolation, Fourier Transform, fundamental in communication system design
- euclidian :
- linear algebra :
- space of square-summable infinite sequences :
- space of quare-integrable functions over an interval :
- inner product :
- inner product :
- once you know the properties are satisfied, you can use all the tools for the space
- ingredients
- set of vectors :
- set of scalars :
- set of vectors :
- properties :
are vectors - inner (dot) product :
-
with : orthogonal (maximally different) - defines a norm :
- norm defines a distance :
- mean square error :
- for signals :
, requires square-summable - pythagorean theorem :
for
- euclidian :
-
canonical basis : set of
vectors in a vector space with basis - linear combination :
with unique - unique representation implies linear independence :
- basis for functions over an interval :
with - orthogonal basis :
for - orthonormal bassis :
for (using Gram-Schmidt) - basis expansion :
- change of basis :
- if
orthnormal - parseval's theorm : energy is conserved across change of basis
- rotation matrix : $R=\begin{bmatrix}\cos\theta & \sin\theta \\ -\sin\theta & \cos\theta \end{bmatrix}$ with new coefficient
- if
- linear combination :
-
subspace : subset of vectors closed under addition and scalar multiplication
- approximation : less dimensionnal projection
- least-square approximation for subset
: (orthogonal projection) - has minimum-norm error :
- error orthogonal to approximation :
- has minimum-norm error :
-
Gram-schmidt : original set
orthonormal set -
for each step
-
Legendre polynormials : orthonormal basis for
, with naive basis -
Hilbert space : vector space
, inner product , completeness (limiting operations must yield vector space elements) - finite-length and periodic signals live in
- inifinte-length signals live in
- different bases are different observation tools for signals
- subspace projections useful in filtering and compression
- finite-length and periodic signals live in
-
time domain : linear combination of atomic time units
-
oscillations are everywhere
- sustainable dynamic systems exhibit oscillatory behavior
- things that don't move in circles can't last
- human receptors
- cochlea : ear, air pressure, frequencies between 20Hz and 20KHz
- rods and cones : retina, electromagnetic sinusoids, frequencies between 430THz to 790THz
- oscillatory heartbeat :
with frequency , initial phase , amplitude - complex exponential :
- periodic in
: with with - wagonwheel effect : max speed at
- digital frequency : how many samples before pattern repeats, no unit
- physical frequency : how many secondes before pattern repeats, hertz,
with samples of system clock
- frequency domain : as important as the time domain, hidden signal properties
-
fourier : simple change of basis, change of perspective
- analysis : express signal as combination of periodic oscillations, from time to frequency domain
- synthesis : create signal with frequency content, from frequency to time domain
- orthogonal basis :
(normalization ) - proof =
for otherwise - wrapping the phase :
by adding
- discrete fourier transform : DFT, numerical algorithm
-
matrix form basis change : $\begin{bmatrix}1 & 1 & 1 & \cdots & 1\\ 1 & W^1 & W^2 & \cdots & W^{N-1}\\ 1 & W^2 & W^4 & \cdots & W^{2(N-1)}\\ \vdots & \vdots & \vdots & \ddots & \vdots\\ 1 & W^{N-1} & W^{2(N-1)} & \cdots & W^{(N-1)^2}\end{bmatrix}$ with
- analysis :
- synthesis :
- hermitian :
conjugate transpose - dft :
- analysis :
- short-time fourier transform : STFT
-
discrete fourier series : DFS,
-periodic, equivalent to DFT of one period - analysis :
with - synthesis :
with
- analysis :
-
discrete-time fourier transform : DTFT, infinite signals, mathematical tool
- analysis :
, represented over with - synthesis :
- periodicity :
is -periodic, can be rescales times - splitting into chunks :
- signal symmetric : DTFT symmetric
- signal real : DTFT hermitian symmetric $x[n]=x^[n]\iff X(e^{j\omega})=X^(e^{-j\omega})$ (symmetric magnitude)
- signal symmetric real : DTFT symmetric and real
- analysis :
-
review DFT : numerical algorithm (computable)
-
review DFS
-
review DTFT : mathematical tool (proofs)
-
pulse train :
(Dirac delta in space of -periodic functions) -
embedding finite-length signals :
-tap signal, spectral DFT to infinite sequence - periodic extension :
- finite-support extension :
for otherwise - interval indicator signal :
when else 0 -
: smooth interpolation of DFT values -
: DTFT of interval signal
- interval indicator signal :
- periodic extension :
- zero-padding : pad data vector with 0's to obtain nicer plots, no information added
-
modulation :
baseband, , caution if too large -
demodulation :
- fast fourrier transform : FFT
-
LTI
- linearity :
- time invariance :
- linearity :
-
impulse response :
-
convolution : $x[n]h[n]=\sum_{k=-\infty}^\infty x[k]h[n-k]=<x^[k],h[n-k]>$
- algorithm : time-reverse
, center it in , compute inner product
- algorithm : time-reverse
-
moving average : MA,
- impulse reponse :
for - smoothing effect : proportional to
, # operations and storage
- impulse reponse :
-
leaky integrator : LI,
with leak - impulse response :
- smoothing effect : depends on
, constant operations and storage
- impulse response :
-
stability
- finite impulse response (FIR) : finite support, finite # of samples involved in the computation of each output, always stable
- infinite impulse response (IIR) : infinite support, infinite # of samples involed in the computation of each output (finite computation though)
- causal : impulse response zero for
, only past samples - noncausal : impulse response nonzero for
, need future samples - bounded-input bounded-output (BIBO) : require impulse response absolutely summable
- nice signal : bounded signal
-
frequency reponse : DTFT of impulse response determines the frequency characteristic of a filter
- eigensequences : complex exponentials, cannot change frequency of sinusoids
- convolution theorem : multiplication in frequency space
- amplitude : amplification when
or attentuation when - phase : overall delay, shape change
- zero phase :
- linear phase :
(almost linear phase on region of interest can do also the trick) - nonlinear phase : for example
- zero phase :
-
filter types (magnitude response)
- lowpass : basebands, MA, LI
- highpass
- bandpass
- allpass
-
filter types (phase response)
- linear phase
- nonlinear phase
-
ideal lowpass filter :
for otherwise ( -periodic implicit) -
ideal highpass filter :
for ( -periodic implicit) -
ideal bandpass filter :
for ( -periodic implicit) - impulse truncation
- window method : narrow mainlobe (transition sharp), small sidelobe (small error), short window (FIR efficient)
-
frequency sampling : take
of desired frequency response where , compute inverse DFT of , use to build (finite support) -
z-transform : power series, convergence always absolute
- analysis :
- synthesis :
- region of convergence : ROC, circular symmetry
- finit support signals : converge everywhere
- causal signals : extends outwards from circle touching largest magnitude pole, converge if ROC include unit circle
- independent of values of
: assume exists for -
: zeros of transfert function, glue sheet to ground -
: poles of transfert function, push sheet up
- constant coefficient difference equation :
give with
- analysis :
-
abstract filter implementation
- resonator : narrow bandpass filter, detect presence of sinusoid of given frequency, shift passband of LI
-
DC removal : DC balanced signal has zero sum, kill zero frequency
-
hum removal : remove a specific nonzero frequency
- fractional delay : compute in-between values for sample, ideal, approximated with local interpolation
-
Hilbert filter : allpass,
for or for , for odd otherwise
-
requirements
- frequency response : passband, stopband
- phase : overall delay, linearity
- limit on computational resources or precision
- determine
, , , : , hard nonlinear problem
- limitations
-
IIR
- pros : computationally efficient, strong attenuation easy, good for audio
- cons : stability issues, difficult to design for arbitrary response, nonlinear phase
- method : conversion fo analog design, deeply studied field
- butterworth : lowpass
- chebyshev : lowpass
- elliptic : lowpass
- magnitude response in decibels : filter attenuation expressed
with filter max passband
-
FIR
- pros : always stable, optimal design techniques exist, can be designed with linear phase
- cons : computationally much more expensive, may sound harsh
- method : optimal minimax filter design, algorithm for linear phase, equiriplle error in passband and stopband (proceeds by minimizing the maximum error)
- half length :
- even FIR :
taps - odd FIR :
taps - delay :
- FIR only have zeros : if
zero, so is and - type I :
, , - $H(z)=z^{-L}(h_d[0]+\sum_{n=1}^Lh_dn)$
- zero locations :
- type II :
- $H(z)=z^{-C}\sum_{n=0}^{L-1}hn$ with
- zero locations :
- always have zero : at
- $H(z)=z^{-C}\sum_{n=0}^{L-1}hn$ with
- type III
- $H(z)=z^{-L}\sum_n h_dn$
- always have zero : at
- type IV
-
Parks-McClellan algorithm : optimal, polynomial fitting
- magnitude response : equiriplle in passband and stopband
- design parameters : order
(number of taps), passband edge , stopband edge , ratio of passband to stopband error - design test criterion : width of transition band, stopband error
- Chebyshev polynomials :
- convert the space to
- minimize maximum error :
-
when else 0
- alternation theorem : min max works only if
alternates times in between - works also with weighting function :
when or else ( ) - weighted min max :
- max number of alternations :
- polynomial of degree
: local extrema -
and - sometimes :
or
- polynomial of degree
- in-band alternations :
- works also with weighting function :
- Remez algorithm : guess positions of alternations, if not satisfied find extrema or error and repeat
- algorithm :
filter coefficients, stopband and passband tolerances and , if error too big, increase and retry - eliptic vs 51-tap minimax
- design bandpass and highpass by modulating lowpass
-
system clock : at most
- record value :
- process value in causal filter
- output value :
- record value :
- buffering : interrupt for each samples would be too much overhead
-
input
-
output
- double buffering
- multiple buffering (> 2) for protection
-
echo
-
reverb : superposition of many echos with different delays and magnitudes, costly, cheap alternative is allpass
-
non-LTI effects
- distortion : clip signal
- tremolo : sinusoidal amplitude modulation
- flanger : sinusoidal delay
- wah : time-varying bandpass filter
- distortion : clip signal
-
gaussian random variable :
- mean :
- variance :
- mean :
-
uniform random variable :
- mean :
- variance :
- mean :
-
discrete uniform random variable :
- mean :
- variance :
- mean :
-
autocorrelation :
-
covariance :
- uncorrelated elements :
- independent elements :
- uncorrelated elements :
-
random vector
- cdf :
with - pdf :
- mean :
- cross-correlation :
- covariance matrix :
, symmetric, postive-definite, diagonal if uncorrelated or independent
- cdf :
-
gaussian random vector :
- mean :
- covariance matrix :
- uncorrelated elements : independent elements
- mean :
-
random process
- full characterization : all possible sets of
indices for all , too much - first-order :
time-varying mean - second-order : first order +
time-varying cross-correlation - ... : time-varying further moment
- full characterization : all possible sets of
-
stationarity : time-invariant partial-order descriptions
- mean : time-invariant
- correlation : depends only on time lag
- higher-order moments : depend only on relative time differences
-
wide-sense stationarity (WSS) : stationarity up to second-order descriptions
- mean :
- correlation :
- mean :
-
independent, identically distributed process (IID) :
- mean :
- correlation :
- mean :
-
power spectral density (PSD) : independent of pdf
- intuition :
- energy distributions in frequency :
- power distributions in frequency :
, aka density - frequency-domain representations for stochastic processes is power
-
: power is equally distributed over all frequencies, cannot predict how fast signal moves
- energy distributions in frequency :
- truncated DTFT :
- for signal :
- for WSS random process :
- intuition :
-
white noise : IDD
- zero mean : autocorrelation = covariance
-
additive white gaussian noise (AWGN) : IID, zero mean gaussian process, WSS
full stationary -
filter random process : output is WSS if input WSS
- mean :
- correlation :
- power distribution :
- deterministict signal filter : works in magnitude in stochastic case but concept of phase lost
- mean :
-
bridging two world : sampling and interpolation
-
continuous-time signal processing :
complex function of real variable with finite energy - analog LTI filters : $y(t)=(xh)(t)=<h^(t-\tau),x(\tau)>$
- fourier
-
convolution theorem :
-
bandlimitedness :
for -
interpolation : fill the gaps between samples
- requirement : decide interval
, make sure , make sure is smooth (infinitely differentiable)
- requirement : decide interval
-
polynomial interpolation :
points, polynomial of degree , -
-degree polynomial bases in interval - naive :
- Legendre basis : orthonormal, increasing degree
- Chebyshev basis : orthonormal, increasing degree
- Lagrange : interpolation property, same degree
- naive :
- consider symmetric interval :
- naive :
, , - space of degree-$2N$ polynomial over
: -
basis : Lagrange polynomials for - Lagrange interpolation :
- pros : maximally smooth
- cons : interpolation bricks depend on
-
-
zero-order interpolation :
, -
first-order interpolation :
-
third-order interpolation :
-
local interpolation :
-
sinc interpolation :
-
space of bandlimited functions :
-BL$\subset L_1(\R)$, hilbert space -
sampling theorem
- special case :
and - basis :
with - sampling as basis expansion :
- analysis :
- synthesis :
- sufficient representation :
with
- basis :
- general case :
- basis :
- analysis :
- synthesis :
- coefficient :
for any $x(t)\in\Omega_N-$BL - sufficient representation :
for any -BL
- basis :
- corollary :
-BL$\subset\Omega$-BL for any - sufficient representation :
for any -BL and any
- sufficient representation :
- hertz : any signal
bandlimited to $F_N$Hz can be sampled with no loss of information using sampling frequency (i.e. sampling period )
- special case :
-
sinc sampling
-
sinc sampling for
-BL signals -
raw sampling
-
raw sampling continuous-time complex expoential :
-
raw sampling arbitrary signal
-
sampling stategies : given a sampling period
- bandlimited to
or less : raw sampling is fine (equivalent to sinc sampling up to scaling factor ) - non-bandlimited
- bandlimit via a lowpass filter in continuous-time domain before sampling
- raw sample and incur aliasing - bandlimiting : optimal with respect to least squares approximation
- bandlimit via a lowpass filter in continuous-time domain before sampling
- aliasing : error cannot be controlled, better bandlimit
- bandlimited to
-
sinc sampling and interpolation
-
least squares approximation with sinc sampling and interpolation
- processing of analog signals
- advanced sampling
-
bandpass sampling : sampling theorem is only sufficient condition, in theory
what if signal is bandpass -
upsampling : zoom,
for else with -
downsampling : dezoom,
-
quantitzation : map range of signal onto finite set
- factors : storage budget (bits per sample), storage scheme (fixed, floating), input properties (range, distribution)
- irreversiable : quantization noise
- simplest quantizer : each sample encoded individually (scalar), quantized independently (memoryless), encoded using
bits - scalar :
, intervals - error :
, model error as white noise - uniform : interval
- unbounded : clip samples to
(linear distortion) vs smoothly saturate input (simulate saturation curves of analog electronics) - gaussian :
- Lloyd-Max algo : design optimal quantizer for distribution
- companders
- A/D converter : sampling discretizes time, quantization discretises amplitude
- D/A converter
-
digital image : two-dimensional
finite-support signal , pixel grid - grayscale : scalar pixel value
- color : multidimensional pixel value
- still works : linearity, convolution, fourier, interpolation, sampling
- breaks : fourier analysis less relevant, filter design hard, IIRs rare, linear operators only mildly useful
- news : affine transforms, finite-support signals, causality loses meaning
-
rect :
only if and else -
separable signals
- dirac :
- rect :
- dirac :
-
nonseparable signal :
if else -
2D convolution :
- operations :
per output sample
- operations :
-
2D convolution for separable signals : $x[n_1,n_2]h[n_1,n_2]=\sum_{k_1=-\infty}^\infty h_1[n_1-k_1]\sum_{k_2=-\infty}^\infty x[k_1,k_2]h_2[n_2-k_2]=h_1[n_1](h_2[n_2]*x[n_1,n_2])$
- operations :
per output sample
- operations :
-
affine transforms : mapping
that reshapes coordinate system - translation :
, $d=\begin{bmatrix}d_1 \\ d_2\end{bmatrix}$ - scaling : $A=\begin{bmatrix}a_1 & 0 \\ 0 & a_2\end{bmatrix}$,
- rotation : $A=\begin{bmatrix}\cos\theta & -\sin\theta \\ \sin\theta & \cos\theta\end{bmatrix}$,
- horizontal flips : $A=\begin{bmatrix}-1 & 0 \\ 0 & 1\end{bmatrix}$,
- vertical flips : $A=\begin{bmatrix}1 & 0 \\ 0 & -1\end{bmatrix}$,
- horizontal shear : $A=\begin{bmatrix}1 & s \\ 0 & 1\end{bmatrix}$,
- vertical shear : $A=\begin{bmatrix}1 & 0 \\ s & 1\end{bmatrix}$,
- discrete-space solution
- inverse transform :
- interpolate mid-points :
with and
- inverse transform :
- translation :
- bilinear interpolation
- 2D DFT
- image filtering
-
compression : exploit physical redundancy, allocate bits for things that matter
- lossy : some information discarded
- key : compressing at block level, using suitable transform (change of basis), smart quantization, entropy coding
- level compressing
-
smart quantization
- standard :
- deadzone :
- variable step : fine to coarse
- standard :
-
JPEG standard
- split image into 8x8 non-overlapping blocks
- computed DCT of each block
- quantize DCT coefficients according to psycovisually-tuned tables
- zigzag scan to maximize ordering
- run-length encoding : each nonzero value encoded as
, 8 bit per pair - runlength :
number of zeros before current value - size :
number of bits needed to encode value - actual value :
-
: indicates only zeros from now
- runlength :
- huffman coding
-
success factors
- DSP paradigm : integer easy to regenerate, good phase control, adaptive algo
- algo : entropy coding, error correction, trellis-coded modulation, viterbi
- hardware : miniatuziation, general-purpose platforms, power efficiency
- analog channel : affect capacity
- channel capacity : maximum amount of information that can be reliably delivered over a channel (bit per second)
- all-digital paradigm : keep everything digital until we hit physical channel
-
transmitter design
-
transmission reliability :
- error : depends on power of noise vs of signal, decoding strategy, alphabet
- signaling alphabet
- mapper : split incoming bitstream into chunks, assign symbol
from finite alphabet to each - slicer : receive value
, decide which symbol is closest, piece back blocks
- mapper : split incoming bitstream into chunks, assign symbol
- two-level signaling :
- signaling scheme
-
receiver
-
shannon capacity upperbound :
-
delay compensation :
, with and -
adaptive equalization : in theory
but change over time -
ADSL channel :
sub-channel, -QAM