ee123-notes
ee123-notes
Anmol Parande
Disclaimer: These notes reflect EE123 when I took the course (Spring 2020). They
may not accurately reflect current course content, so use at your own risk. If you
find any typos, errors, etc, please raise an issue on the GitHub repository.
Contents
1 The DFT 3
1.1 Convolution and the DFT . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.1 Circular Convolution . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1.2 Linear Convolution with the DFT . . . . . . . . . . . . . . . . 5
1.1.3 Block Convolutions . . . . . . . . . . . . . . . . . . . . . . . . . 5
1.2 FFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2.1 Decimation in Time . . . . . . . . . . . . . . . . . . . . . . . . . 7
1.2.2 Decimation in Frequency . . . . . . . . . . . . . . . . . . . . . 8
2 Spectral Analysis 8
2.1 Short Time Fourier Transform (STFT) . . . . . . . . . . . . . . . . . . . 9
2.2 Discrete STFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
2.3 Time-Frequency Uncertainty . . . . . . . . . . . . . . . . . . . . . . . . 10
2.4 Wavelets . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
2.4.1 Discrete Wavelet Transform . . . . . . . . . . . . . . . . . . . . 13
3 Sampling 13
1
3.1 Ideal Sampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
3.1.1 Nyquist Theorem . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.1.2 Discrete Time Processing of a Continuous Time Signal . . . . 16
3.1.3 Continuous Time Processing of Discrete Time Signals . . . . . 17
3.1.4 Downsampling . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1.5 Upsampling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
3.2 Multi-Rate Signal Processing . . . . . . . . . . . . . . . . . . . . . . . 18
3.2.1 Exchanging Filter Order During Resampling . . . . . . . . . . 19
3.2.2 Polyphase Decomposition . . . . . . . . . . . . . . . . . . . . . 19
3.3 Practical Sampling (ADC) . . . . . . . . . . . . . . . . . . . . . . . . . 20
3.3.1 Quantization . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3.4 Practical Reconstruction (DAC) . . . . . . . . . . . . . . . . . . . . . . 22
4 Filtering 23
4.1 Transform Analysis of LTI Systems . . . . . . . . . . . . . . . . . . . . 23
4.2 All Pass Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.3 Minimum Phase Systems . . . . . . . . . . . . . . . . . . . . . . . . . . 24
4.4 Generalized Linear Phase Systems . . . . . . . . . . . . . . . . . . . . 25
4.5 Filter Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
4.5.1 Windowing Method . . . . . . . . . . . . . . . . . . . . . . . . 26
4.5.2 Optimal Filter Design . . . . . . . . . . . . . . . . . . . . . . . 27
2
1 The DFT
Whereas the CTFT takes a continuous signal and outputs a continuous frequency
spectrum and the DTFT takes a discrete signal and outputs a continuous, periodic
frequecy spectrum, the Discrete Fourier Transform takes a discrete finite signal and
outputs a discrete frequency spectrum. This is useful for signal processing because
we cannot store infinite signals in a computer’s memory.
Definition 1 For a length N finite sequence {x[n]}0n−1 , the Discrete Fourier Transform of
the signal is a length N finite sequence {X[k]}0n−1 where
N −1
2π
X
X[k] = x[n]e−j N kn
n=0
One way to interpret the DFT is in terms of the Fourier series for a disrete periodic
signal x̃[n] = x[((n))N ] where the ((n))N = n mod N . Recall that the coefficient of
the kth term of the Fourier Series is
N −1
1 X 2π
ak = x[n]e−j N kn
N n=0
Notice that the ak of the Fourier Series are the DFT values except scaled by a factor
of N . In other words, if we extend a finite signal periodically, then the DFT and
the DTFS are the same up to a constant scale factor. This gives an intuitive inverse
DFT.
−1
Definition 2 For a length N finite sequence {X[k]}N 0 representing the DFT of a finite
N −1
perioidc signal {x[n]}0 , the inverse DFT is given by
N −1
1 X 2π
x[n] = X[k]ej N kn
N k=0
Notice that the DFT and the IDFT are very similar in form. It turns out that the
IDFT can be expressed as a DFT of X ∗ [k]. Namely
1
IDF T {X[k]} = DF T {X ? [k]}?
N
Further intuition for the DFT comes by relating it to the DTFT. Suppose we have a
finite signal x[n] which is 0 for n < 0 and n > N − 1. The DTFT of this signal is
∞
X N
X −1
−jωn
X(ω) = x[n]e = x[n]e−jωn
n=−∞ n=0
3
2π
Suppose we sample the DTFT at intervals of N
k, then the kth sample is given by
N −1
2π X 2π
X[k] = X k = x[n]e−j N kn
N n=0
Thus we can think of the DFT as a N evenly spaced samples of the DTFT. One im-
portant point to notice is that while the DTFT is often centered around 0 (meaning
it is plotted over a range from −π to π), because we are summing from 0 to N-1 in
the DFT, the DFT coefficients are centered around π, and thus they are plotted on
a range fo [0, 2π − 2π
N
]
When the DFT coefficients of two signals are multiplied, the resulting coefficients
describe a circular convolution of the original two signals.
The mechanics of the circular convolution are the same as that of the regular con-
volution, except the signal is circularly shifted as shown in fig. 1. A circular con-
4 4
x(n) x(((−n))N )
3 3
2 2
1 1
2 4 2 4
4
1.1.2 Linear Convolution with the DFT
Notice that if N is not large enough, then these copies will be overlapping (a.k.a
aliasing). Since the DFT is just sampling the DTFT, the circular convolution will
represent the true convolution so long as the copies don’t overlap.
In a discrete time system, the input signal might have a very long length, making
it impractical to be stored in a computer’s memory or to compute the DFT of it all
at once (especially if we have a real-time system). Thus to compute the output of a
digital filter (with impulse response of length P ), we need to compute the DFT in
blocks shorter than the signal.
The first method of block convolution is the overlap-add method.
5
2. Since convolution is linear,
X
y[n] = x[n] ∗ h[n] = xr [n] ∗ h[n].
r
1. Divide x[n] into sections of length L such that each section overlaps the pre-
vious by P − 1 points
xr [n] = x[n + r(L − P + 1) − P + 1] 0≤n≤L−1
1.2 FFT
Definition 4 The fast fourier transform is an algorithm which computes the DFT effi-
ciently in O(N log N ) time.
Definition 5 The Nth roots of unity are the complex roots of WNN = 1.
2πk
WNk = e−j N
6
The roots of unity have the following properties.
N
Theorem 3 When squared, the Nth roots of unity become the 2
th roots of unity.
WN2 = W N
2
Using theorems 1 to 3, we can take two approaches to the FFT: decimation in time,
which splits x[n] into smaller subsequences, and decimation in frequency which
splits X[n] into smaller subsequences.
The idea here is too break x[n] into smaller subsequences. We assume that N is a
power of 2 for simplicity.
N
X −1 X X
X[k] = x[n]WNkn = x[n]WNkn + x[n]WNkn
n=0 n even n odd
We let n = 2r and n = 2r + 1.
N N
2
−1 2
−1
X X k(2r+1)
X[k] = x[2r]WN2rk + x[2r + 1]WN
r=0 r=0
N N
−1
2 2
−1
X X
= x[2r]W Nrk + WNk x[2r + 1]W Nkr
2 2
r=0 r=0
These are just the DFTs of the even and odd elements of the signal!
7
N
Both G and H are 2
periodic, and notice that
k+ N 2π N
WN 2
= e−j N (k+ 2 ) = −WNk .
This means once we compute G[k] and H[k] we can compute X[k] easily because
k N k N
X[k] = G[k] + WN H[k] X k+ = G[k] − WN H[k] for k ∈ 0,
2 2
We can continue this relationship recursively downwards. Once we get too N = 2,
we can represet this as a simple butterfly operation:
X[0] = x[0] + x[1] X[1] = x[0] − x[1].
2 Spectral Analysis
w[n]
In real-world DSP systems, we are often converting a continuous time signal into a
discrete one via sampling (as shown in fig. 2). Because input is constantly stream-
ing in, we can’t process all of it at once, especially for real-time applications. That
is why we instead process blocks of length L at a time. This is accomplished by
multiplying our sampled signal by a window function w[n].
All window functions are real, even, and finite. This means they have real and
symmetric DTFTs. The most simply window is a box window (a sinc in the fre-
quency domain). When the signal is multiplied by a window, it amounts to a
periodic convolution in the frequency domain.
8
Definition 6 A periodic convolution of the two spectra X(ejΩ ) and W (ejΩ ) is given by
Z
jΩ 1
V (e ) = X(ejΩ )W (ej(Ω−ω) )dω
2π h2πi
This periodic convolution means our choice of window function has an impact on
our ability to resolve frequencies in the frequency domain.
1. If W (ejΩ ) has a wide “main lobe” at the DC frequencies, then the spectrum
of V (ejΩ ) will be blurred
2. If W (ejΩ ) has large “side lobes” at non DC frequencies, then spectral leakage
occurs because larger frequencies start bleeding into lower ones.
Another factor which impacts our ability to resolve frequencies in frequency do-
main is the length of the window. Because an L point DFT samples the DTFT at L
points, taking a larger window will resolve the DTFT better. If we don’t want to
increase the window length (because doing so would increase the latency of our
system), we can zero pad after windowing because zero padding has no impact on
the DFT besides sampling the DTFT at more finely spaced samples.
By looking at the DFT of a signal x[n], we only get the frequency information across
the entire duration of the signal. Likewise, just by looking at x[n], we get no fre-
quency information and only temporal information. The STFT is a tool to see both
at once.
The result is discrete on the temporal axis and continuous on the frequency axis. Comput-
ing the STFT requires a window function w[n].
Essentially, we slide a window function around x[n] and compute the DTFT at
every time point.
9
2.2 Discrete STFT
Our window is of length L, R is how much we shift the window around, and N ≥ L is the
DFT length we are taking.
Just like before, we take our window and slide it around the signal, computing
DFTs at every time point. If N > L, then we are essentially computing a zero-
padded DFT. The DSTFT produces a spectrogram which we can display digitally.
x[n − rL]
x[n] = .
wL [n − rL]
10
ω
2π
4· 5
2π
3· 5
2π
2· 5
2π
1· 5
2π
4· 5
2π
3· 5
2π
2· 5
2π
1· 5
t
N N N N
1· 5
2· 5
3· 5
4· 5
For each γ, Tx (γ) is the projection of the signal onto the basis vector φγ (t). We can
use Parseval’s relationship to see that
Z ∞
Tx (γ) = hx(t), φγ (t)i = x(t)φ?γ (t)dt
−∞
Z ∞
1
= X(jΩ)Φ?γ (jΩ)dΩ
2π −∞
1
= hX(jΩ), Φλ (jΩ)i.
2π
This means that we can think of our transform not only as a projection of the signal
onto a new basis, but also as a projection of the spectrum of our signal onto the
spectrum of our basis function. Remember that projection essentially asks ”How
much of a signal can be explained by the basis”. We can formalize this by looking
11
at the signal in a statistical sense and treat it as a probability distribution.
Z ∞ Z ∞
2 1
mt = t|ψ(t)| dt mΩ = Ω |Ψ(jΩ)|2 dΩ
2π
Z−∞∞ Z−∞∞
1
σt2 = (t − mt )2 |ψ(t)|2 dt σΩ2 = (Ω − mΩ )2 |Ψ(jΩ)|2 dΩ
−∞ −∞ 2π
mt and mΩ are the means of the signal and the spectrum. σt2 and σΩ2 are the vari-
ances. Together, they localize where our signal ”lives” in the time-frequency spec-
trum. The uncertainty principle says
1
σt σw ≥ .
2
This means there is nothing we can do to get completely accurate time resolution
and frequency resolution, and any decisions we make will lead to a tradeoff be-
tween them.
2.4 Wavelets
While the STFT gives us a better picture of a signal than a full-length DFT, one of
its shortcomings is that each coefficient is supported by the same amount of time
and frequency. Low frequencies don’t change as much as high frequencies do, so a
lower frequency needs to be resolved with more time support whereas a fast signal
would requires less time support to resolve properly.
Definition 10 The Wavelet transform finds coefficients which tile the time-frequency spec-
trum with different time and frequency supports using a mother and father wavelet.
Z ∞
1 ? t−u
W f (u, s) = f (t) √ Ψ dt
−∞ s s
The Wavelet transform essentially makes all of the boxes in fig. 4 different sizes.
Definition 11 The mother wavlet is a scaled bandpass filter Ψ(t) used for the kernel of the
wavelet transform. It must have the following properties:
Z ∞ Z ∞
2
|Ψ(t)| dt = 1 Ψ(t)dt = 0
−∞ −∞
12
We need an infinite number of functins to fully represent all frequencies properly,
but at a certain level, we don’t care about our ability to resolve them better, so
we stop scaling and use a low frequency function Φ(t) to ”plug” the remaining
bandwidth.
Definition 12 The father wavelet is a low frequency function Φ(t) used to “plug” the
remaining bandwidth not covered by the mother wavelet.
The d coefficients are the detailed coefficients and are computed using the mother
wavelet. The capture higher frequency information. The a coefficients are the
approximate coefficients computed using the father wavelet. They represent lower
frequency information. The time frequency tiling for the DWT looks like fig. 5.
Notice how each wavelet coefficient is supported by a different amount of time
ω
d0,0 d0,1 d0,2 d0,3
d1,0 d1,1
d2,0
a2,0
and frequency. We can choose different mother and father wavelets to describe
our signals depending on how we want to tile the time-frequency plane.
3 Sampling
13
(where xc is our continuous signal). This is done by passing the signal through an
Analog-To-Digital converter. From there we can do discrete time processing and
reconstruct our signal by passing it through a Digital-to-Analog converter with
reconstruction period Tr .
Ts Tr
What this tells us is that the Fourier Transform of our sampled signal is a series of
copies of X(jΩ), each centered at kΩs where Ωs = 2π T
. This is a good model because
we can equivalently write the CTFT of the impulse train sampled signal as
Z ∞ X ∞ ∞
X
Xp (jΩ) = x(t)δ(t − kT ) x(kT )e−jkT Ω .
−∞ k=−∞ k=−∞
This means that the DTFT of our signal is just a bunch of shifted copies, and the
frequency axis is scaled so Ωs → 2π.
14
3.1.1 Nyquist Theorem
To analyze this further, we will stay in continuous time. Lets say that our original
signal has the following Fourier Transform. Notice the signal is band-limited by
ΩM . There are two major cases: if Ωs > 2Ωm and Ωs < 2Ωm .
Xp (jΩ)
1
Ω
−1Ωm 1Ωm
Case One: Ωs > 2Ωm . As shown in fig. 8, the shifted copies of the original X(jΩ)
Xp (jΩ)
1
T
Ω
(−Ωs − Ωm ) −Ωs (−Ωs + Ωm −1Ω
) m 1Ωm (Ωs − Ωm ) Ωs (Ωs + Ωm )
(shown in blue) do not overlap with each other or with the original copy. If we
wanted to recover the original signal, we could simply apply a low pass filter to
isolate the unshifted copy of X(jΩ) and then take the inverse Fourier Transform.
Case Two: Ωs < 2Ωm Notice how in fig. 9, the shifted copies overlap with the
Xp (jΩ)
1
T
Ω
−Ωs Ωs
original X(ω). This means in our sampled signal, the higher frequency information
is bleeding in with the lower frequency information. This phenomenon is known
as aliasing. When aliasing occurs, we cannot simply apply a low pass filter to
isolate the unshifted copy of X(ω).
When Ωs = 2ΩM , then our ability to reconstruct the original signal depends on
the shape of its Fourier Transform. As long as Xp (jkΩm ) are equal to X(jΩm ) and
15
X(−jΩm ), then we can apply an LPF because we can isolate the original X(jΩ)
and take its inverse Fourier Transform.
Remember that an ideal low pass filter is a square wave in the frequency domain
and a sinc in the time domain. Thus if we allow
T |Ω| < Ωs
2
Xr (jΩ) = Xp (jΩ) ·
0 else
then our reconstructed signal will be
∞
t X t − nT
xr (t) = xp (t) ∗ sinc = X(nT ) sinc .
T n=−∞
T
This is why we call reconstructing a signal from its samples ”sinc interpolation.”
This leads us to formulate the Nyquist Theorem.
As long as the DT system we apply is LTI, the overall CT system will be linear too,
but it will not necessarily be time invariant because sampling inherently depends
on the signal’s timing. If we want to find the overall CT transfer function (ω = ΩT )
of a system like that depicted in fig. 6.
ω
Yd (ejω ) = Hd (ejω )Xd (ejω ) = Hd (ejω )Xp
T
jΩT jΩT
Yp (jΩ) = Yd (e ) = Hd (e )Xp (jΩ)
T |Ω| < Ωs T H (ejΩT )X (jΩ) |Ω| < Ωs
2 d p 2
Y (jΩ) = · Yp (jΩ) =
0 |Ω| ≥ Ωs 0 |Ω| ≥ Ωs
2 2
This shows us that as long as the Nyquist theorem holds, we can process continu-
ous signals with a disrete time LTI system and still have the result be LTI.
16
3.1.3 Continuous Time Processing of Discrete Time Signals
While not useful in practice, it can be useful to model a discrete time transfer func-
tion in terms of Continuous Time processing (e.g a half sample delay).
Tr Ts
3.1.4 Downsampling
What this means is to obtain the new DTFT, we need to scale the frequency axis
π
so M → π. To prevent aliasing when this happens, we include an LPF before the
downsample step.
17
x[n] LPF: y[n] = x[nM ]
π ↓M
ωc = M
3.1.5 Upsampling
In the frequency domain, this looks like compressing the frequency axis so π → Lπ
and then taking a low pass filter. The gain of L is used to scale the spectrum so it
18
x[n] LPF: y[n]
↑L ωc = ↓M
π π
min M ,L
Notice that resampling with a very small change wastes a lot of computation. For
example, resampling with T 0 = 1.01T would upsample by 100 and then throw
away most of those samples when we downsample. Thus it would be useful to
exchange the order of operations when resampling to save computation. During
1
↑L H(z) ≡ H(z L ) ↑L
upsampling, we convolve our filter with a bunch of zeros caused by the expansion.
Convolution with 0’s is a unnecessary, so instead we could convolve with a com-
1
pressed version of the filter. Notice the results will be the same as long as H(z L )
is a rational function, During downsampling, we do a convolution and then throw
1
H(z) ↓M ≡ ↓M H(z M )
away most of our results. It would be much more efficient to instead compute only
the quantities we need. This is accomplished by downsmapling first and then con-
1
volving. Just like before, the results are only going to be the same if H(z M ) is a
rational function.
The problem with interchanging filters is that it is not always possible. Most filters
are not compressible. However, we can get around this issue and still get the effi-
ciency gains of interchanging filter orders by taking a polyphase decomposition of
our filters. First notice that h[n] can be written as a sum of compressible filters.
M
X −1
h[n] = hk [n − k]
k=0
This means if we let ek [n] = hk [nM ], we can utilize the linearity of convolution to
build a bank of filters. Now each of our filters is compressible, so we can switch the
19
4 4 4
h(n) h1 (n) h2 (n)
3 3 3
2 2 2
1 1 1
1 2 3 4 1 2 3 4 1 2 3 4
x[n] E0 (z M )
y[n]
z −1 E1 (z M ) + ↓M
.. ..
. .
z −1 EM −1 (z M )
x[n] ↓M E0 (z)
y[n]
z −1 ↓M E1 (z) +
.. ..
. .
z −1 ↓M EM −1 (z)
Figure 18: Filter bank but with the downsampling done first
order of downsampling and filtering while maintaining the same output. Now for
any filter, we can compute only what we need, so the result is correct and efficently
obtained.
20
quantize. However, sharp analog filters are difficult to implement in practice. To
Ts
deal with this, we could make the anti-aliasing filter wider, but this would add
noise and interference. If we keep the cutoff frequency the same, then we could
alter part of the signal because our filter is not ideal. A better solution is to do the
processing in Discrete Time because we have more control. We also sample higher
than the Nyquist Rate and then downsample it to the required rate.
3.3.1 Quantization
If we have a dynamic range of Xm (i.e 2Xm is the length of the range of values
we can represent), then our step between quantized values is ∆ = X2Bm , assuming
we are representing our data as 2’s complement numbers with B bits. We model
the error caused by quantization as additive noise. Our quantized signal x̂[n] is
decribed by
−∆ ∆
x̂[n] = x[n] + e[n] ≤ e[n] ≤
2 2
We do this under the following assumptions:
4. e[n] ∼ U −∆ ∆
2
, 2
21
For rapidly changing signals with small ∆, this assumptions hold, and they are
useful in modeling quantization error. Since ∆ = 2−B Xm
∆2 2−2B Xm
2
σe2 = =
12 12
This means our Signal to Noise Ratio for quantization is
2
σx Xm
SN RQ = 10 log = 6.02B + 10.8 − 20 log
σe2 σs
What this tells us is that every new bit we add gives us 6dB in improvement. It also
tells us that we need to adapt the range of quantization to the RMS amplitude of
the signal. This means there is a tradeoff between clipping and quantization noise.
When we oversampling our signal, we can further limit the effects of quantization
noise because this noise will be spread out over more frequencies and the LPF
2
will eliminate noise outside the signal bandwidth. This makes σMe the new noise
variance (if we oversample by M ). Thus we can modify the SN RQ equation
Xm
SN RQ = 6.02B + 10.8 − 20 log + 10 log M.
σs
This shows that doubling M yields a 3dB improvement (equivalent to 0.5 more
bits).
In the ideal case, we reconstruct signals by converting them to impulses and then
convolving with a sinc. However, impulses are require lots of power to generate,
and sincs are infinitely long, so it is impractical to design an analog system to do
this. Instead, we use an interpolation like Zero-Order-Hold to pulses and then
filter with a reconstruction filter.
x[n] xr (t)
H0 (jΩ) Hr (jΩ)
22
4 Filtering
LTI filters are characterized by their impulse response. The two broad categories
of LTI systems are those with finite impulse responses (FIR) and those with in-
finite impulse responses (IIR). LTI systems are frequently characterized by linear
constant-coefficient difference equations which look as follows:
N
X M
X
ak y[n − k] = x[n − k].
k=0 k=0
Definition 13 The system function H(z) is the z-transform of the impulse response of the
system. For LCCDE’s, it is a ratio of polynomials in z −1 .
PM −i
QM
k=0 bi z b0 (1 − ck z −1 )
H(z) = PN −i
= Qk=1
N
k=0 ai z a0 k=1 (1 − dk z −1 )
We call ck (the roots of the numerator) the zeros of the system and dk (the roots of the
denominator) the poles of the system.
Definition 14 The Magnitude Response |H(ejω )| desribes how the system will scale a
complex exponential.
|b0 | M −jω
Q
jω k=1 |1 − ck e |
|H(e )| = QN
|a0 | k=1 |1 − dk e−jω |
Definition 15 The Phase Response arg[H(ejω )] describes how the system will shift the
phase of a complex exponential.
M
X N
X
arg[H(ejω )] = arg[b0 ] + arg[1 − ck e−jω ] − arg[a0 ] − arg[1 − dk e−jω ]
k=1 k=1
Definition 16 The Group Delay of the system grd[H(ejω )] tells us how much a complex
exponential will be delayed.
M N
d X
−jω
X
jω
grd[H(e )] = − jω
arg[H(e )] = grd[1 − ck e ] − grd[1 − dk e−jω ]
dω k=1 k=1
23
We can systematically analyze these by drawing a vector from e−jω to each dk or
ck and analyze each one individually. For example, if we look at one pole in the
magnitude response
|1 − dk e−jω | = |ejω − dk | = |vk |.
In general, the effects of poles and zeros on each of these quantities is described by
the following table.
These effects are larger when ck or dk are close the unit circle (i.e |ck |, |dk | ≈ 1).
Definition 17 All pass systems are those where |H(ejω )| = k where k is some constant
gain.
Mr M
Y z −1 − dk Yc (z −1 − e?k )(z −1 − ek )
H(z) = k
k=1
1 − dk z −1 k=1 (1 − ek z −1 )(1 − e?k z −1 )
Their Z-transform has the real poles dk cancelled by real zeros, and complex poles
ek cancelled by the conjugates e?k .
What this means is that all poles are zeros must be inside the unit circle, and the
region of convergence is right sided. Minimum phase systems are called minimum
phase because of all H(z) with the same magnitude response, a minimum phase
system has the minimum phase and the minimum group delay.
Theorem 6 Any stable and causual system can be decomposed into a minimum phase
system and an all-pass system.
H(z) = Hmin (z)Hap (z)
24
This is useful because if a signal undergoes a distortion, we can at least undo the
minimum phase part of it (since Hmin has a guaranteed inverse).
If we limit ourselves to using FIR filters, then a GLP system must have either even
or odd symmetry, meaning for some M
Because of their symmetry, FIR systems are limited in where their zeros.
In other words, if a = rejθ is a zero, then a1? is too. We can decompose GLP systems
into a minimum phase, maximum phase, and unit circle system.
25
4.5 Filter Design
The idea of filter design is to take a desired frequency response and design a fil-
ter which has that frequency response. Some frequency responses can only be
described by IIR systems which are impractical for real applications, so we make
various tradeoffs when we design FIR filters to implement in our systems. We also
like our filters to be causal because it makes them usable in real-time systems.
A Mth order causal filter has M + 1 coefficients.
Definition 21 The time-bandwidth product describes how sinc-like a filter looks like.
ωc
T BW = (M + 1)
π
The TBW is also the number of zero-crossings in the impulse response (including
the zeros crossings at the end of the filter). To generate a High Pass filter, we can
design a Low-Pass filter and then modulate it
One way to generate a filter which matches a desired frequency response is through
windowing.
The length of the window impacts the transition width (how long it takes to tran-
sition). A longer window means a smaller width. The window type will impact
the ripples in the frequency response. The choice of of window and its sidelobes
impact these magnitudes.
26
4.5.2 Optimal Filter Design
With optimal filter design, we set up constraints to find a Hd (ejω ) which approxi-
mates H(ejω ) based on our optimization requirements. In general, we have some
regions Wc ⊆ [0, π] that we care about and other regions that we don’t care about.
We can first design a noncausal filter H(e ˜jω ) and then shift it to make it causal.
We do this by sampling and discretizing the frequency response to ωk = k πp where
−π ≤ ω1 ≤ ... ≤ ωp ≤ π. We choose P to be sufficiently big and make sure the
ωk ∈ ωc (the region we care about). In a least squares setup, we can solve
−jω1 (−N ) −jω1 (N ) jω1
e ... e H(e )
.. . ..
argmin ||Ah̃ − b||2
A= . . . ~
b=
. . . .
h̃
−jωp (−N ) −jωp (N ) jωp
e ... e H(e )
Another optimization technique is the min-max ripple design where we try and
control the deviations of the filter from the desired response. We can set up a
linear program to do this for us. For example, if we were designing a low pass
filter, we could write the LP
min δ
1 − δ ≤ Hd (ejωk ) ≤ 1 + δ 0 ≤ ωk ≤ ωc
jωk
−δ ≤ Hd (e )≤δ ωc ≤ ωk ≤ π
δ>0
27