Beruflich Dokumente
Kultur Dokumente
1 Classification of signals
A signal is a function representing a physical quantity or variable,
and typically it contains information about the behavior or nature
of the phenomenon.
Mathematically, a signal is represented as a function of an independent
variable t. Usually t represents time. Thus, a signal is denoted by x(t).
Mainly we talk about continuous-time and discrete-time signals.
A signal x(t) is a continuous-time signal if t is a continuous variable.
Continuous-time signals are also known as analog signals.
If t is a discrete variable, that is, x(t) is defined at discrete times, then x(t)
is a discrete-time signal. A discrete time signal is often denoted by {xn } or x[n],
where n = integer. Discrete-time signals are also known as digital signals.
1
The normalized average power, then, is simply defined as
Z T
1 2
P = lim |x(t)| dt
T →∞ 2T −T
2
1.2 Periodic signals
Definition 5 A continuous-time signal is said to be periodic with period T if
there is a positive nonzero value of T for which
Periodic signals are power signals, and the normalized average power can be
computed over one period.
Z T
1 2
P = |x(t)| dt
T 0
1.3 Convergence
For any given sequence of functions {xn (t)} so that ∀n, xn (t) : I → E with the
limit function x(t) we can define the following:
Definition 6
Convergence at a given point
∀ > 0, ∃n0 ∈ N : ∀n > n0 ⇒ |xn (t) − x(t)| <
Uniform convergence
∀ > 0, ∃n0 ∈ N : ∀n > n0 , ∀t ∈ I ⇒ |xn (t) − x(t)| <
3
2 L1 and L2 spaces
Definition 8 A given set A ⊂ R is said to be a null set if
∀ > 0, ∃{In } (a series of lengths) so:
S
• A ⊂ n∈N In
P
• n∈N length(In ) <
< f, g >= 0
Example
I = (0, T0 )
{fn } : I → R, t 7→ cos( 2Πnt
T0 )
{gn } : I → R, t 7→ sin( 2Πnt
T0 )
It is clear that
cos( 2Πnt 2Πnt
R
∀m, n 6= 0, < fn , gn >= I T0 )sin( T0 )dt = 0
∀n, ∀m 6= n, < fn , fm >= 0
∀n, ∀m 6= n, < gn , gm >= 0
4
Definition 13 Let H be a subspace of L2 (I). It is said that the series {ϕn }
is an orthonormal basis if:
• {ϕn } is a basis in H.
• ∀n, ∀m 6= n, < ϕn , ϕm >= 0
• ∀n, kϕn k = 1
5
3 Fourier series
Let H be a subspace of L2 (I), where I = (0, T ) ⊂ R. The following set of
functions {f0 , fn , gn } is an orthonormal basis in H when:
f0 : I → R t 7−→ √1
T
fn : I → R t 7−→ √2 cos( 2Πnt
T T ), n > 0
P∞ 2Πnt
Definition 15 ∀x(t) ∈ H, x(t) = a0 + n=1 (an cos( T ) + bn sin( 2Πnt
T )),
Where
RT
a0 = T1 · 0 x(t)dt
RT
an = T2 · 0 x(t) · cos( 2Πnt
T )dt
2
RT 2Πnt
bn = T · 0 x(t) · sin( T )dt
One more set of function that is a basis in H is the set of complex exponential
2πint
functions ϕn (t) = {e T } and ∀x(t) ∈ H,
2πint RT −2πint
x(t) = n∈Z Cn e T , Where: Cn = T1 · 0 x(t)e T dt
P
an −ibn
Cn = 2 , n≥0
an +ibn
C−n = 2 , n≥0
3.1 Convolution
In mathematics convolution is a mathematical operator which takes two func-
tions x and h and produces a third function that, in a sense, represents the
amount of overlap between x and a reversed and translated version of h.
The importance of the convolution operation in LTI (Linear, Time Invariant)
systems (which will be discussed further on) stems from the fact that knowledge
6
of the response of an LTI system to the unit impulse input allows us to find its
output to any input signals.
In general, given a signal x and a system h, the operation of the system on the
signal is the convolution of x and h.
The convolution of two discrete-time signals x[n] and h[n] is denoted by:
∞
X
(x ∗ h)(n) = x(n − k) · h(k)
k=−∞
2. Associative: (x ∗ h) ∗ g = x ∗ (h ∗ g)
3. Distributive: (x + h) ∗ g = x ∗ g + h ∗ g
4. Differentiability: (x ∗ h)0 = x0 ∗ h = x ∗ h0
7
4 Fourier Transform
Fourier transform converts time-domain signals into frequency-domain
(or spectral) representations. In addition to providing spectral representations
of signals, Fourier analysis is also essential for describing certain types of systems
and their properties in the frequency domain.
where Z T
1 −2πint
Cn = · x(t)e T dt
T 0
Since (in our course) we consider all signals to be finite signals (i.e. x(t) = 0
outside a given interval - I) we can rewrite the above equation
Z ∞
1 −2πint
Cn = · x(t)e T dt
T −∞
R∞
Let us define T = u and X(u) = −∞ x(t)e−2πiut dt.
1
Therefore we get
1
Cn = · X(nu) (2)
T
Substituting Equation (2) in (1) yields
X 1
x(t) = · X(nu)e2πinut
T
n∈Z
X
x(t) = X(nu)e2πinut · u (3)
n∈Z
As T → ∞ u → 0 , thus
X
x(t) = lim x(t) = lim X(nu)e2πinut · u
T →∞ u→0
n∈Z
8
X(u) is usually denoted as F[x(t)](u) or X(u) or x̂(u).
x(t) can be expressed as F −1 [X(u)](t) .
If x(t) is a real signal, then from the third property we get X(u) = X(−u)
so |X(u)| = X(−u) and ψ(u) = −ψ(−u).
Hence, the amplitude spectrum |X(u)| is an even function and the phase
spectrum ψ(u) is an odd function of u .
Additional properties
(for F[x(t)](u) = X(u))
8. Differentiation in the Time Domain: F[x0 (t)](u) = 2πuX(u)
9. Convolution: Given that F[x(t)](u) = X(u) and F[h(t)](u) = H(u)
then F[(x ∗ h)(t)](u) = X(u) · H(u)
9
Theorem 18 (Parseual’s theorem/energy theorem)
Z ∞ Z ∞
2 2
E= |x(t)| dt = |X(u)| du
−∞ −∞
2
|X(u)| is often referred to as the spectral energy-density of x(t).
The higher the energy-density for a given frequency u0 the higher its weight in
x(t).
Proof
Z Z Z Z Z Z
2 −2πiut
|X(u)| du = X(u)X(u)du = ( x(t)e )X(u)dtdu = x(t)dt X(u)e−2πiut du =
R R R R R R
Z Z Z Z
2
= x(t)dt X(u)e2πiut du = x(t)x(t)dt = |x(t)| dt
R R R R
The higher the joint energy is, the bigger the similarity between the two signals.
From the last definition we obtain that the joint energy isn’t the best tool to
measure similarity between two signals. Given the signals x(t) where
x(t) = 0, ∀t ∈
/ [a, b] and h(t) = x(t − b) the joint energy equals zero even though
the two signals are identical.
Therefore we need another way to measure similarity.
Definition 20 The cross-correlation between two signals is a function defined
as Z
τ :R→R x(t + τ )h(t)dt = Rx,h (τ )
R
So we can now more accurately say The higher the correlation, the bigger the
similarity between the two signals.
Proof
Z Z Z Z Z
F[Rx,h ](u) = Rx,h e−2πiuτ dτ = ( x(t+τ )h(t)dt)e−2πiuτ dτ = h(t)dt x(t+τ )e−2πiuτ dτ =
R R R R R
Z Z Z Z Z Z
−2πiu(y−t) −2πiuy
h(t)dt x(y)e dy = h(t)dt 2πiut
e x(y)e dy = h(t)e 2πiut
dt x(y)e−2πiuy dy =
R R R R R R
Z Z
h(t)e−2πiut dt x(y)e−2πiuy dy = H(u)X(u)
R R
10
4.4 Dirac delta function - The unit impulse function
The function part of its name might be confusing but the Dirac delta function
is a generalized function .
4. δ(−t) = δ(t).
5. (x ∗ δa )(t) = x(t − a).
Conclusions
R
• x(t) = R
x(τ )δ(t − τ )dτ = (x ∗ δ)(t).
• The convolution (x ∗ δa )(t) results in shifting x(t) by the value a.
The Fourier transform of δ(t) is easily calculated to be:
Z
F[δ(t)](u) = δ(t)e−2πiut dt = 1
R
Using the inverse transform we can write
Z
−1
F [1](t) = δ(t) = e2πiut du
R
and therefore getting two more important identities:
1. F[δa (t)](u) = e−2πiua
1 1
F[x(t)](u) = (F[e2πiat ](u) + F[e−2πiat ](u) = (δ(u − a) + δ(u + a))
2 2
11
Definition 22 A Dirac comb (also known as an impulse train or sampling
function) is a periodic function, constructed from Dirac delta functions, with a
period T as an interval between them.
We shall denote Dirac’s comb by ∆T (t) or ΠT (t).
X
∆T (t) = ΠT (t) = δ(t − nT )
n∈Z
Since the Dirac comb function is periodic (with the period T), it can be
represented as a Fourier series:
n
X
∆T (t) = cn e2πit T
n∈Z
where
Z T Z T
1 2 n 1 X 2 n
cn = ∆T (t)e−2πit T dt = δ(t − nT )e−2πit T dt =
T − T2 T − T2
n∈Z
Z T
1 2 1
= δ(t)dt =
T − T2 T
yielding
1 X 2πit n
∆T (t) = e T
T
n∈Z
e2πitnT or:
P
From the last equation we can learn that ∆ T1 (t) = T n∈Z
X
∆ T1 (u) = T e2πiunT
n∈Z
12
5 Systems and Filters
A system is a mathematical model of a physical process that relates the input
signal to the output (or response) signal.
If the input and output signals are continuous-time signals, then the system is
called a continuous-time system. If the input and output signals are discrete-
time signals or sequences, then the system is called a discrete-time system.
A system is represented as a transformation of x(t)/x[n] to y(t)/y[n].
The mathematical notation is y = S(x), where S is viewed as an operator
representing some well-defined rule by which x is transformed into y.
13
Proof
R
We know that x(t) = (x ∗ δ)(t) ⇔ R x(t − τ )δ(τ )dτ . Suppose y(t) = S(x),
where S is a LTI system then we get:
Z
y(t) = S( x(t − τ )δ(τ )dτ )
R
Note: S is a system that depends only on the variable t therefore using linearity
again
Z Z Z
S(x(y)δ(t − y))dy = x(y)S(δ(t − y))dy = x(y)h(t − y)dy = (x ∗ h)(t)
R R R
5.3 Filters
The term filter is often used to refer to a discrete-time system. A digital filter
is defined as a “. ..computational process or algorithm by which a sampled
signal or sequence of numbers (acting as the input) is transformed into a second
sequence of numbers termed the output signal. The computational process may
be that of low-pass filtering (smoothing), bandpass filtering, interpolation, the
generation of derivatives...” (by J. E Kaiser ).
Filters may be characterized in terms of their system properties, such as
linearity, time-invariance, causality and stability, and they may be classified in
terms of the form of their frequency response.
14
6 Sampling
Most discrete-time signals come from sampling a continuous-time signals. The
process of converting these signals into digital form is called analog-to-digital
(A/D) conversion. The reverse process of reconstructing an analog signal from
its samples is known as digital-to-analog (D/A) conversion.
An A/D converter transforms an analog signal into a digital sequence. The
input xc (t), is a real continuous signal/function .
The output of the A/D is a bit stream that corresponds to a discrete-time
sequence, x[n], with an amplitude that is quantized, for each value of n, to one
of a finite number of possible values.
F 1 1 X n
xd (t) = xc (t) · ∆T (t) → Xd (u) = (Xc ∗ ( ∆ T1 ))(u) = Xc (u − )
T T T
n∈Z
note:
15
Figure 1: Magnitude of Xd (u)
1
If the frequency content of xc (t) ranges from u1 to u2 and if 2T ≥ u2 then
reconstruction is doable without any loss of information.
1
If 2T < u2 then we can not reconstruct the original signal xc (t) and the area
1
between 2T to u2 is called ’aliasing’.
Figure 2: Aliasing
Xc (u) = Xd (u) · R 2T
1 (u)
where
1
1 if |u| < 2T
1 (u) =
R 2T
0 otherwise
16
Figure 3:
Summary
So far we’ve learned that in order to sample a continuous signal x(t) it must be
considered as a finite signal (sampling is only done over a finite period of time).
furthermore, its frequency content must be finite as well (i.e given x(t) and X(u)
M will determine the sample rate needed in order not to loose any information
Therefore given an infinite signal x(t) its sampling process will follow:
LPF - This will make sure there are no “frequencies” higher then a given
value u = M .
17
7 DFT - Discrete Fourier Transform
The discrete Fourier transform (DFT) is one of the most common, and power-
ful, procedures encountered in the field of digital signal processing. The DFT
enables us to analyze, manipulate, and synthesize signals in ways not possible
with continuous (analog) signal processing.
The DFT is a mathematical procedure used to determine the frequency, content
of a discrete signal sequence.
As said earlier, given an arbitrary continuous signal xc (t), it can be sampled
into a discrete signal
X
xd (t) = xc (t) · ∆T (t) = xc (nT )δ(t − nT )
n∈Z
1
where x
cd (u) = x
cd (u + T ).
It must be stated that DFT contains all the information that lies in x
cd (u).
Without loss of generality we will from now on decide T = 1.
Note that the DFT actually samples the Fourier transform of xd (t).
The frequencies analyzed (meaning - sampled) are
k · fs k k
uanalyzed = = = , k = 0, 1, 2, . . . , N − 1
N TN N
18
7.1 DFT leakage
As it turns out, the DFT of sampled real-world signals provides frequency-
domain results that can be misleading. A characteristic, known as leakage,
causes our DFT results to be only an approximation of the true spectra of the
original input signals prior to digital sampling. Although there are ways to
minimize leakage, we can’t eliminate it entirely. Thus, we need to understand
exactly what effect it has on our DFT results.
DFT’s are constrained to operate on a finite set of N input values sampled at a
sample rate of fs , to produce an N -point transform whose discrete outputs are
associated with the individual analytical frequencies,
k
meaning Xd ( N ), k = 0, 1, . . . , N − 1.
The DFT produces correct results only when the input data sequence contains
frequencies that match the analyzed frequencies. i.e.
k · fs k
u= = , k = 0, 1, 2 . . . , N − 1
N N
Example
Assume we’re taking a N = 64 point DFT of a sine-wave with exactly three
cycles contained in our N = 64 samples. (For simplicity let us choose fs = 64).
>> t = 0:1/64:1-1/64;
>> x = sin(2*pi*3*t);
>> Xu=fft(x);
>> absXu=abs(Xu);
>> relvabsXu=absXu(1:32);
>> stem (relvabsXu, ’DisplayName’, ’relvabsXu’, ’YDataSource’, ’relvabsXu’);
figure(gcf)
Figure 4: x = sin(2*pi*3*t)
19
Figure 5: DFT of x = sin(2*pi*3*t)
Not surprisingly the DFT shows us the right content of frequencies, meaning
Xk = 0 for all k other then k = 3 the forth sample.
The reason it worked is because 3Hz is one of the frequencies analyzed by the
DFT. Now lets take a sine-wave with exactly three and a half cycles contained
in our N = 64 samples.
>> t = 0:1/64:1-1/64;
>> x = sin(2*pi*3.5*t);
>> Xu=fft(x);
>> absXu=abs(Xu);
>> relvabsXu=absXu(1:32);
>> stem (relvabsXu, ’DisplayName’, ’relvabsXu’, ’YDataSource’, ’relvabsXu’);
figure(gcf)
Figure 6: x = sin(2*pi*3.5*t)
20
Figure 7: DFT of x = sin(2*pi*3.5*t)
This is leakage!. It causes any input signal whose frequency is not exactly at a
DFT analyzed frequency to leak into all of the other DFT outputs.
Even tough the input signal is a pure sine-wave, containing one fundamental
frequency, it is not reflected in the DFT. Moreover, leakage is an unavoidable
fact of life when we perform the DFT on real-world finite-length time sequences.
Although there’s no way to eliminate leakage completely, an important
technique known as windowing is the most common remedy to reduce its
unpleasant effects. Let’s look at another example to try and make the matter
easier.
Example 2
What one must understand is that sampling an analog signal over a finite period
of time b (which is always the case) equals to multiplying the signal x(t) with
rectangular window function defined as:
1 if 0 ≤ t ≤ b
p(t) =
0 otherwise
Figure 8: Sampling
21
N
One can easily see that sampling N times during b means fs = b .
Once again, the signal being sampled is not x(t),
but actually f (t) = x(t) · p(t) (Figure 8).
The sampled signal is
PN −1
fd (t) = n=0 x(n)δ(t − n) if t ∈ [0, b]
0 otherwise
And its Fourier transform is
N
X −1
fbd (u) = x(n)e−2πinu
n=0
In the frequency domain this will equal to convoluting X(u) and P (u). Let us
calculate the Fourier transform of the window function p(t).
Z ∞ Z b
1
P (u) = p(t)e−2πiut dt = e−2πiut dt = (1 − e−2πiub ) =
−∞ 0 2πiu
−1 eπiub πiub
= (e − e−πiub ) = b · e−πiub sinc(πub)
2πiu e2πiub
This function equals to b when u = 0 and to zero at u = kb , k = ±1, ±2 . . ..
The bigger b is, the narrower the main and side lobs are. Hypothetically
speaking if b → ∞ then sinc(x) → δ(x).
k·fs
The frequencies analyzed by the DFT are u = N = kb , k = 0, 1, . . . , N − 1.
The DFT of fd (t) is
k k k k k
Fk = fbd ( ) = X( ) ∗ P ( ) = X( ) ∗ P ( ), k = 0, 1, 2, . . . , N − 1
N N N b b
or we can rewrite
X k
Fk = P (i) · X( − i) (4)
b
i=Z
Now we will consider 2 cases:
22
1. x(t) contains information only on frequencies u = kb , k = 0, 1, . . . , N − 1.
In that case the convolution will yield results that differ from zero only
when i = 0, and
k
Fk = b · X( ), k = 0, 1, . . . , N − 1
b
In that case there is no leakage.
2. x(t) contains information not only on frequencies u = kb ,
k = 0, 1, . . . , N −1, and leakage occurs. The results are best demonstrated
in figure 10.
Conclusion: We can think of the DFT input signal as the product of an input
signal existing for all time, and the rectangular window function whose
magnitude is 1 over the sample interval. Anytime we take the DFT of a finite
extent input sequence we are, by default, multiplying that sequence by a window
of all ones and effectively multiplying the input values outside that window by
zeros. As it turns out, the continuous Fourier transform of the rectangular
window function is the sinc function whose side lobes causing the leakage effect.
To minimize the spectral leakage caused by those side-lobes, we will have to
find a way to reduce the side-lobe amplitudes. That can be achieved by using
window functions other than the rectangular window.
23
7.2 Window functions
By now we are familiar with the rectangular window function. That would be
enough to derive some important characteristics of window functions in general.
1. As the length b of the window increases, the width of the main lobe de-
creases.
2. The peak side-lobe amplitude of the window is determined by the shape
of the window, and it is essentially independent of the window length.
3. If the window shape is changed to decrease the side-lobe amplitude, the
width of the main lobe will generally increase.
There are an infinite number of window functions to choose from, here we will
introduce five well known window functions:
1. Rectangular window
2. Triangular window
3. Hanning window
4. Hamming window
5. Blackman window
Before we see exactly how well these windows minimize DFT leakage, let’s define
them mathematically.
• Rectangular window
Rn = 1, n = 0, 1, 2 . . . , N − 1
• Triangular window
(
n
N/2 for n = 0, 1, . . . , N2
Tn = n
2− N/2 for n = N2 + 1, . . . , N − 1
• Hanning window
2πn
Hann = 0.5 − 0.5cos( ), n = 0, 1, 2 . . . , N − 1
N −1
• Hamming window
2πn
Hamn = 0.54 − 0.46cos( ), n = 0, 1, 2 . . . , N − 1
N −1
• Blackman window
2πn 4πn
Bn = 0.42 − 0.5cos( ) + 0.08cos( ), n = 0, 1, 2 . . . , N − 1
N −1 N −1
24
Figure 11: Windows in time-domain
From figure 12 it’s obvious that the side lobes of the other window functions
affect much less then the rectangular function. This in turn will diminish the
leakage effect.
It’s not that clear that there’s a great deal of difference among many of these
window functions. What we find is that window selection is a trade-off between
main lobe widening, first side lobe levels, and how fast the side lobes decrease
with increased frequency. The use of any particular window depends on the
application.
So before moving on let us return to the first example in section 7.1 and see
how using the Hanning window function will reduce the leakage of the DFT of
sin(2π3.5t). results are shown in figure 13.
25
>> n = 0:1/64:1-1/64;
>> x = sin(2*pi*3.5*n);
>> Xu=fft(x);
>> absXu=abs(Xu);
>> relvabsXu=absXu(1:32);
>> hn=0.5-0.5*cos(2*pi*n./(1-1/64));
>> newxn=x.*hn;
>> Xnew=fft(newxn);
>> absXnew=abs(Xnew);;
>> relvalXnew=absXnew(1:32);
>> plot(n(1:32),relvabsXu,n(1:32),relvalXnew);
26
7.3 Zero padding and DFT resolution
As mentioned at the beginning of section 7, the DFT can be regarded as a
frequency-domain sampled approximation of the Fourier transform. Hence, the
greater the amount of samples the better the approximation. But from what
we’ve learned so far we know that the amount of DFT samples equals the amount
of the time domain input sequence samples. (i.e. if x(t) was sampled N times,
its DFT will contain N samples).
If so, given only N samples of x(t) (meaning that {xn } got N values), How can
we get more then N samples in our DFT ?
One popular method used to improve DFT spectral estimation is known as zero
padding. This process involves the addition of zero-valued data samples to the
original DFT input sequence {xn } to increase the total number of input data
samples, yielding more samples in our DFT.
This can be easily understood when looking at the definition of DFT:
N −1
X −2πink
−1
Given {xn }N
n=0 the DFT is Xk = x[n] · e N , k = 0, 1 . . . , N − 1
n=0
Now adding M zeros to the end of the sequence (i.e. {xn } = (x1 , x2 , . . . , xn , 0, 0, 0, 0))
| {z }
M times
the DFT becomes
X−1
N +M
−2πink
Xk = x[n] · e N +M , k = 0, 1 . . . , N + M − 1
n=0
Example
Let us go back to our first example in section 7.1 where we calculated the 64
point DFT of the signal x(t) = sin(2π · 3 · t). The results are shown in figure 5.
The Fourier transform of x(t) can be calculated as follow :
Z 1
1 πi(3−u)
sin(2π·3·t)·e−2πiut dt = sinc(π(3−u))−e−πi(3+u) sinc(π(3+u))
e
0 2i
Looking at the result (figure 14) one can hardly believe the DFT is an approxi-
mation of the Fourier transform. Now lets add zeros to the end of the 64 samples
{xn } and then calculate the DFT. We will do this using MATLAB.
First we will add 32 zero-valued data samples, then 64 (figures 15 and 16).
27
Figure 14: Fourier transform of x = sin(2*pi*3*t)
28
Figure 16: DFT of x = sin(2*pi*3*t) with 64 zeros added
the frequency domain. To improve our true spectral resolution of two signals,
we need more non-zero time samples (This issue will be discussed later).
The zero padding will increase our DFT resolution, Is there a way to “improve”
the input sequence {xn } ? Meaning, given a sequence that includes N samples,
can we get more samples without re-sampling the original signal ?
The answer to that question is surprisingly yes. This is done by adding zero-
value data sample in between the existing samples. Therefore given the sequence
x[n] = (x1 , x2 , . . . , xn ) we will reconstruct a new sequence by introducing a
constant number of zero-value samples (lets say M samples) between every two
samples getting y[n] = (x1 , 0, . . . , 0, x2 , 0, . . . , 0, . . . , xn , 0, . . . , 0). hence,
| {z } | {z } | {z }
M times M times M times
n
x[ M ] when n = k · M, k = 0, 1, 2, . . .
y[n] =
0 otherwise
29
Let us go back to the first example in section 7.1. In figure 4 we can see the 64
samples of the signal x(t) = sin(2π · 3t). Now lets make M = 4 and create y[n].
Now lets look at the DFT of x[n] and y[n]. From figures 18 and 19 it is plain
to see that the DFT of y[n] is a multiplication of Xk , M times.
In order to reconstruct an “improved” sequence x[n], one should zero-out all
the extra elements of Yk except for the first and last N2 samples.
So the algorithm is quit simple. given the sequence x[n] with N samples
• One should calculate its DFT - Xk .
• Build a new zero-value sequence (Yk ) which length is M · N .
N N
• Copy the the first 2 samples of Xk into the 2 first places of Yk .
N N
• Copy the the remaining 2 samples of Xk into the 2 last places of Yk .
• Calculating the inverse DFT of Yk will provide a new sequence y[n] which
contains all the original samples of x[n] and added non-zero samples in
between every two original sample.
Example 2
>> N=64;
>> M=4;
>> n= 0:N-1;
>> xn = sin(2*pi*3*n/N);
>> xk=fft(xn);
>> yk=zeros(1,M*N);
>> yk(1:32)=xk(1:32);
>> yk(end-31:end)=xk(33:64);
>> yn=ifft(yk);
>> plot(xn);
>> plot(abs(yk));
>> plot(yn);
30
Figure 18: DFT of x[n]
31
In order for the DFT to be able to resolve u1 and u2 , we demand
2 N −1 2 2
≤ ⇒ b= ≥ ⇒ Nmin = fs · + 1
b fs
32
8 The Z-Transform
The z-transform is a useful tool in the analysis of discrete-time signals and
systems (we should had that in many respects it is the discrete-time
counterpart of the Laplace transform for continuous-time signals and systems).
The z-transform may be used to solve constant coefficient difference equations,
solve filters given recursively, evaluate the response of a linear time-invariant
system to a given input, design linear filters and analyze signals and systems
where the Fourier transform doesn’t exist.
Definition 30 Given a discrete time signal {xn }n∈Z its Z-transform is denoted
as {Xz } ans is defined as :
X:Ω⊆C→C
X
X(z) = xn z −n
n∈Z
Where Ω is the Region Of Convergence (ROC) of the series and is defined as:
X
Ω = {z : |xn z −n | < ∞}
n∈Z
4. If x[n] is a left-sided sequence (that is, x[n] = 0 for n > N ∈ Z and X(z)
converges for some value of z, then the ROC is of the form |z| < RM or
RM > |z| > 0 where RM is the smallest magnitude of any of the poles of
X(z). Thus, the ROC is the interior of the circle |z| = RM in the z-plane
with the possible exception of z = 0.
33
8.2 Properties of Z-transform
1. Linearity - If x[n] has a z-transform X(z) with a ROC Rm1 < |z| < RM 1 ,
and if y[n] has a z-transform Y (z) with a ROC Rm2 < |z| < RM 2 then,
Z
w[n] = αx[n] + βy[n] ↔ αX(z) + βY (z) = W (z)
And the ROC of w(z) will include the intersection of R1 and R2 , that is,
RM ≥ min{RM 1 , RM 2 } and Rm ≤ max{Rm1 , Rm2 }.
2. Time Shifting - Shifting a sequence (delaying or advancing) multiplies the
z-transform by a power of z. That is to say, if x[n] has a z-transform X(z)
then,
Z
x[n − n0 ] ↔ z −n0 X(z)
The ROC stays the same.
3. Multiplication by an Exponential - If x[n] has a z-transform X(z) with a
ROC Rm1 < |z| < RM 1 , then
Z z
x[n] · an ↔ X( )
a
And the new ROC is RM = |a| · RM 1 and Rm = |a| · Rm1 .
4. Time Reversal - If x[n] has a z-transform X(z) with a ROC Rm1 < |z| <
RM 1 then,
Z 1
x[−n] ↔ X( )
z
1 1
And the new ROC is RM = Rm1 and Rm = RM 1 .
Z dX
nx[n] ↔ −z · (z)
dz
The ROC stays the same.
6. Accumulation (Integration) - If x[n] has a z-transform X(z) with a ROC
Rm1 < |z| < RM 1 then,
n
X Z z
x[k] ↔ · X(z)
−∞
z−1
34
8. Multiplication - If x[n] has a z-transform X(z) with a ROC Rm1 < |z| <
RM 1 , and if y[n] has a z-transform Y (z) with a ROC Rm2 < |z| < RM 2
then, Z
1 z
x[n] · y[n] = X(ζ) · Y ( ) · ζ −1 dζ
2πi γ ζ
Where γ is a counterclockwise contour of integration enclosing the origin
inside the ROC, which is:
Rm ≤ Rm1 · Rm2 and RM ≥ RM 1 · RM 2 .
Proof
We’ll choose γ to be a cycle of radius R contained inside the ROC, hence,
z = Reiθ for 0 ≤ θ ≤ 2π and dz = iReiθ dθ. Rewriting the integral we get
Z 2π Z 2π
1 1 n+1
Rn einθ iReiθ dθ = R i ei(n+1)θ dθ =
2πi 0 2πi 0
2π
1 n+1 ei(n+1)θ 0 if n 6= −1
= R i =
2πi i(n + 1) 0 1 if n = −1
Now we will prove theorem 31.
X(z)
Z Z zX }| { Z
1 1 X 1
X(z)·z n−1 dz = x[k]z −k ·z n−1 dz = x[k] z −k+n−1 dz =
2πi γ 2πi γ 2πi γ
k∈Z k∈Z
1
R −k+n−1
According to claim 32 2πi γ z dz = 1 only when k = n, therefore
Z
X 1 X
x[k] z −k+n−1 dz = x[k]δ(n − k) = x[n]
2πi γ
k∈Z k∈Z
35
8.4 The transfer function
In section 5.2 we showed that the input-output relationship for LTI systems
is described in terms of a convolution operation with impulse response of the
system (theorem 24).
i.e y[n] = x[n] ∗ h[n]. Applying the convolution property of the z-transform, we
obtain Y (z) = X(z) · H(z), where Y (z), X(z), and H(z) are the z-transforms
of y[n], x[n], and h[n], respectively. From the last equation we get that
Y (z)
H(z) =
X(z)
Definition 33 The z-transform H(z) of h[n] is referred to as the transfer
function (or the system function) of the system.
Looking back at section 5.1 we will now try to classify systems using the transfer
function.
Proof P
First we will show that if n∈Z |h[n]| < ∞ then the system is BIBO stable.
Suppose the input signal x[n] is bounded, (i.e. ∃A ∈ R : |x[n]| ≤ A).
By definition
X X X X
y[n] = x[n−k]h[k] ⇒ |y[n]| ≤ |x[n−k]|·|h[k]| ≤ A·|h[k]| = A |h[k]|
k∈Z k∈Z k∈Z k∈Z
P
Since we know that n∈Z |h[n]| < ∞ then we get that y[n] P is bounded.
Now let us show
P that if the system is BIBO stable then n∈Z |h[n]| < ∞.
Lets assume n∈Z |h[n]| = ∞ and we will show that the system is not BIBO
stable.
Consider the following bounded input
(
h[−n]
|h[−n]| if h[−n] 6= 0
x[n] =
0 otherwise
Hence, if |H(1)| converges then the system is BIBO stable. In other words if the
ROC of H(z) contains the unit circle (Rm < 1, RM > 1) the system is stable.
36
Notice that every number on the unit circle can be written as z = e2πiu , and
for any stable system we get
X
H(e2πiu ) = h[n] · e−2πinu = h(u)
d
n∈Z
Therefore we note that for unstable systems the Fourier transform doesn’t exist.
Proof
P
y[n] = k∈Z x[n−k]h[k] , for any k = −p < 0, p > 0 we get y[n] = x[n+p]h[−p]
if the system is causal, then y[n] can not depend on x[n + p] therefore h[−p] = 0,
on the other hand if h[−p] = 0, ∀p > 0 then the system is causal.
Looking at the transfer function we find that the system is causal if and only if
the ROC of H(z) is of the form |z| > Rm , That is, the ROC is the exterior of a
circle containing all of the poles of H(z) in the z-plane.
Theorem 36 A system will be both BIBO stable and causal if and only if all
of the poles of H(z) lie inside the unit circle of the z-plane.
Applying the z-transform and using the time-shift property and the linearity
property of the z-transform, we obtain
p
X q
X
−i
Y (z) + ai · z Y (z) = bi · z −i X(z)
i=1 i=0
37
Example
Find the transfer function of the two following systems. Determine whether
they are BIBO stable and\or causal. When possible find the Fourier transform
of the transfer function.
1. y[n] = x[n] − x[n − 1]
2. y[n] − y[n − 1] = x[n]
Lets start with (1). Applying the z-transform on both sides immediately yields
1
Y (z) = X(z) + z −1 · X(z) ⇒ H(z) = 1 +
z
The only pole is z = 0 therefore the system is stable and causal. In this case we
can find its Fourier transform by substituting z = e2πiu
1 2i
H(e2πiu ) = h(u)
d =1+ = πiu sin(πu)
e2πiu e
Moving on to (2) we find that
z
Y (z) + z −1 · Y (z) = X(z) ⇒ H(z) =
z−1
The only pole is z = 1 and it is on the unit circle therefore the system is not
stable. The system is causal though, it can easily be seen from the original
equation where y[n] depends only on samples from present time and past. Since
the system is not stable Its Fourier transform doesn’t exists.
1. Fourier transform - When the system is stable we can easily find its Fourier
transform from the z-transform and use the already well know formula for
the inverse Fourier transform.
2. Inversion Formula - Using the formal expression for the inverse z-transform
in terms of an integration in the z-plane (section 8.3).
3. Use of Tables of z-Transform Pairs - We try to express X(z) as
Where each of the terms Xi (z) is a function with known a inverse trans-
form.
4. Using the Residue formula - From the complex number theory we know
that if X(z) has a singular point at z0 then
Z
1
X(z)dz = Res(X(z))z0
2πi γ
38
Definition 37 If X : Ω\{z0 } → D is an analytic function, and if ∃m ∈ N
so that g(z) = (z − z0 )m · X(z), and g(z) is an analytic function over Ω,
then
1
Res(X(z))z0 = g (m−1) (z0 )
(m − 1)!
We will have to find the residue at the singular points of X(z)z n−1 .
39
9 Filter Design
9.1 Systems Interconnection
Sometimes when looking at a system we find that it can be resolve into smaller,
easier to deal with systems. We will consider three cases
1. For m LTI systems (with h1 [n], · · · hm [n] respectively) in cascade, the over
all impulse response (IR) is given by (see figure 22-a)
3. The more common case will be mixed systems with smaller systems
connected in series and parallel. In that case we need to find small parts
where the systems are connected to each other in one consistent way, solve
the smaller parts and then combine everything to get H(z).
Figure 22
40
Digital filters for which p ≥ 1 are called Infinite Impulse Response filters (IIR).
Digital filters for which p = 0 are called Finite Impulse Response filters (FIR).
FIR filters are characteristic of the discrete time domain (they are rarely used
as analog filters).
1. Low Pass Filter - designed to pass low frequencies from zero to a certain
cut-off frequency u0 and block the higher frequencies.
2. High Pass Filter - designed to pass high frequencies from a certain cut-off
frequency u0 and block the lower frequencies.
3. Band pass filter - designed to pass a certain frequency range [u0 , u1 ] (which
do not include zero) and block the other frequencies.
4. Band Stop Filter - designed to stop a certain frequency range [u0 , u1 ]
(which do not include zero) and pass the other frequencies.
The filters shown in figure 23 are ideal. Practical filters are not shaped in
straight lines but we assume the filters are real, hence their magnitude response
is symmetric and their phase response is asymmetric. A graphical description
of a real-life Low Pass Filter is shown in figure 24.
41
Figure 24: “Real life” LPF
Where up is the cut-off frequency, us is the stop-band frequency, δp is the
passband deviation and δs is the stop-band deviation. The exact behavior of the
frequency response of the filter in the transition band is usually of no importance.
So the new specification would be
0
1 − δp ≤ |H(u)| ≤ 1 + δp , 0 ≤ u ≤ up
0 ≤ |H(u)| ≤ δs , us ≤ u ≤ 0.5
The passband and stop-band deviations are often given in decibels (dB) as
follow:
0
αp = max{−20log10 (1 − δp ), 20log10 (1 + δp )} αs = −20log10 (δs )
0 ≤ |H(u)| ≤ δs , 0 ≤ u ≤ us
0
1 − δp ≤ |H(u)| ≤ 1 + δp , up ≤ u ≤ 0.5
A Band Pass Filter
0 ≤ |H(u)| ≤ δs1 , 0 ≤ u ≤ us1
0
1 − δp ≤ |H(u)| ≤ 1 + δp , up1 ≤ u ≤ up2
0 ≤ |H(u)| ≤ δs2 , us2 ≤ u ≤ 0.5
And a Band-Stop Filter
0
1 − δp1 ≤ |H(u)| ≤ 1 + δp1 , 0 ≤ u ≤ up1
42
9.2.2 Filter Specifications - Phase Response
In most filtering applications, the magnitude response is our primary concern.
However, the phase response may also be important and can not be made
arbitrary. Lets look at a BIBO stable filter h[n]. Its Fourier transform is given
in X
H(u) = h[n] · e−2πinu = A(u)e−iφ(u)
n∈Z
From the last expression and the Fourier transform properties we can see that
multiplying X(u) by e−iφ(u) equals to time shift of x[n]. i.e. The phase of the
filter will shift in the time domain the frequencies of the input signal. The shift
is by φ(u). Let us understand that mathematically.
Suppose the input signal contains only frequencies around u = u0
X(u) = 0, if u ∈
/ [u0 − , u0 + ]
dφ(u0 )
φ(u) = φ(u0 ) + (u − u0 ) + R(u−u0 )
du
dφ(u0 )
Denoting τ = − du (τ is also known as the phase delay of the filter) we get
43
9.3 FIR filter design
∃N1 , N2 ∈ N : if n ∈
/ [N1 , N2 ] then h[n] = 0
From the definition we find that the z-transform of an FIR filter will be
N2
X
H(z) = h[n]z −n
n=N1
There is only one pole and it is located at z = 0. thus, FIR filters are always
stable.
What about causality ?
For the filter to be causal we demand N1 ≥ 0.
Lets design a FIR filter with a constant phase, so that φ(u) = 0.
So from what we know so far we can write
N2
X
H(z) = h[n]z −n
n=N1
PN2
h[n]sin(2πnu)
n=N1
arg(H(u)) = arctg PN2
n=N1 h[n]cos(2πnu)
PN2
Thus, for φ(u) = arg(H(u)) = 0 we ask N1 h[n]sin(2πnu) = 0.
The latter can only happen if N2 = −N1 = N and h[n] will be symmetric, i.e.
h[n] = h[−n], ∀n.
Conclusion: A FIR filter with φ(u) = 0 can not be causal.
How can we make it causal ?
Time shifting. Let us shift h[n] so it starts at n = 0 instead of n = N1 . But we
must be ware of the effect such a move will have on the phase. the z-transform of
the shifted filter is z −N H(z), and its Fourier transform is H(u)e−2πiuN meaning
φ(u) = −2πN u. The phase is now linear and not constant any more.
The question we now ask is what are all the options and constrains for\on an
FIR filter to be
1. Causal
2. Have a linear phase response
dφ
Asking for a linear phase response means du =constant or φ(u) = 2πuα + β.
Applying the causality demand we find
N
X −1 N
X −1 N
X −1
H(u) = h[n]e−2πinu = h[n]cos(2πnu) − i h[n]sin(2πnu)
n=0 n=0 n=0
44
1. Lets demand β = 0.
PN −1
h[n]sin(2πnu)
φ(u) = 2πuα ⇒ tg(2πuα) = P0N −1 ⇔
0 h[n]cos(2πnu)
N
X −1 N
X −1
h[n]sin(2πnu)cos(2πuα) = h[n]cos(2πnu)sin(2πuα) ⇔
0 0
N
X −1
h[n](sin(2πnu)cos(2πuα) − cos(2πnu)sin(2πuα)) = 0
0
N
X −1
h[n](sin(2πnu − 2πuα)) = 0
0
2. Lets demand β 6= 0.
Going through the same process we find that causality and linear phase
can be obtain only if β = ± π2 , h[n] is asymmetric i.e.
h[n] = −h[N − 1 − n], ∀n and α = N 2−1 .
Summarizing everything to far we find that designing a real, causal and stable
FIR filter with linear phase is possible in 4 types
M
X −1 2M
X
= e−iωM (h[M ] + h[n]eiω(M −n) + h[n]eiω(M −n) ) =
n=0 n=M +1
45
M
X −1 M
X −1
−iωM iω(M −n)
=e (h[M ] + h[n]e + h[N − n]e−iω(M −n) ) =
n=0 n=0
M
X −1 M
X
= e−iωM h[M ] + 2 h[n]cos(ω(M − n)) = e−iωM
a[n]cos(ω(M − n))
n=0 n=0
where
h[M ], n = M
a[n] =
2h[n], 0 ≤ n ≤ M − 1
Please note that M = N 2−1 = α.
The magnitude of the frequency response can be written in the following form
M
X
A(ω) = g[n]cos(ωn)
n=0
where
h[M ] , n=0
g[n] =
2h[M − n], 1 ≤ n ≤ M
M
X 2M
X +1
= e−iω(M +0.5) ( h[n]eiω(M +0.5−n) + h[n]eiω(M +0.5−n) ) =
n=0 n=M +1
M
X M
X
= e−iω(M +0.5) ( h[n]eiω(M +0.5−n) + h[N − n]e−iω(M +0.5−n) ) =
n=0 n=0
M
X
= e−iω(M +0.5) (2 h[n]cos(ω(M + 0.5 − n))) =
n=0
where
0.5g[M ], n=0
2h[n] = 0.5(g[M + 1 − n] + g[M − n]), 1 ≤ n ≤ M − 1
0.5g[1] + g[0], n=M
46
Or
g[M ] = 4h[0],
g[M − n] = 4h[n] − g[M − n + 1], 1 ≤ n ≤ M − 1
g[0] = 2h[M ] − 0.5g[1],
It can be seen that A(ω) = 0 for u = 0.5. Therefore type II filters are not
suitable for HPF and stop-band filters (in contrast to type I which are suitable
for filters of all kind).
M
X −1 M
X −1
= e−iωM ( h[n]eiω(M −n) + h[N − n]e−iω(M −n) ) =
n=0 n=0
M
X
= ei(0.5π−ωM ) 2
h[n]sin(ω(M − n))
n=0
N −1
Again M = 2= α.
The magnitude of the frequency response can be written in the following form
M
X −1
A(ω) = sin(ω) g[n]cos(ωn)
n=0
where
0.5g[M − 1], n=0
0.5g[M − 2], n=1
2h[n] =
0.5(g[M − 1 − n] + g[M + 1 − n]), 2 ≤n≤M −2
g[0] − 0.5g[2], n=M −1
Or
g[M − 1] = 4h[0],
g[M − 2] = 4h[1],
g[M − n] = 4h[n − 1] + g[M − n + 2], 3 ≤ n ≤ M − 1
g[0] = 2h[M − 1] + 0.5g[2],
It can be seen that A(ω) = 0 for u = 0 and u = 0.5. Therefore type III filters
are only suitable for band pass filters, but since they do not have an exact linear
phase (i.e. φ(0) = 0) they are not widely used for this application.
47
9.3.4 Type-IV filters
π
Type II filter have odd order (even length), and initial phase φ(0) = 2. Their
impulse response satisfies the asymmetry condition h[n] = h[N − n].
Their frequency response is drives as follow (note: 2M + 1 = N − 1)
M
X M
X
H(ω) = e−iω(M +0.5) ( h[n]eiω(M +0.5−n) + h[N − n]e−iω(M +0.5−n) ) =
n=0 n=0
M
X
= ei(0.5π−ω(M +0.5)) (2 h[n]sin(ω(M + 0.5 − n)))
n=0
where
0.5g[M ], n=0
2h[n] = 0.5(g[M − n] − g[M + 1 − n]), 1 ≤ n ≤ M − 1
g[0] − 0.5g[1], n=M
Or
g[M ] = 4h[0],
g[M − n] = 4h[n] + g[M − n + 1], 1 ≤ n ≤ M − 1
g[0] = 2h[M ] + 0.5g[1],
It can be seen that A(ω) = 0 for u = 0. Therefore type IVI filters are not
suitable for LPF and stop-band filters.
Summary As we have seen the frequency response of linear phase FIR filters
(for all four types) are of the form
H(ω) = A(ω)ei(φ(0)−ωα)
and
1 T ype I
cos(0.5ω) T ype II
F (ω) =
sin(ω) T ype III
sin(0.5ω) T ype IV
48
9.3.5 Zero Locations of FIR Filter
Let H(z) be the transfer function of a linear phase FIR filter with real coeffi-
cients.
Claim 39
H(z −1 ) = ±z N −1 · H(z)
Proof
N
X −1 N
X −1 N
X −1
H(z −1 ) = h[n]z n = z N −1 · h[n]z −(N −1−n) = z N −1 · h[N −1−n]z −n =
n=0 n=0 n=0
N
X −1
z N −1 · ±h[n]z −n = ±z N −1 · H(z)
n=0
49
5. Compute the IR of the desired filter using the inverse Fourier transform
Z π
1
hd [n] = Ad (ω)ei(φ(0)−ωα) eiωn dω
2π −π
Example
Design a LPF such that
0 ≤ ω ≤ π4
1
Ad (ω) = π
0 4 ≤ω ≤π
Let us follow the given instructions. We choose φ(0) = 0 and N = 100. Hence,
−i(ω 99 )
e 2 0 ≤ ω ≤ π4
Hd (ω) =
0 π4 ≤ ω ≤ π
π
hd [n] = 0.25sinc( (n − 49.5))
4
We finally get
>> N=100;
>> n=0:N-1;
>> u=0:1/N:1-1/N;
>> h=0.25*(sin((pi/4).*(n-49.5)))./((pi/4).*(n-49.5));
>> H=fft(h);
>> plot(u,abs(H));
In figure 25 and figure 26 we can see the desired filter and the actual filter
respectively.
50
Figure 25: Desired
The question we now ask is what is the minimal N we should choose in order
for h[n] to be accurate within our demands i.e. (Figure 27)
0
1 − δp ≤ |H(u)| ≤ 1 + δp , 0 ≤ u ≤ up
0 ≤ |H(u)| ≤ δs , us ≤ u ≤ 0.5
and for the transition band to be minimal ?
For the more general case we find that hd [n] is alway of the form
51
point).
Increasing N will affect the transition band though, the bigger N is the narrower
the band will get. The upper limit of the band’s width would be 4π N .
Please note: windows are always symmetric and satisfy w[n] = w[N − n].
52
4. Compute h[n] using the inverse DFT formula
N −1
X k iωn k
h[n] = Hd ( )e N
N
k=0
53
We now get a set of K + 1 equations with the same amount of unknowns.
K
X
cm,k g[k] = dm , 0 ≤ m ≤ K
k=0
where Z π
cm,k = v(ω)2 F (ω)2 cos(ωm)cos(ωk)dω
0
Z π
dm = v(ω)2 F (ω)Ad (ω)cos(ωm)dω
0
I−1
πX
dm = v(ωi )2 F (ωi )Ad (ωi )cos(ωi m)
I 0
8. Compute h[n] using g[k] and the relations given according to the type
chosen.
54
11 IIR Filters
Infinite impulse response (IIR) digital filters are fundamentally different from
FIR filters because practical IIR filters always require feedback. Where FIR
filter output samples depend only on past input samples, each IIR filter output
sample depends on previous input samples and previous filter output samples.
Relative to FIR filters, IIR filters have more complicated structures , are harder
to design and analyze, and do not have linear phase responses. Why then,
would anyone use an IIR filter? Because they are very efficient. IIR filters
require far fewer multiplications per filter output sample to achieve a given
frequency magnitude response.
As already mentioned IIR filters get their name from the fact that some of
the filter’s previous output samples are used to calculate the current output
sample. Given a finite duration of nonzero input values, the effect is that an
IIR filter could have a infinite duration of nonzero output samples. So, if the
IIR filter’s input suddenly becomes a sequence of all zeros, the filter’s output
could conceivably remain nonzero forever. Standard IIR filter design techniques
fall into three basic classes: the impulse invariance, bilinear transform, and
optimization methods.
Before going into how to design an IIR filter let us know two important families
of IIR filters
• Butterworth Filters
• Chebyshev Filters
But before going there there are just a few things we need to know about analog
filters.
b0 sq + b1 sq−1 + · · · + bq
H(s) =
sp + a1 sp−1 + · · · + ap
where mostly q ≤ p.
For the filter to be stable, we ask that all the poles will be on the left side of
the complex plane. In order To find the Fourier transform of a stable filter, one
should substitute s by iω.
To the parameters defined in section 9.2.1 we will a few more:
55
2. The asymptotic attenuation at high frequencies. This parameter is
determined by
H(ω) ≈ b0 (iω)q−p
which holds for ω larger then approx 5 times the largest absolute value of
all poles and zeros. We can now rewrite and get
56
5. The square magnitude of the frequency response satisfies
∂ k |H(ω)|2
= 0, 1 ≤ k ≤ 2N − 1
∂ω k
ω=0
s
The transfer function of Butterwoth filter can be obtained by substituting ω = i
and then
1 1
|H(ω)|2 = H(s)H(−s) = =
1 + (s/iω0 )2N 1 + (−1)N (s/ω0 )2N
It can easily be seen that there are 2N poles for |H(ω)|2 which are
(N +1+2t)π
st = ω0 · e(i 2N )
, 0 ≤ t ≤ 2N − 1
The first N poles are located on the left side of the complex plane and therefore
belong to H(s) so it is stable. The remaining poles corresponds to H(−s).
A Butterwoth filter has no zeros, but the constant coefficient in the numerator
has to be adjust so |H(0)| = 1.
In summary a Butterwoth filter of order N is given by
N −1
Y −sk
H(s) =
s − sk
k=0
57
11.3 Chebyshev Filters
Chebyshev filters are analog or digital filters having a steeper roll-off and more
passband ripple (type I) or stopband ripple (type II) than Butterworth filters.
To understand Chebyshev filters we will make a short review of Chebyshev
polynomials. Chebyshev polynomial of degree N is defined as
cos(N · arccos(x)) |x| ≤ 1
TN (x) =
cosh(N · arccosh(x)) |x| > 1
There are two kinds of Chebyshev filter. The first is equiripple in the pass-
band and then monotonically decreasing in the stop band, whereas the second
is monotonically decreasing in the pass-band and equiripple in the stop-band
(sometimes known as the inverse-Chebyshev).
58
Figure 29: Chebyshev I low pass filter
(a) N=2 (b) N=3
2. (
1
2 1+2 N even
|H(0)| =
1 N odd
59
Designing a Chebyshev I filter that meets your desired specification (i.e ωp , ωs , δp , δs )
proceeds as follows:
compute the factors k and d. From figure 29 it is obvious that
1 1
ω ≥ (1 − δp )2 , 2
ωs ≤ δs
1 + 2 TN2 ( ωp0 ) 1 + 2 TN2 ( ω0
)
60
The main properties of a Type II Chebyshev filter are:
1. For ω ≥ ω0 (in this case ω0 = ωs ), we have
2
0 ≤ |H(ω)|2 ≤
1 + 2
2. |H(0)|2 = 1 for all N .
3. In the limit as ω tends to infinity we have
2
(
22 TN2 (0) 1+2 N even
limω→∞ |H(ω)| = =
1 + 2 TN2 (0) 0 N odd
≤ δs2
1 + 2 TN2 ( ω
ωs )
0
61
11.4 IIR Filter Design
11.4.1 Impulse Invariance
The impulse invariance method of IIR filter design is based upon the notion that
we can design a discrete filter whose time-domain impulse response is a sampled
version of the impulse response of a continuous analog filter. If that analog
filter (often called the prototype filter) has some desired frequency response,
then our IIR filter will yield a discrete approximation of that desired response.
Implied in the correspondence of the continuous and discrete impulse responses
is the property that we can map each pole on the s-plane for the analog filter’s
Hc (s) transfer function to a pole on the z-plane for the discrete IIR filter’s H(z)
transfer function. What designers have found is that the impulse invariance
method does yield useful IIR filters, as long as the sampling rate is high relative
to the bandwidth of the signal to be filtered.
1. Obtain the Laplace transfer function H(s) for the prototype analog filter
in the form of
bN sN + bN −1 sN −1 + · · · + b1 s + b0
H(s) =
aM sM + aM −1 sM −1 + · · · + a1 s + a0
where M > N .
2. Select an appropriate sampling frequency fs and calculate the sample
period as ts = f1s .
3. Express the analog filter’s Laplace transfer function H(s) as the sum
of single-pole filters. This requires us to use partial fraction expansion
method.
M
bN sN + bN −1 sN −1 + · · · + b1 s + b0 X Ak
H(s) = =
aM sM + aM −1 sM −1 + · · · + a1 s + a0 s + Pk
k=1
th
where the individual Ak factors are constants and the k pole is located at
Pk on the s-plane. We’ll denote the k th single-pole analog filter as Hk (s)
i.e.
Ak
Hk (s) =
s + Pk
4. Substitute 1 − EXP (−Pk ts )Z −1 for s + Pk . This mapping of each Hk (s)
pole, located at s = Pk on the s-plane, to the location on the z-plane is
how we approximate the impulse response of each single-pole analog filter
by a single-pole digital filter, yielding
Ak
Hk (Z) =
1 − EXP (−Pk ts )Z −1
The final combined discrete filter transfer function H(z) is
M
X
H(z) = Hk (z)
k=1
62
5. Calculate the z-domain transfer function of the sum of the M single-pole
digital filters in the form of a ratio of two polynomials in z. Because the
H(z) will be a series of fractions, we’ll have to combine those fractions
over a common denominator to get a single ratio of polynomials in the
familiar form of PN −k
k=1 bk z
H(z) = PM
1 − k=1 ak z −k
Because the process of sampling the continuous impulse response results
in a digital filter frequency response that’s scaled by a factor of f rac1ts ,
many filter designers find it appropriate to include the ts factor. So we
can rewrite PN
ts k=1 bk z −k
H(z) = PM
1 − k=1 ak z −k
Incorporating the value of ts makes the IIR filter time-response scaling
independent of the sampling rate, and the discrete filter will have the
same gain as the prototype analog filter.
63
11.4.2 Bilinear Transform IIR Filter Design
There’s a popular analytical IIR filter design technique known as the bilinear
transform method. Like the impulse invariance method, this design technique
approximates a prototype analog filter defined by the continuous Laplace trans-
fer function H(s) with a discrete filter whose transfer function is H(z). The
method won’t be explained here. We will just show the design steps.
1. Obtain the Laplace transfer function H(s).
bN sN + bN −1 sN −1 + · · · + b1 s + b0
H(s) =
aM sM + aM −1 sM −1 + · · · + a1 s + a0
2 1 − z −1
( )
ts 1 + z −1
to get the IIR filter’s H(z) transfer function.
4. Multiply the numerator and denominator of H(z) by the appropriate
power of (1 + z 1 ) and bring H(z) to the form
PN −k
k=1 bk z
H(z) = PM
1− k=1 ak z −k
64
REFERENCES
1. Understanding digital signal processing / Richard G. Lyons.
2. A Course in digital signal processing / Boaz Porat.
3. Shaum’s signals and systems
4. Shaum’s outline of theory and problems of digital signal pro-
cessing
65