DSP Notes
DSP Notes
Note: Electronics (unlike optics) can only deal easily with time-dependent
signals, therefore spatial signals such as images, are typically first
converted into a time signal with a scanning process (TV, Fax, etc..)
Signal Processing
A Signal is a function of one or more variables that conveys
information about some (usually physical) phenomenon.
Classification of systems
Number of inputs:
A system with one input is said to be single input (SI).
A system with more than one input is said to be multiple input (MI).
Number of outputs:
A system with one output is said to be single output (SO).
A system with more than one output is said to be multiple output (MO).
Types of signals processed:
A system can be classified in terms of the types of signals that it
processes.
Consequently, terms such as the following (which describe signals) can
also be used to describe systems:
One-dimensional and multi-dimensional
Continuous-time and discrete-time
Analog and digital
Signals
A CT signal is called a function.
A DT signal is called a sequence.
Strictly speaking, an expression like “f(t)” means the value of the function f
evaluated at the point t.
In contexts where sloppy notation may lead to problems, one should be careful
to clearly distinguish between a function and its value.
Properties of Signals
Even Signals
A function x is said to be even if it satisfies
x(t)= x(-t) for all t.
A sequence x is said to be even if it satisfies
x(n)= x(-n) for all n.
Geometrically, the graph of an even signal is symmetric about the origin.
Odd signals
A function x is said to be odd if it satisfies
x(t)=- x(-t) for all t.
A sequence x is said to be odd if it satisfies
x(n)=- x(-n) for all n.
Geometrically, the graph of an odd signal is anti-symmetric about the origin.
Periodic Signals
A function x is said to be periodic with period T (or T-periodic) if, for
some strictly-positive real constant T, the following condition holds:
x(t)=x(t+T) for all t.
Properties of Signals
1 2𝜋
A T-periodic function x is said to have frequency and angular frequency .
𝑇 𝑇
Periodic Signals
A sequence x is said to be periodic with period N (or N-periodic) if, for
some strictly-positive real constant N, the following condition holds:
x(n)=x(n+N) for all n.
1
An N-periodic sequence x is said to have frequency and angular
𝑁
2𝜋
frequency .
𝑁
A function/sequence that is not periodic is said to be aperiodic.
Discrete-Time Fourier Series (DTFS)
A discrete-time signal 𝑥(𝑛) is periodic with period 𝑁 if
𝑥 𝑛 =𝑥 𝑛+𝑁
The set of all discrete-time complex exponential signals that are periodic with
period 𝑁 is given by
𝜙𝑘 𝑛 = ⅇ 𝑗𝑘𝜔0𝑛 = ⅇ 𝑗𝑘 2𝜋Τ𝑁 𝑛
𝑥 𝑛 = 𝑋𝑘 𝜙𝑘 𝑛 = 𝑋𝑘 ⅇ 𝑗𝑘𝜔0𝑛 = 𝑋𝑘 ⅇ 𝑗𝑘 2𝜋Τ𝑁 𝑛
𝑘 𝑘 𝑘
The discrete-time exponentials whose frequencies are separated by 2𝜋 (or
integer multiples of 2𝜋) are identical.
𝜙0 𝑛 = ⅇ 𝑗0 2𝜋Τ𝑁 𝑛 = 𝜙𝑁 𝑛 = ⅇ 𝑗𝑁 2𝜋Τ𝑁 𝑛
𝑥 𝑛 = 𝑋𝑘 ⅇ 𝑗𝑘𝜔0𝑛
𝑘=𝑘0
Where 𝑘0 is arbitrary. Since 𝑘0 is arbitrary, we can use the notation
𝑥 𝑛 = 𝑋𝑘 ⅇ 𝑗𝑘𝜔0𝑛
𝑘=𝑁
𝑚=𝑁
Discrete-Time Fourier Series (DTFS)
Then, we sum over the values of 𝑛 in [0, 𝑁 − 1] to get
𝑁−1
𝑁−1
𝑛=0 𝑚= 𝑁
𝑛=0
𝑛=0 𝑛=0
𝑚= 𝑁
𝑁−1
We know that 1 − 𝛼 𝑁
𝛼𝑛 =
1−𝛼
𝑛=0
For 𝛼 = 1, we have
𝑁−1
𝛼𝑛 = 𝑁
𝑛=0
Discrete-Time Fourier Series (DTFS)
If 𝑚 − 𝑘 is not an integer of N (i.e., (𝑚 − 𝑘) ≠rN for r=0, ±1, ±2, …),
we can let α = 𝑋𝑚 ⅇ 𝑗𝜔0 𝑚−𝑘 𝑛
𝑁−1 𝑗2𝜋/𝑁 𝑚−𝑘 𝑁
1 − ⅇ 𝑗𝜔0 𝑚−𝑘 𝑁 = 1 − ⅇ =0
ⅇ 𝑗𝜔0 𝑚−𝑘 𝑛 = 𝑗𝑤 𝑚−𝑘 1 − ⅇ 𝑗2𝜋/𝑁(𝑚−𝑘)
1−ⅇ 0
𝑛=0
ⅇ 𝑗𝜔0 𝑚−𝑘 𝑛 =𝑁
𝑛=0
ⅇ 𝑗𝜔0 𝑚−𝑘 𝑛 = 𝑁𝛿 𝑚 − 𝑘 − 𝑟𝑁
𝑛=0
Where 𝛿 𝑚 − 𝑘 − 𝑟𝑁 is the unit sample occurring at 𝑚 = 𝑘 + 𝑟𝑁. We yields
𝑁−1
𝑥 𝑛 ⅇ −𝑗𝜔0𝑘𝑛 = 𝑋𝑚 𝑁𝛿 𝑚 − 𝑘 − 𝑟𝑁
𝑛=0 𝑚= 𝑁
Discrete-Time Fourier Series (DTFS)
The nonzero value in the sum corresponds to 𝑚 = 𝑘, and the right hand side
equation evaluates to 𝑁𝑋𝑘
𝑁−1
1
𝑋𝑘 = 𝑥 𝑛 ⅇ −𝑗𝜔0𝑘𝑛
𝑁
𝑛=0
Because each of the terms in the summation is periodic with 𝑁, the summation
can be taken over any 𝑁 successive values of 𝑛.
𝑥 𝑛 = 𝑋𝑘 ⅇ 𝑗𝑘𝜔0𝑛
𝑘=𝑁
and
1
𝑋𝑘 = 𝑥 𝑛 ⅇ −𝑗𝑘𝜔0𝑛
𝑁
𝑛=𝑁
Magnitude and Phase Spectrum of Discrete-Time Periodic
Signals (Fourier Spectra)
In general, the Fourier coefficients 𝑋𝑘 , are complex, and theycan be
represented in the polar form as
𝑋𝑘 = 𝑋𝑘 ⅇ 𝑗∠𝑋𝑘
Discrete-Time Fourier Series (DTFS)
The spectrum of the discrete-time periodic signal, in contrast, is band limited
and has at most 𝑁 components
The DTFS coefficients 𝑋𝑘 are periodic with period 𝑁, i.e.,
𝑋𝑘+𝑁 = 𝑋𝑘
Proof
1
𝑋𝑘 = 𝑥 𝑛 ⅇ −𝑗𝑘𝜔0𝑛
𝑁
𝑛=𝑁
1
𝑋𝑘+𝑁 = 𝑥 𝑛 ⅇ − 𝑗 𝑘 + 𝑁 𝜔0 𝑛
𝑁
𝑛= 𝑁
1
= 𝑥 𝑛 ⅇ −𝑗𝑘𝜔0𝑛 ⅇ −𝑗 2𝜋/𝑁 𝑁𝑛
𝑁
𝑛= 𝑁
1
= 𝑥 𝑛 ⅇ −𝑗𝑘𝜔0𝑛 ⅇ −𝑗 2𝜋 𝑛
𝑁
𝑛= 𝑁
1
= 𝑥 𝑛 ⅇ −𝑗𝑘𝜔0𝑛
𝑁
𝑛= 𝑁
𝑋𝑘+𝑁 = 𝑋𝑘
Discrete-Time Fourier Series (DTFS)
Properties of DTFS
Similarities between the properties of discrete-time and continuous-time Fourier
series.
To indicate the relationship between a periodic signal and its Fourier series
coefficients.
Linearity
If x(n) and y(n) denote two periodic signals with period N, and
𝑥 𝑛 ⟷ 𝑋𝑘 𝑦 𝑛 ⟷ 𝑌𝑘
Then
𝑧 𝑛 = 𝑎𝑥 𝑛 + 𝑏𝑦 𝑛 ↔ 𝑍𝑘 = 𝑎𝑋𝑘 + 𝑏𝑌𝑘
Proof The Fourier series coefficients of z(n) is given by
1 −𝑗𝑘𝜔 𝑛
1
𝑍𝑘 = 𝑧 𝑛 ⅇ 0 = 𝑎𝑥 𝑛 + 𝑏𝑦 𝑛 ⅇ −𝑗𝑘𝜔0𝑛
𝑁 𝑁
𝑛= 𝑁 𝑛=(𝑁)
1 −𝑗𝑘𝜔 𝑛
1
𝑎 𝑥 𝑛 ⅇ 0 +𝑏 𝑦 𝑛 ⅇ −𝑗𝑘𝜔0𝑛
𝑁 𝑁
𝑛= 𝑁 𝑛= 𝑁
𝒁𝒌 = 𝒂𝑿𝒌 + 𝒃𝒀𝒌
Discrete-Time Fourier Series (DTFS)
Time Shifting
When a time shift is applied to a periodic signal x(n), the period N of the signal is
preserved. If
𝑥 𝑛 ⟷ 𝑋𝑘
Then 𝑦 𝑛 = 𝑥(𝑛 − 𝑛0) ⟷ 𝑌𝑘 = 𝑋𝑘ⅇ −𝑗𝑘𝜔0𝑛0
When a signal is shifted in time, the magnitudes of its Fourier series coefficients
remain unaltered. That is, |𝑌𝑘 |=𝑋𝑘 |.
Proof By definition,
𝑁−1 𝑁−1
1 1 1
𝑌𝑘 = 𝑦 𝑛 ⅇ −𝑗𝑘𝜔0𝑛 = 𝑦 𝑛 ⅇ −𝑗𝑘𝜔0𝑛 = 𝑥 𝑛 − 𝑛0 ⅇ −𝑗𝑘𝜔0𝑛
𝑁 𝑁 𝑁
𝑛= 𝑁 𝑛=0 𝑛=0
𝑌𝑘 = 𝑋𝑘 ⅇ −𝑗𝑘𝜔0𝑛0 𝑌𝑘 = 𝑋𝑘
Frequency Shifting
If
𝑥 𝑛 ⟷ 𝑋𝑘
Then 𝑦 𝑛 = ⅇ 𝑗𝑀𝜔0𝑛 𝑥 𝑛 ↔ 𝑌𝑘 = 𝑋𝑘−𝑀
𝑁−1
Proof By definition, 1 1
𝑦𝑘 = 𝑦 𝑛 ⅇ −𝑗𝑘𝜔0𝑛 = 𝑦 𝑛 ⅇ −𝑗𝑘𝜔0𝑛
𝑁 𝑁
𝑛=𝑁 𝑛=0
𝑁−1
1 𝑁−1
= ⅇ 𝑗𝑀𝜔0𝑛 𝑥 𝑛 ⅇ −𝑗𝑘𝜔0𝑛 1
𝑁 = 𝑥 𝑛 ⅇ −𝑗 𝑘−𝑀 𝜔0 𝑛 = 𝑋𝑘−𝑀
𝑛=0 𝑁
𝑛=0
𝑁⋅1 𝑁⋅1
1 1
= 𝑥 −𝑛 ⅇ −𝑗𝑘𝜔0 𝑛 = 𝑥 𝑚 ⅇ −𝑗(−𝑘)𝜔0𝑚 = 𝑋−𝑘
𝑁 𝑁
𝑛=0 𝑚=−(𝑁−1)
The time reversal applied to a discrete-time signal results in a time reversal of the
corresponding sequence of Fourier series coefficients.
Discrete-Time Fourier Series (DTFS)
Time Scaling
If 𝑥 𝑛 ⟷ 𝑋𝑘
Then 1
𝑦 𝑛 = 𝑥 𝑚 𝑛 ↔ 𝑌𝑘 = X
𝑚 k
1
The Fourier series coefficients𝑌𝑘 = Xk are also periodic with period 𝑚𝑁.
𝑚
Proof The Fourier series coefficients of 𝑦 𝑛 = 𝑥 𝑚 𝑛 are given by
𝑚(𝑁−1)
1 1 −𝑗𝑘
𝜔
𝑛
𝑌𝑘 = 𝑦 𝑛 ⅇ 𝑚
𝑚𝑁
𝑛=0
𝑚(𝑁−1)
1 1 −𝑗𝑘
𝜔
𝑛
𝑌𝑘 = 𝑥 𝑛 ⅇ 𝑚
𝑚𝑁 𝑚
𝑛=0
𝑚(𝑁−1)
1 1 −𝑗𝑘
𝜔
𝑛
𝑌𝑘 = 𝑥 𝑛/𝑚 ⅇ 𝑚
𝑚𝑁
𝑛=0
𝑛
A change of variables is performed by letting 𝑟 = , which also yields 𝑟 = 0 as
𝑚
𝑛 = 0 and 𝑟 = 𝑁 − 1 as 𝑛 = 𝑚 𝑁 − 1 . Therefore,
1 1 1
𝑌𝑘 = σ(𝑁−1)
𝑟=0 𝑥 𝑟 ⅇ
−𝑗𝑘𝜔𝑟 = 𝑋
𝑚𝑁 𝑚 𝑘
Discrete-Time Fourier Series (DTFS)
Periodic Convolution
If 𝑥 𝑛 ⟷ 𝑋𝑘 𝑦 𝑛 ⟷ 𝑌𝑘
Then 𝑧 𝑛 =𝑥 𝑛 ⊛𝑦 𝑛 = 𝑥 𝑟 𝑦 𝑛 − 𝑟 ↔ 𝑍𝑘 = 𝑁𝑋𝑘 𝑌𝑘
𝑟= <𝑛>
Proof
For periodic signals with the same period, a special form of convolution,
known as periodic convolution, is defined as
1 1
𝑍𝑘 = σ𝑛= <𝑁> 𝑧 𝑛 ⅇ −𝑗𝑘𝜔𝑛 = σ (σ𝑟= <𝑁> 𝑥 𝑟 𝑦 𝑛 − 𝑟 ) ⅇ −𝑗𝑘𝜔𝑛
𝑁 𝑁 𝑛= <𝑁>
1
𝑍𝑘 = σ𝑟= <𝑁> 𝑥(𝑟)( σ𝑛= <𝑁> 𝑦 𝑛 − 𝑟 ⅇ −𝑗𝑘𝜔𝑛 )
𝑁
1
We have 𝑍𝑘 = 𝑁 σ𝑟= <𝑁> 𝑥 𝑟 ⅇ −𝑗𝑟𝜔𝑛 𝑌𝑘 = 𝑁𝑋𝑘 𝑌𝑘
𝑁
The convolution in time transform to multiplication of the frequency
domain representations.
Discrete-Time Fourier Series (DTFS)
Multiplication
If 𝑥(𝑛) and 𝑦(𝑛) denote two periodic signals with period 𝑁, and
𝑥 𝑛 ⟷ 𝑋𝑘 𝑦 𝑛 ⟷ 𝑌𝑘
Then 𝑧 𝑛 = 𝑥 𝑛 𝑦 𝑛 ↔⟷ 𝑍𝑘 = σ𝑟= <𝑁> 𝑋𝑟𝑌𝑘 − 𝑟
Proof
Consider the signal 𝑧(𝑛),
𝑍(𝑛) = x n y 𝑛 = Xrⅇ 𝑗𝑟𝜔𝑛 𝑌𝑚 ⅇ 𝑗𝑚𝜔𝑛
𝑟= <𝑁> 𝑚= <𝑁>
𝑧 𝑛 = Xr 𝑌𝑚 ⅇ 𝑗 𝑚+𝑟 𝜔𝑛
𝑟= <𝑁> 𝑚= <𝑁>
Proof
Given 𝑥 𝑛 ⟷ 𝑋𝑘
Using the time-shifting property, we get
𝑥 𝑛 − 1 ↔ 𝑋𝑘ⅇ −𝑗𝑘𝜔
Now, using the linearity property, we get
𝑥 𝑛 − 𝑥 𝑛 − 1 ↔ 𝑋𝑘 − 𝑋𝑘ⅇ −𝑗𝑘𝜔
𝑥 𝑛 − 𝑥 𝑛 − 1 ↔ 𝑋𝑘(1 − ⅇ −𝑗𝑘𝜔 )
𝑦 𝑛 = 𝑥 𝑘
𝑘=−∞
𝑦 𝑛 = 𝑥 𝑛 + σ𝑛−1
𝑘=−∞ 𝑥(𝑘)
𝑦 𝑛 =𝑥 𝑛 +𝑦 𝑛−1
𝑦 𝑛 −𝑦 𝑛−1 =𝑥 𝑛
𝑌𝑘 − 𝑌𝑘 ⅇ −𝑗𝑘𝜔 = 𝑋𝑘
1
𝑌𝑘 = 𝑋
1 − ⅇ −𝑗𝑘𝜔 𝑘
Proof
1 −𝑗𝑘𝑤0 𝑛 =
1
𝑌𝑘= 𝑁 𝑦(𝑛)ⅇ 𝑥 𝑛 (𝑛)ⅇ −𝑗𝑘𝑤0𝑛
𝑁
𝑛=<𝑁> 𝑛=<𝑁>
∗ ∗
1 1
= 𝑥(𝑛)ⅇ 𝑗𝑘𝑤0𝑛 = 𝑥(𝑛)ⅇ −𝑗(−𝑘)𝑤0 𝑛
𝑁 𝑁
𝑛=<𝑁> 𝑛=<𝑁>
= (𝑋−𝑘 )∗ = 𝑋−𝑘 ∗
Case I If 𝑥(𝑛) is real, i.e., if
𝑥∗ 𝑛 = 𝑥 𝑛
Then
𝑋 ∗ −𝑘 = 𝑋𝑘
Therefore, 𝑋−𝑘 = 𝑋 ∗ 𝑘
That is, if 𝑥(𝑡) is real and even, then so are its Fourier series coefficients.
Discrete-Time Fourier Series (DTFS)
Conjugation and Conjugate Symmetry
Case II If 𝑥(𝑛) is real and odd, then its Fourier series coefficients are purely
imaginary and odd.
𝑋−𝑘 = 𝑋 ∗ 𝑘 = −𝑋𝑘
Case III Even and odd decomposition of real signals: If x(n) is real and
𝑥 𝑛 ↔ 𝑋𝑘
Then 𝑥𝑒 𝑛 = 𝜀 𝑥(𝑛) ↔ 𝑅ⅇ 𝑋𝑘
1.
The even part of a signal 𝑥(𝑛) is defined as
1
𝑥𝑒 𝑛 = [𝑥 𝑛 + 𝑥 −𝑛 ]
2
Proof
Using the linearity property, we get
1
𝑥𝑒 𝑛 ↔ 2Re{𝑋𝑘 }
2
𝑥𝑒 𝑛 ↔ Re{𝑋𝑘 }
1
𝑥𝑒 𝑛 ↔ 𝑋𝑘 + 𝑋−𝑘
2
1
And finally, we get 𝑥𝑒 𝑡 ↔ 𝑋𝑘 + 𝑋 ∗ 𝑘
2
Discrete-Time Fourier Series (DTFS)
Conjugation and Conjugate Symmetry
Case III Even and odd decomposition of real signals: If x(n) is real and
𝑥 𝑛 ↔ 𝑋𝑘
2.
The odd part of a signal 𝑥(𝑛) is defined as
1
𝑥𝑜 𝑛 ↔ [𝑥 𝑛 − 𝑥 −𝑛 ]
2
Proof
Using the linearity property, we get
1
𝑥𝑜 𝑛 ↔ 𝑋𝑘 − 𝑋−𝑘
2
1
𝑥𝑜 𝑛 ↔ 𝑋𝑘 − 𝑋 ∗ 𝑘
2
1
And finally, we get 𝑥𝑜 𝑛 ↔ 2jIm{𝑋𝑘 }
2
Discrete-Time Fourier Series (DTFS)
Parseval’s Relation
If 𝑥(𝑛) is periodic signal with the same period 𝑁, and
1
𝑥 𝑛 ↔ 𝑋𝑘 Then σ𝑛= 𝑁 𝑥(𝑛) 2 = σ𝑛= 𝑁 𝑋𝑘 2
𝑁
Proof
Consider the LHS of the equation, we have
1 1
𝑥(𝑛) = 𝑥(𝑛)𝑥 ∗ (𝑛)
2
𝑁 𝑁
𝑛= 𝑁 𝑛= 𝑁
∗
1
= 𝑥(𝑛) 𝑋𝑘 ⅇ 𝑗𝑘𝑤𝑜𝑛
𝑁
𝑛= 𝑁 𝑛= 𝑁
1
= 𝑥(𝑛) 𝑋 ∗ 𝑘 ⅇ −𝑗𝑘𝑤𝑜𝑛
𝑁
𝑛= 𝑁 𝑛= 𝑁
1
= 𝑋∗𝑘 𝑥(𝑛)ⅇ −𝑗𝑘𝑤𝑜𝑛
𝑁
𝑛= 𝑁 𝑛= 𝑁
= 𝑋 ∗ 𝑘 𝑋𝑘
𝑛= 𝑁
= 𝑋𝑘 2
𝑛= 𝑁
Discrete-Time Fourier Series (DTFS)
Systems with Periodic Inputs
The response of an LTI system to a sinusoidal input leads to a characterization of
system behavior that is termed the frequency response of the system.
The impulse response of a system be h(n) and the input be x(n)=ⅇ 𝑖𝑤0𝑛 , then the
convolution integral gives the output as
𝑦 𝑛 =ℎ 𝑛 ∗𝑥 𝑛
∞ ∞
𝑗 𝑤𝑜 𝑡+∠𝐻 𝑒 𝑗𝑤𝑜
Phase response 𝑦 𝑛 = 𝐻 ⅇ 𝑗𝑤𝑜 ⅇ
Discrete-Time Fourier Series (DTFS)
Systems with Periodic Inputs
𝑗𝑤𝑜
In polar form 𝐻 ⅇ 𝑗𝑤𝑜 = 𝐻(ⅇ 𝑗𝑤𝑜 ) ⅇ ∠𝐻(𝑒 )
𝑗 𝑤𝑜 𝑡+∠𝐻 𝑒 𝑗𝑤𝑜
Phase response 𝑦 𝑛 = 𝐻 ⅇ 𝑗𝑤𝑜 ⅇ
The discrete-time Fourier Series (DTFS) representation of a periodic signal 𝑥(𝑛) (with
period N and frequency 𝜔0=2𝜋𝑁
) can be written as
𝑥 𝑛 = 𝑋𝑘ⅇ 𝑗𝑘𝜔0𝑛
𝑘=<𝑁>
1
Substituting 𝑋𝑘 = σ𝑚= <𝑁> 𝑥(𝑚)ⅇ −𝑗𝑘𝜔0𝑚 in the DTFS definition, we obtain
𝑁
1
𝑥 𝑛 = σ𝑘= <𝑁>( σ𝑚= <𝑁> 𝑥(𝑚)ⅇ −𝑗𝑘𝜔0𝑚 )ⅇ 𝑗𝑘𝜔0𝑛
𝑁
or
𝜔0
𝑥 𝑛 = ( 𝑥(𝑚)ⅇ −𝑗𝑘𝜔0𝑚 )ⅇ 𝑗𝑘𝜔0𝑛
𝑘= <𝑁> 𝑚= <𝑁> 2𝜋
Discrete-Time Fourier Transform (DTFT)
FT Representation of Aperiodic Discrete-Time Signals
Since the inner and outer summation is over any arbitrary range of 𝑚 of width 𝑁
𝑁
−1 𝜔0
𝑥 𝑛 = σ𝑘0+𝑁−1
𝑘=𝑘0 ( σ 2
𝑚=−𝑁/2
𝑥(𝑚)ⅇ −𝑗𝑘𝜔0𝑚 ) ⅇ 𝑗𝑘𝜔0𝑛 for 𝑁 even
2𝜋
𝑁−1
𝜔0
𝑥 𝑛 = σ𝑘0+𝑁−1
𝑘=𝑘0 (σ
2
𝑁−1 𝑥(𝑚)ⅇ
−𝑗𝑘𝜔0𝑚 ) ⅇ 𝑗𝑘𝜔0𝑛 for 𝑁 odd
𝑚=− 2𝜋
2
The fundamental period 𝑁 → ∞. The inner summation covers an infinite range.
The outer summation approaches an integral in 𝑤 = 𝑘𝑤0 that covers a range of
𝑘0 ≤ 𝑘 ≤ 𝑘0 + 𝑁 − 1
𝑘0 ≤ 𝑘 < 𝑘0 + 𝑁
𝜔
𝑘0 ≤ < 𝑘0 + 𝑁
𝜔0
𝑘0𝜔0 ≤ 𝜔 < 𝑘0𝜔0 + 𝑁𝜔0
𝑘0𝜔0 ≤ 𝜔 < 𝑘0𝜔0 + 2𝜋
1
Therefore, 𝑥 𝑛 =
2𝜋
(σ∞
𝑚=−∞ 𝑥(𝑚)ⅇ
−𝑗𝜔𝑚 )ⅇ 𝑗𝜔𝑛 ⅆ𝜔
1
Denoting the summation by 𝑋 ⅇ 𝑗𝜔 , 𝑥 𝑛 = 𝑋(ⅇ 𝑗𝜔 )ⅇ 𝑗𝜔𝑛 ⅆ𝜔
2𝜋
Where 𝑗𝜔 ∞
𝑋(ⅇ ) = σ𝑚=−∞ 𝑥(𝑚)ⅇ −𝑗𝜔𝑚
Discrete-Time Fourier Transform (DTFT)
FT Representation of Aperiodic Discrete-Time Signals
The Fourier transform 𝑋(ⅇ 𝑗𝜔 ) is a complex function of the real variable 𝑤 and can
be written in rectangular form as .
𝑿 𝒆𝒋𝝎 = 𝑿𝑹 𝒆𝒋𝝎 + 𝒋𝑿𝑰 𝒆𝒋𝝎
where 𝑋𝑅 ⅇ 𝑗𝜔 and 𝑋𝐼 ⅇ 𝑗𝜔 are, respectively, the real and imaginary parts of
𝑋 ⅇ 𝑗𝜔
1 ∗
𝑋𝑅 ⅇ 𝑗𝜔 = [𝑋 ⅇ 𝑗𝜔 + 𝑋 ⅇ 𝑗𝜔 ]
2
1 ∗
𝑋𝐼 ⅇ 𝑗𝜔 = [𝑋 ⅇ 𝑗𝜔 − 𝑋 ⅇ 𝑗𝜔 ]
2𝑗
∗
where 𝑋 ⅇ 𝑗𝜔 denotes the complex conjugate of 𝑋 ⅇ 𝑗𝜔 .
The relation between the rectangular and polar forms of 𝑋(ⅇ 𝑗𝜔 ) follows as
𝑋𝑅 ⅇ 𝑗𝜔 = |𝑋 ⅇ 𝑗𝜔 |cos(𝜃 𝜔 )
𝑋𝐼 ⅇ 𝑗𝜔 = |𝑋 ⅇ 𝑗𝜔 |sin(𝜃 𝜔 )
Discrete-Time Fourier Transform (DTFT)
FT Representation of Aperiodic Discrete-Time Signals
𝑋 ⅇ 𝑗𝜔 = √(𝑋𝑅2 ⅇ 𝑗𝜔 + 𝑋𝐼2 ⅇ 𝑗𝜔 )
𝑗𝜔 −1
𝑋𝐼 ⅇ 𝑗𝜔
𝜃 𝜔 = ∠𝑋 ⅇ = tan [ ]
𝑋𝑅 ⅇ 𝑗𝜔
𝑋𝐼 𝑒 −𝑗𝜔 𝑋𝐼 𝑒 𝑗𝜔 𝑋𝐼 𝑒 𝑗𝜔
∠𝑋 ⅇ −𝑗𝜔 = −1
tan [ ]= −1
tan [− ] = −1
−tan [ ] = −∠𝑋 ⅇ 𝑗𝜔
𝑋𝑅 𝑒 −𝑗𝜔 𝑋𝑅 𝑒 𝑗𝜔 𝑋𝑅 𝑒 𝑗𝜔
∠𝑋 ⅇ −𝑗𝜔 = −∠𝑋 ⅇ 𝑗𝜔
𝑋 ⅇ 𝑗𝜔 = 𝑥(𝑛)ⅇ −𝑗𝜔𝑛
𝑛=−∞
For any integer k, we have
∞
𝑛=−∞
= σ𝑛=−∞ 𝑥(𝑛)ⅇ −𝑗2𝜋𝑘𝑛 ⅇ −𝑗𝜔𝑛
∞
= σ∞𝑛=−∞ 𝑥(𝑛)ⅇ
−𝑗𝜔𝑛 = 𝑋 ⅇ 𝑗𝜔
We have used the fact that ⅇ −𝑗2𝜋𝑘𝑛 = 1. Hence 𝑋 ⅇ 𝑗𝜔 is periodic with period 2𝜋.
However, this property is a consequence of the fact that frequency range for any
discrete-time signal is unique over the frequency interval of (−𝜋, 𝜋) or (0,
2𝜋), and any frequency outside this interval is equivalent to a frequency within this
interval.
Discrete-Time Fourier Transform (DTFT)
Convergence of DTFT
An infinite series may or may not converge. The Fourier transform 𝑋 ⅇ 𝑗𝜔 of 𝑥(𝑛) is
said to exist if the series converges in some sense.
𝐾
𝑋𝐾 ⅇ 𝑗𝜔 = 𝑥(𝑛)ⅇ −𝑗𝜔𝑛
𝑛=−𝐾
The partial sum of the weighted complex exponentials. Then, for uniform
convergence of 𝑋 ⅇ 𝑗𝜔 ,
lim 𝑋 ⅇ 𝑗𝜔 − 𝑋𝐾 ⅇ 𝑗𝜔 =0
𝐾→∞
lim 𝑋𝐾 ⅇ 𝑗𝜔 = 𝑋 ⅇ 𝑗𝜔
𝐾→∞
Uniform convergence is guaranteed if x(n) is absolutely summable. Indeed, if
∞
|𝑥 𝑛 | < ∞
𝑛=−∞
|X(ⅇ 𝑗𝜔 | = |σ𝑛=−∞ 𝑥(𝑛)ⅇ −𝑗𝜔𝑛 | =
∞ ≤ σ∞ 𝑛=−∞ 𝑥 𝑛 ||ⅇ −𝑗𝜔𝑛 |
|X(ⅇ 𝑗𝜔 )| ≤ σ𝑛=−∞ ∞ |x(n)|< ∞
Some sequences are not absolutely summable, but they are square summable,
σ∞ ∞
𝑛=−∞ |𝑥 𝑛 | ≤ (σ𝑛=−∞ |𝑥 𝑛 |)
2 2
1 1 𝑤
𝑥(𝑛) = 𝑋 ⅇ 𝑗𝜔 ⅇ 𝑗𝜔𝑛 ⅆ𝜔 = 𝑐 𝑤ⅇ 𝑗𝜔𝑛 ⅆ𝜔
2𝜋 2𝜋 𝑐
1 𝑒𝑗𝑤𝑛 𝜔𝑐 sin(𝜔𝑐𝑛)
= | = 𝑛 ≠ 0
2𝜋 𝑗𝑛 −𝜔𝑐 𝑛𝜋
Linearity
The relationship between a discrete-time sequence 𝑥(𝑛) and its Fourier transform
𝑋 ⅇ 𝑗𝜔
𝑥(𝑛) ↔ 𝑋 ⅇ 𝑗𝜔
If 𝑥1(𝑛) ↔ 𝑋1 ⅇ 𝑗𝜔 and 𝑥2(𝑛) ↔ 𝑋2 ⅇ 𝑗𝜔
then 𝑎𝑥1(𝑛) + 𝑏𝑥2(𝑛) ↔ 𝑎𝑋1 ⅇ 𝑗𝜔 + 𝑏𝑋2 ⅇ 𝑗𝜔
Proof
∞
= 𝑎 σ∞
𝑛=−∞ 𝑥1(𝑛)ⅇ
−𝑗𝜔𝑛 + 𝑏 σ∞
𝑛=−∞ 𝑥2(𝑛)ⅇ
−𝑗𝜔𝑛
= 𝑎𝑋1 ⅇ 𝑗𝜔 + 𝑏𝑋2 ⅇ 𝑗𝜔
Discrete-Time Fourier Transform (DTFT)
Properties of Discrete-time Fourier Transform
The relationship between the time-domain and frequency-domain representations of
a signal.
Time Shifting
The relationship between a discrete-time sequence 𝑥(𝑛) and its Fourier transform
𝑋 ⅇ 𝑗𝜔
If 𝑥(𝑛) ↔ 𝑋 ⅇ 𝑗𝜔
then 𝑥(𝑛 − 𝑛0) ↔ 𝑋 ⅇ 𝑗𝜔 ⅇ −𝑗𝜔𝑛0
Proof The Fourier transform of 𝑥(𝑛 − 𝑛0) is
∞
= 𝑥 𝑛 ⅇ −𝑗(𝜔−𝜔0)𝑛
𝑛=−∞
= 𝑋 ⅇ 𝑗 𝜔−𝜔0
𝑌 ⅇ 𝑗𝜔 = 𝑦 𝑛 ⅇ −𝑗𝜔𝑛 = 𝑥 −𝑛 ⅇ −𝑗𝜔𝑛
𝑛=−∞ 𝑛=−∞
Substituting 𝑚 = −𝑛 into the equation, we obtain
∞ ∞
𝑦 ⅇ 𝑗𝜔 = 𝑥 𝑟 ⅇ −𝑗𝜔𝑚𝜏 = 𝑋 ⅇ 𝑗𝑚𝜔
𝑟=−∞
The signal spread out and slowed down in time by taking 𝑚 > 1, its Fourier transform
is compressed.
Discrete-Time Fourier Transform (DTFT)
Properties of Discrete-time Fourier Transform
The relationship between the time-domain and frequency-domain representations of
a signal.
Differentiation in Time Domain
The discrete-time parallel to the differentiation property of the continuous-time
Fourier transform involves the use of the first-difference operation.
If 𝑥(𝑛) ↔ 𝑋 ⅇ 𝑗𝜔
Then 𝑦 𝑛 = 𝑥 𝑛 − 𝑥 𝑛 − 1 ↔ 𝑌 ⅇ 𝑗𝜔 = 1 − ⅇ −𝑗𝜔 𝑋 ⅇ 𝑗𝜔
Proof Given that 𝑥 𝑛 = 𝑋 ⅇ 𝑗𝜔
𝑥 𝑛 − 1 ↔ 𝑋 ⅇ 𝑗𝜔 ⅇ −𝑗𝜔
Using the time-shifting property, we get
𝑥 𝑛 − 𝑥 𝑛 − 1 ↔ 1 − ⅇ −𝑗𝜔 𝑋 ⅇ 𝑗𝜔
𝑋 ⅇ 𝑗𝜔 = 𝑥 𝑛 ⅇ −𝑗𝜔𝑛
𝑛=−∞
The Fourier transform maps the convolution of two signals into the product of their
Fourier transforms.
Proof The Fourier transform of 𝑥1 𝑛 ∗ 𝑥2 𝑛 is ∞
𝐹 𝑥𝑙 𝑛 ∗ 𝑥2 𝑛 = 𝑥1 𝑛 ∗ 𝑥2 𝑛 ⅇ −𝑗𝜔𝑛
𝑛=−∞
∞
= 𝑛=−∞ σ∞𝑚=−∞ 𝑥1 𝑚 𝑥2 𝑛 − 𝑚 ⅇ
−𝑗𝜔𝑛
𝐹 𝑥, 𝑛 ∗ 𝑥2 𝑛 = 𝑥1 𝑚 𝑥2 𝑛 − 𝑚 ⅇ −𝑗𝜔𝑛
𝑛=−∞
𝑚=−∞
Discrete-Time Fourier Transform (DTFT)
Convolution Property
The relationship between a discrete-time sequence 𝑥(𝑛) and its Fourier transform
𝑋 ⅇ 𝑗𝜔
If 𝑥1(𝑛) ↔ 𝑋1 ⅇ 𝑗𝜔 and 𝑥2(𝑛) ↔ 𝑋2 ⅇ 𝑗𝜔
then 𝑥 𝑛 ∗ 𝑥 𝑛 ↔ 𝑋 ⅇ 𝑗𝜔 ∗ 𝑋 ⅇ 𝑗𝜔
1 2 1 2
𝐹 𝑥, 𝑛 ∗ 𝑥2 𝑛 = 𝑥1 𝑚 𝑥2 𝑛 − 𝑚 ⅇ −𝑗𝜔𝑛
𝑛=−∞
𝑚=−∞
Applying the time-shifting property, the bracketed term is 𝑋2 ⅇ 𝑗𝜔 ⅇ −𝑗𝜔𝑚 . Substituting
this into this equation yields ∞
𝐹 𝑥, 𝑛 ∗ 𝑥2 𝑛 = 𝑥1 𝑚 𝑋2 ⅇ 𝑗𝜔 ⅇ −𝑗𝜔𝑚
𝑚=−∞
∞
= 𝑋2 ⅇ 𝑗𝜔 𝑥1 𝑚 ⅇ −𝑗𝜔𝑚
𝑚=−∞
𝐹 𝑥𝑙 𝑛 ∗ 𝑥2 𝑛 ↔ 𝑋2 ⅇ 𝑗𝜔 ∗ 𝑋1 ⅇ 𝑗𝜔 ↔ 𝑋1 ⅇ 𝑗𝜔 ∗ 𝑋2 ⅇ 𝑗𝜔
Therefore,
𝑥1 𝑛 ∗ 𝑥2 𝑛 ↔ 𝑋1 ⅇ 𝑗𝜔 ∗ 𝑋2 ⅇ 𝑗𝜔
Discrete-Time Fourier Transform (DTFT)
Accumulation Property
The relationship between a discrete-time sequence 𝑥(𝑛) and its Fourier transform
𝑋 ⅇ 𝑗𝜔 𝑥(𝑛) ↔ 𝑋 ⅇ 𝑗𝜔
∞ ∞
then 1
𝑥 𝑘 ↔ 𝑋 ⅇ 𝑗𝜔 + 𝜋𝑋 ⅇ 𝑗0 𝛿 𝜔 − 2𝜋𝑚
1 − ⅇ −𝑗𝜔
𝑘=−∞ 𝑚=−∞
Proof Convolving a signal 𝑥 𝑛 with a unit step function 𝑢(𝑛), we obtain
∞
𝑥 𝑛 ∗𝑢 𝑛 = 𝑥 𝑘 𝑢 𝑛−𝑘
𝑘=−∞
1 𝑛−𝑘 ≥0 →𝑘 ≤𝑛
Since 𝑢 𝑛 − 𝑘 = ቊ
0 𝑛−𝑘 <0 →𝑘 >𝑛
∞
𝑥 𝑛 ∗𝑢 𝑛 = 𝑥 𝑘
𝑘=−∞
Now we can prove the accumulation property of the Fourier transform.
∞ ∞
𝑥 𝑘 =𝑥 𝑛 ∗𝑢 𝑛 𝐹[ 𝑥 𝑘 ] = 𝐹[𝑥 𝑛 ∗ 𝑢 𝑛 ]
𝑘=−∞ 𝑘=−∞
Discrete-Time Fourier Transform (DTFT)
Accumulation Property
∞ ∞
𝑥 𝑘 =𝑥 𝑛 ∗𝑢 𝑛 𝐹[ 𝑥 𝑘 ] = 𝐹[𝑥 𝑛 ∗ 𝑢 𝑛 ]
𝑘=−∞ 𝑘=−∞
𝐹 𝑥 𝑘 = 𝑋 ⅇ 𝑗𝜔 𝑈 ⅇ 𝑗𝜔
𝑘=−∞
1
= 𝑋 ⅇ 𝑗𝜔 + 𝜋 σ∞
𝑚=−∞ 𝛿 𝜔 − 2𝜋𝑚
1−𝑒 −𝑗𝜔
1
= 𝑋 ⅇ 𝑗𝜔 𝑋 ⅇ 𝑗𝜔 + 𝜋𝑋 ⅇ 𝑗𝜔 σ∞
𝑚=−∞ 𝛿 𝜔 − 2𝜋𝑚
1−𝑒 −𝑗𝜔
∞
1
= 𝑋 ⅇ 𝑗𝜔 −𝑗𝜔
𝑋 ⅇ 𝑗𝜔 + 𝜋𝑋 ⅇ 𝑗0 𝛿 𝜔 − 2𝜋𝑚
1−ⅇ
𝑚=−∞
Therefore,
∞ ∞
1
𝐹 𝑥 𝑘 ↔ 𝑋 ⅇ 𝑗𝜔 −𝑗𝜔
𝑋 ⅇ 𝑗𝜔 + 𝜋𝑋 ⅇ 𝑗0 𝛿 𝜔 − 2𝜋𝑚
1−ⅇ
𝑘=−∞ 𝑚=−∞
Discrete-Time Fourier Transform (DTFT)
Multiplication (Modulation or Windowing) Property
The relationship between a discrete-time sequence 𝑥(𝑛) and its Fourier transform
𝑋 ⅇ 𝑗𝜔
If 𝑥1(𝑛) ↔ 𝑋1 ⅇ 𝑗𝜔 and 𝑥2(𝑛) ↔ 𝑋2 ⅇ 𝑗𝜔
then 1
𝑥1 𝑛 𝑥2 𝑛 = න 𝑋1 ⅇ 𝑗𝜃 𝑋2 ⅇ 𝑗 𝜔−𝜃 ⅆ𝜃
2𝜋
2𝜋
Proof The Fourier transform of 𝑥1 𝑛 𝑥2 𝑛 is given by
∞
𝐹 𝑥1 𝑛 𝑥2 𝑛 = 𝑥1 𝑛 𝑥2 𝑛
𝑛=−∞
1
= න 𝑋1 ⅇ 𝑗𝜃 𝑋2 ⅇ 𝑗 𝜔−𝜃 ⅆ𝜃
2𝜋
2𝜋
∞
1
=ා න 𝑋1 ⅇ 𝑗𝜃 𝑋2 ⅇ 𝑗 𝜃𝑛 ⅆ𝜃 𝑥2 𝑛 ⅇ −𝑗𝜔𝑛
2𝜋
2𝜋
𝑛=−∞
Discrete-Time Fourier Transform (DTFT)
Multiplication (Modulation or Windowing) Property
𝐹 𝑥1 𝑛 𝑥2 𝑛 = 𝑥1 𝑛 𝑥2 𝑛 1
= න 𝑋1 ⅇ 𝑗𝜃 𝑋2 ⅇ 𝑗 𝜔−𝜃 ⅆ𝜃
𝑛=−∞ 2𝜋
2𝜋
∞
1
=ා න 𝑋1 ⅇ 𝑗𝜃 𝑋2 ⅇ 𝑗 𝜃𝑛 ⅆ𝜃 𝑥2 𝑛 ⅇ −𝑗𝜔𝑛
2𝜋
2𝜋
𝑛=−∞
∗
Proof The Fourier transform of 𝑥 𝑛 is given by
∞ ∞ ∗
𝐹 𝑥∗ 𝑛 = 𝑥 ∗ 𝑛 ⅇ −𝑗𝜔𝑛 = 𝑥 𝑛 ⅇ 𝑗𝜔𝑛
𝑛=−∞ 𝑛=−∞
∞ ∗
= 𝑥 𝑛 ⅇ −𝑗 −𝜔 𝑛
𝑛=−∞
∗
𝐹 𝑥∗ 𝑛 = 𝑋 ⅇ −𝑗𝜔 = 𝑋 ∗ ⅇ −𝑗𝜔
∞ 2 1 2
Then 𝐸𝑥 = 𝑛=−∞ 𝑥 𝑛 = 𝑋 ⅇ 𝑗𝜔 d𝜔
2𝜋
1 ∞
= ධ 𝑋∗ ⅇ 𝑗𝑤 𝑛=−∞ 𝑥(𝑛)ⅇ −𝑗𝜔𝑡 d𝜔
2𝜋 2𝜋
∞
2
1 1 2
𝑥 𝑛 = න 𝑋 ∗ ⅇ 𝑗𝜔 𝑋 ⅇ 𝑗𝜔 d𝜔 = න 𝑋 ⅇ 𝑗𝑤 d𝜔
2𝜋 2𝜋
𝑛=−∞ 2𝜋 2𝜋
Discrete-Time Fourier Transform (DTFT)
Fourier Transform of Periodic Signals
The signal 𝑥 𝑛 has the DTFT representation
𝑥 𝑛 = 𝑋𝑘 ⅇ 𝑗𝑘𝜔0𝑛
𝑘= 𝑁
𝑋 ⅇ 𝑗𝜔 = 𝑋𝑘 𝐹 ⅇ 𝑗𝑘𝜔0 𝑛
𝐾=〈𝑁〉
𝑗𝑤0 𝑛 σ𝑚=∞
Using ⅇ ↔ 𝑚=−∞ 2𝜋𝛿(𝑤− 𝑤0 − 2𝜋𝑚)
𝐹 ⅇ 𝑗𝑘𝜔0 𝑛 = 2𝜋𝛿 𝜔 − 𝑘𝜔0 , 0 ≤ 𝜔 ≤ 2𝜋
𝑋 ⅇ 𝑗𝜔 = 𝑋𝑘 2𝜋𝛿 𝜔 − 𝑘𝜔0 , 0 ≤ 𝜔 ≤ 2𝜋
𝑘=〈𝑁〉
𝑋(ⅇ 𝑗𝜔 ) = 2𝜋 𝑋𝑘 𝛿 𝜔 − 𝑘𝜔0 , 0 ≤ 𝜔 ≤ 2𝜋
𝑘=〈𝑁〉
Since the DTFT is periodic with period 2𝜋. 𝑁𝑤0 = 2𝜋. Thus, 𝑋(ⅇ 𝑗𝜔 ) can be compactly
∞
𝑋 ⅇ 𝑗𝜔 = 2𝜋 𝑋𝑘 𝛿 𝜔 − 𝑘𝜔0
𝑘=−∞
Discrete-Time Fourier Transform (DTFT)
Signal Transmission Through Linear Time-invariant Systems
The signal 𝑥 𝑛 and 𝑦 𝑛 are the input and output of a linear time-invariant systems
(LTI) system with impulse response ℎ(𝑛), then
𝑦 𝑛 =𝑥 𝑛 ∗ℎ 𝑛
Application of the time convolution property yields
𝐹 𝑦 𝑛 =𝐹 𝑥 𝑛 ∗𝐹 ℎ 𝑛
𝑌 ⅇ 𝑗𝜔 = 𝑋 ⅇ 𝑗𝜔 𝐻 ⅇ 𝑗𝜔
𝑗𝜔
𝑌 ⅇ 𝑗𝜔
𝐻 ⅇ =
𝑋 ⅇ 𝑗𝜔
𝑒 𝑗𝜔 𝑗𝜔 𝑒 𝑗𝜔
𝑦 ⅇ 𝑗𝜔 ⅇ 𝑗∠𝑦 = 𝑋 ⅇ 𝑗𝜔 ⅇ 𝑗∠𝑥𝑒 𝐻 ⅇ 𝑗𝜔 ⅇ 𝑗∠𝐻
𝑦 ⅇ 𝑗𝜔 = 𝑥 ⅇ 𝑗𝜔 𝐻 ⅇ 𝑗𝜔
∠𝑌 ⅇ 𝑗𝜔 = ∠𝑋 ⅇ 𝑗𝜔 + ∠𝐻 ⅇ 𝑗𝜔
Response to Complex Exponentials
𝑦 𝑛 = 𝑥 𝑛 ∗ ℎ 𝑛 = σ∞
𝑚=−∞ ℎ 𝑚 𝑥 𝑛 − 𝑚
∞ ∞
𝑦(𝑛)=𝑚=−∞ ℎ 𝑚 ⅇ 𝑗𝜔0 𝑛−𝑚 𝑦 𝑛 = 𝑚=−∞ ℎ 𝑚 ⅇ −𝑗𝜔0 𝑚 ⅇ 𝑗𝜔0 𝑛
∞
𝑦 𝑛 = 𝐻 ⅇ 𝑗𝜔0 ⅇ 𝑗𝜔0 𝑛 𝐻 ⅇ 𝑗𝜔0 = 𝑚=−∞ ℎ 𝑚 ⅇ −𝑗𝜔0 𝑚
𝑒 𝑗𝜔0
𝐻 ⅇ 𝑗𝜔0 = 𝐻 ⅇ 𝑗𝜔0 ⅇ 𝑗∠𝐻 = 𝐻 ⅇ 𝑗𝜔0 ⅇ 𝑗𝜃 𝜔0
Discrete-Time Fourier Transform (DTFT)
Response to Sinusoidal Signal
The signal 𝑥 𝑛 be the input to the linear time-invariant systems (LTI) system be
𝑥 𝑛 = 𝐴 cos 𝜔0 𝑛 , −∞ < 𝑛 < ∞
𝐴 𝐴
𝑥 𝑛 = ⅇ 𝑗𝜔0 𝑛 + ⅇ −𝑗𝜔0 𝑛
2 2
Due to the linearity, the response 𝑦(𝑛) to the input 𝑥(𝑛) is given by
𝐴 𝐴
𝑦 𝑛 = 𝐻 ⅇ 𝑗𝜔0 ⅇ 𝑗𝜔0 𝑛 + 𝐻 ⅇ −𝑗𝜔0 ⅇ 𝑗𝜔0 𝑛
2 2
𝑦(𝑛) = 𝐴 𝐻 ⅇ −𝑗𝜔0 cos[ 𝜔0 𝑛 + 𝐻 ⅇ 𝑗𝜔0 ]
𝐿
𝑦 𝑛 = ℎ 𝑛 ∗ 𝑥 𝑛 = ℎ 𝑚 𝑥 𝑛 − 𝑚
𝑚
Discrete-Time Fourier Transform (DTFT)
Response to Causal Exponential Sequence
𝑥 𝑛 = ⅇ 𝑗𝜔0 𝑛 𝑢(𝑛)
∞
𝑦 𝑛 = ℎ 𝑛 ∗ 𝑥 𝑛 = ℎ 𝑚 𝑥 𝑛 − 𝑚
𝑚
∞ 𝑛
ℎ 𝑚 ⅇ 𝑗𝜔0 𝑛−𝑚
𝑢 𝑛 − 𝑚 = ℎ 𝑚 ⅇ −𝑗𝜔0 𝑚 ⅇ 𝑗 𝜔0 𝑛
𝑚=0 𝑚=0
∞ ∞ ∞
∞ ∞ ∞
𝒚 𝒏 = 𝑨 𝑯 𝒆𝒋𝝎𝟎 𝒄𝒐𝒔 𝝎𝟎 𝒏 − 𝝉𝒑 𝝎𝟎 +𝜽
Where
∠𝑯 𝒆𝒋𝝎𝟎 𝜽 𝝎𝟎
𝝉𝒑 (𝝎)ቚ = 𝝉𝒑 𝝎𝟎 = − =−
𝝎=𝝎𝟎 𝝎𝟎 𝝎𝟎
Group delay: When the input signal contains many sinusoidal components
with different frequencies that are not harmonically related, each component
will go through different phase delays when processed by a frequency-selective
LTI system, and the signal delay is determined using a different parameter
called the group delay
ⅆ∠𝑯 𝒆𝒋𝝎 ⅆ𝜽(𝝎)
𝝉𝒈 (𝝎) = − =−
ⅆ𝝎 ⅆ𝝎
Phase Delay and Group Delay
The group delay by using a single-frequency modulating and carrier signals
with zero phase for simplicity.
The input signal (Double-side band suppressed carrier i.e., DSB-SC
modulated signal) is given by
𝑺 𝒏 = 𝑨 𝒄𝒐𝒔 𝒘𝒎 𝒏 𝒄𝒐𝒔(𝒘𝒄 𝒏)
The cosine-product trigonometric identity to rewrite the input signal as
𝑨 𝑨 𝑨 𝑨
𝑺 𝒏 = 𝐜𝐨𝐬[(𝒘𝒄 + 𝒘𝒎 )𝒏] + 𝐜𝐨𝐬[(𝒘𝒄 − 𝒘𝒎 )𝒏] = 𝐜𝐨𝐬 𝒘𝟏 𝒏 + 𝐜𝐨𝐬 𝒘𝟐 𝒏
𝟐 𝟐 𝟐 𝟐
Where, 𝒘𝟏 = 𝒘𝒄 + 𝒘𝒎
and 𝒘𝟐 = 𝒘𝒄 − 𝒘𝒎
Where 𝜽(𝒘𝟏 ) and 𝜽(𝒘𝟐 ) are the phase shifts produced by the system
frequencies 𝒘𝟏 and 𝒘𝟐 , respectively.
Phase Delay and Group Delay
The equivalently, we can express 𝑦(𝑛) as
𝐴 𝜃 𝜔1 + 𝜃 𝜔2 𝜃 𝜔1 − 𝜃 𝜔2
𝑦(𝑛) = cos 𝜔𝑐 𝑛 + 𝜔𝑚 𝑛 + +
2 2 2
𝐴 𝜃 𝜔1 +𝜃 𝜔2 𝜃 𝜔1 −𝜃 𝜔2
+ cos 𝜔𝑐 𝑛 − 𝜔𝑚 𝑛 + −
2 2 2
𝐴 𝜃 𝜔1 +𝜃 𝜔2 𝜃 𝜔1 −𝜃 𝜔2
= cos 𝜔𝑒 𝑛 + + 𝜔𝑚 𝑛 +
2 2 2
𝐴 𝜃 𝜔1 +𝜃 𝜔2 𝜃 𝜔1 −𝜃 𝜔2
+ cos 𝜔𝑐 𝑛 + − 𝜔𝑚 𝑛 +
2 2 2
𝜃 𝑤1 + 𝜃 𝑤2 𝜃 𝑤1 − 𝜃 𝑤2
𝑦 𝑛 = Acos 𝑤𝑐 𝑛 + cos 𝑤𝑚 𝑛 +
2 2
𝜃 𝜔1 + 𝜃 𝜔2 𝜃 𝜔1 − 𝜃 𝜔2
𝑦(𝑛) = 𝐴cos 𝜔𝑐 𝑛 + cos 𝜔𝑚 𝑛+
2𝜔𝑐 2𝜔𝑚
Dr. Manjunatha. P
[email protected]
Professor
Dept. of ECE
DSP Syllabus
PART - A
The subscript a is used with x(t) to denote an analog signal. A is the amplitude, Ω is the
frequency in radians per second(rad/s), and θ is the phase in radians. The Ω is related by
frequency F in cycles per second or hertz by
Ω = 2πF
A j(Ωt+θ) A
xa (t) = Acos(Ωt + θ) = e + e −j(Ωt+θ)
2 2
As time progress the phasors rotate in opposite directions with angular ±Ω frequencies
radians per second.
A positive frequency corresponds to counterclockwise uniform angular motion, a negative
frequency corresponds to clockwise angular motion.
Fourier series
Sinusoidal functions are wide applications in Engineering and they are easy to generate.
Fourier has shown that periodic signals can be represented by series of sinusoids with
different frequency.
A signal f (t) is said to be periodic of period T if f (t) = f (t + T ) for all t.
Periodic signals can be represented by the Fourier series and non periodic signals can be
represented by the Fourier transform.
For example square wave pattern can be approximated with a suitable sum of a
fundamental sine wave plus a combination of harmonics of this fundamental frequency.
Several waveforms that are represented by sinusoids are as shown in Figure 14. This sum
is called a Fourier series.
The major difference with respect to the line spectra of periodic signals is that the spectra
of aperiodic signals are defined for all real values of the frequency variable ω.
Fourier analysis: Every composite periodic signal can be represented with a series of sine
and cosine functions with different frequencies, phases, and amplitudes.
The functions are integral harmonics of the fundamental frequency f of the composite
signal.
Using the series we can decompose any periodic signal into its harmonics.
∞
X ∞
X
f (θ) = a0 + an cos(nθ) + bn sin(nθ)
n=1 n=1
where
Z2π
1
a0 = f (θ)dθ
2π
0
Z2π
1
an = f (θ)cos(nθ)dθ
π
0
Z2π
1
bn = f (θ)sin(nθ)dθ
π
0
1
Z 2π
a0 = f (θ)dθ
2π 0
1
Z π Z 2π
= f (θ)dθ + f (θ)dθ
2π 0 π
1
Z π Z 2π
= Adθ + (−A)dθ = 0
2π 0 π
1
Z 2π
bn = f (θ) sin nθdθ
π 0
1
Z π Z 2π
= A sin nθdθ + (−A) sin nθdθ
π 0 π
cos nθ π cos nθ 2π
1 1
= −A + A
π n 0 π n π
A
= [− cos nπ + cos 0 + cos 2nπ − cos nπ]
nπ
A
= [1 + 1 + 1 + 1]
nπ
4A
= when n is odd
nπ
A
bn = [− cos nπ + cos 0 + cos 2nπ − cos nπ]
nπ
A
= [−1 + 1 + 1 − 1]
nπ
= 0 when n is even
4A 1 1 1
sin θ + sin 3θ + sin 5θ + sin 7θ + · · ·
π 3 5 7
4A 1 1 1
sin θ + sin 3θ + sin 5θ + sin 7θ + · · ·
π 3 5 7
0.5
sin(θ)
0
−0.5
xsin = sin(2*pi*f*t);
f (θ)
0
x1 = sin(2*pi*f*t); −0.5
−1
x3 = (1/3)*sin(3*2*pi*f*t); 0 0.005 0.01 0.015 0.02 0.025
θ
0.03 0.035 0.04 0.045 0.05
x5 = (1/5)*sin(5*2*pi*f*t);
x7 = (1/7)*sin(7*2*pi*f*t); Figure 18: Square Wave
x=x1+x3+x5+x7;
subplot(2,1,1)
plot(t,xsin,’linewidth’,2);
xlabel(’\theta’,’fontsize’,16)
ylabel(’sin(\theta)’,’fontsize’,16)
title(’Fundamental sinusoidal signal’)
subplot(2,1,2)
plot(t,x,’linewidth’,2);
xlabel(’\theta’,’fontsize’,16)
ylabel(’f (\theta)’,’fontsize’,16)
title(’Reconstructed square wave by Fourier ’)
t when − T4 ≤ t ≤ T4
f (t) =
−t + T2 when T4 ≤ t ≤ 3T
4
2
Z T
2πn
bn = f (t) sin T
t dt
T 0
4
Z T /2
2πn
= f (t) sin T
t dt
T 0
4
Z T /4 4
Z T /4
T
2πn 2πn
= t sin T
t dt + −t + sin T
t dt
T 0 T 0 2
" 2 #
4 T πn
= 2 sin 2
T 2πn
2T
sin πn
= 2
2π 2 n2
= 0 when n is even
2T 2π 1 6π 1 10π
sin t − sin t + sin t − · · ·
π2 T 32 T 52 T
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September
5] 11, 2014 19 / 91
Fourier series Fourier series
∞
X ∞
X
f (θ) = a0 + an cos nθ + bn sin nθ
n=1 n=1
e jθ + e −jθ e jθ − e −jθ
cosθ = sinθ =
2 2j
an cos nθ + bn sin nθ =
an − jbn an + jbn
let cn = c−n =
2 2
where
an − jbn
cn =
2
5
4
3
2
1
0
-1 0 200 400 600
0 800 1000 1200 14
400
-2
-3
-4
-5
Fourier Transform
∞
X when θ = π
f (θ) = cn e jnθ
n=−∞ 2πt T
π= ⇒ t=
T 2
where
1
Z π
cn = f (θ)e −jnθ dθ ∞
2π −π
X
f (t) = cn e jnωt
n=−∞
θ = ωt
ω is the angular velocity in radians per
1
Z T /2
second.
cn = f (t)e −jnωt dt
T −T /2
ω = 2πf and θ = 2πft
2π 2π
θ= t and dθ = dt
T T
when θ = −π
2πt T
−π = ⇒ t=−
T 2
P R
T ⇒ ∞ ∆ω ⇒ dω and ⇒
1
Z T /2
cn = f (t)e −jnωt dt
T 1
Z ∞ Z ∞
−T /2
f (t) = f (t)e(−jωt) dt e(jωt) dω
2 −∞ −∞
As T approaches infinity
ω approaches zero
and n becomes meaningless 1
Z ∞
nω ⇒ ω ω ⇒ ∆ω f (t) = F (ω)e(jωt) dω
2π 2 −∞
T ⇒ ∆ω
ω
Z ∞
f (t) =
X
cω e jωt F (ω) = f (t)e(−jωt) dt
−∞
n=−ω
∆ω
Z T /2
cω = f (t)e −jωt dt
2π −T /2
Z1/2
1 1/2
F (ω) = exp(−jωt)dt = [exp(−jωt)]−1/2
−jω
−1/2
1
= [exp(−jω/2) − exp(jω/2)]
−jω
1 exp(jω/2) − exp(−jω/2)
=
(ω/2) 2j
sin(ω/2)
=
(ω/2)
sinx
= sinc(ω/2) since it is form
x
Z∞
F (ω) = exp( − at) exp(−jωt)dt
0
Z∞ Z∞
= exp(−at − jωt)dt = exp(−[a + jω]t)dt
0 0
−1 −1
= exp(−[a + jω]t)|+∞
0 = [exp(−∞) − exp(0)]
a + jω a + jω
−1
= [0 − 1]
a + jω
1
=
a + jω
Z∞
δ(t) exp(−iω t) dt = exp(−iω [0]) = 1
−∞
Z∞
1 exp(−iω t) dt = 2π δ(ω)
−∞
Z∞
F {exp(iω0 t)} = exp(iω0 t) exp(−i ω t) dt
−∞
Z∞
= exp(−i [ω − ω0 ] t) dt
−∞
= 2π δ(ω − ω0 )
Z∞
F {cos(ω0 t)} = cos(ω0 t) exp(−j ω t) dt
−∞
Z∞
1
= [exp(j ω0 t) + exp(−j ω0 t)] exp(−j ω t) dt
2
−∞
Z∞ Z∞
1 1
= exp(−j [ω − ω0 ] t) dt + exp(−j [ω + ω0 ] t) dt
2 2
−∞ −∞
= π δ(ω − ω0 ) + π δ(ω + ω0 )
Figure 33: A signal with four different frequency components at four different time intervals
Applications of DFT:
Spectral analysis
Convolution of signals
Partial differential equations
Multiplication of large integers
Data compression
Fourier Series is
∞
X ∞
X
x(θ) = a0 + an cos(nθ) + bn sin(nθ)
n=1 n=1
2π
1
R
where a0 = 2π
x(θ)dθ
0
Z2π Z2π
1 1
an = x(θ)cos(nθ)dθ bn = x(θ)sin(nθ)dθ
π π
0 0
∞ Z T /2
X 1
x(t) = cn e jnωt where cn = x(t)e −jnωt dt
n=−∞
T −T /2
DFT transforms the time domain signal samples to the frequency domain components.
Signal
Amplitude
Amplitude
Signal Spectrum
Time Frequency
∞
X
X (ω) = x(n)e −jωn
n=−∞
−1 N−1
2π X X
X k = ··· + x(n)e −j2πkn/N + x(n)e −j2πkn/N
N n=−N n=0
2N−1
X
+ x(n)e −j2πkn/N + · · ·
n=N
∞
X lN+N−1
X
= x(n)e −j2πkn/N
n=−∞ n=lN
By changing the index in the inner summation from n to n − lN and interchanging the
order of summation
N−1 ∞
2π X X 2π
X k = x(n − lN) e −j N k(n−lN)
N n=0 n=−∞
N−1 ∞
X X 2π
= x(n − lN) e −j N kn e −j2πkl
n=0 n=−∞
N−1 ∞
2π X X
X k = x(n − lN) e −j2πkn/N k = 0, 1, 2, . . . N − 1
N n=0 n=−∞
∞
X
Let xp (n) = x(n − lN)
n=−∞
The term xp (n) is obtained by the periodic repetition of x(n) every N samples hence it is
a periodic signal. This can be expanded by Fourier series as
N−1
X
xp (n) = ck e j2πkn/N n = 0, 1, · · · N − 1
k=0
N−1
1 X
ck = xp (n)e −j2πkn/N k = 0, 1, · · · N − 1
N n=0
Upon comparing
1 2π
ck = X k k = 0, 1, · · · N − 1
N N
N−1
1 X 2π
xp (n) = X k e j2πkn/N n = 0, 1, · · · N − 1
N k=0 N
xp (n) is the reconstruction of the periodic signal from the spectrum X (ω) (IDFT).
The equally spaced frequency samples X 2π
N
k = 0, 1, · · · N − 1 do not uniquely
represent the original sequence when x(n) has infinite duration. When x(n) has a finite
duration then xp (n) is a periodic repetition of x(n) and xp (n) over a single period is
x(n) 0≤n ≤L−1
xp (n) =
0 L≤n ≤N −1
For the finite duration sequence of length L the Fourier transform is:
L−1
X
X (ω) = x(n)e −jωn 0 ≤ ω ≤ 2π
n=0
The upper index in the sum has been increased from L − 1 to N − 1 since x(n)=0 for n ≥ L
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September
5] 11, 2014 46 / 91
Discrete Fourier Transform (DFT) Discrete Fourier Transform (DFT)
N−1
X
X (k) = x(n)e −j2πkn/N k = 0, 1, . . . N − 1
n=0
IDFT expressions is
N−1
1 X 2π
xp (n) = X k e j2πkn/N n = 0, 1, · · · N − 1
N k=0 N
N−1
1 X
x(n) = X (k) e j2πkn/N n = 0, 1, · · · N − 1
N k=0
N−1
X 2π kn
X (k) = x(n)e −j N k = 0, 1, . . . N − 1
n=0
Let
2π
WN = e −j N is called twiddle factor
N−1
X
X (k) = x(n)WNnk for k = 0, 1.., N − 1
x=0
1 1 1 1 ... 1
X (0) x(0)
1 W W2 W3 ... W N−1
X (1) x(1)
1 W2 W2 W4 ... W 2(N−1)
X (2) x(2)
= W3 W6 W9 W 3(N−1) .
1 ...
. ..
..
.
.
..
x(N − 1)
X (3)
1 W N−1 W N−2 W N−3 ... W (N−1)(N−1)
Periodicity property of WN
2π
WN = e −j N
π
kn W8kn = e − 4 kn Result
0 W80 = e 0 Magnitude 1 Phase 0
π π
1 W81 = e −j 4 1 = e −j 4 Magnitude 1 Phase −π/4
2 −j π 2 −j π
2 W8 = e 4 = e 2 Magnitude 1 Phase −π/2
−j π 3 −j3 π
3 3
W8 = e 4 = e 4 Magnitude 1 Phase −3 π4
4 −j π 4 −jπ
4 W8 = e 4 = e Magnitude 1 Phase −π
π π
5 W85 = e −j 4 5 = e −j3 5 Magnitude 1 Phase −5π/4
π π
6 W86 = e −j 4 6 = e −j3 2 Magnitude 1 Phase −3π/2
7 −j π 7 −j7 π
7 W8 = e 4 = e 4 Magnitude 1 Phase −7π/4
8 −j π 8 −j2π
8 W8 = e 4 = e Magnitude 1 Phase −2π W88 = W80
π π
9 W89 = e −j 4 9 = e −j(2π+ 4 ) Magnitude 1 Phase (−2π + π/4) W89 = W81
π π
10 W810 = e −j 4 10 = e −j(2π 2 ) Magnitude 1 Phase (−2π +π/2) W810 = W82
π 3π
11 W811 = e −j 4 11 = e −j2π+ 4 W811 = W83
Imaginary
part of WN
W85 = W813 = .. W86 = W814 = .. = j
1 1
=− +j W87 = W815 = ..
2 2
1 1
= +j
2 2
Real part
W84 = W812 = .. of WN
W80 = W88 = .. = 1
= −1
W83 = W811 = ..
W81 = W89 = ..
1 1
=− −j 1 1
2 2 W82 = W810 = .. = − j = −j
2 2
Imaginary
part of WN
W43 = j = W47 = W411
Real part
W42 = −1 = W46 W40 = 1 = W44 of WN
= W410 = W48
N−1
X 2π nk
X (k) = x(n)e −j N for k = 0, 1.., N − 1
n=0
π π π
e −j 2 = cos − jsin = −j e −jπ = cos(π) − jsin(π) = −1
2 2
3π 3π 3π
e −j 2 = cos − jsin =j e −j2π = cos(2π) − jsin2(π) = 1
2 2
for k=0,1,2,3
3
x(n)e 0 = 2e 0 + 3e 0 + 4e 0 + 4e 0 = [2 + 3 + 4 + 4] = 13
P
X (0) =
n=0
3 2πn
x(n)e −j = 2e 0 + 3e −jπ/2 + 4e −jπ + 4e −j3π/2 = [2 − 3j − 4 + 4j] = [−2 + j]
P
X (1) = 4
n=0
3 −j4πn
= 2e 0 + 3e −jπ + 4e −j2π + 4e −j3π = [2 − 3 + 4 − 4] = [−1 − 0j] = −1
P
X (2) = x(n)e 4
n=0
3 −j6πn
= 2e 0 + 3e −j3π/2 + 4e −j3π + 4e −j9π/2 = [2 + 3j − 4 − 4j][−2 − j]
P
X (3) = x(n)e 4
n=0
The DFT of the sequence x(n) = [2 3 4 4] is [13, -2+j, -1, -2-j]
N−1
X 2π nk
X (k) = x(n)e −j N for k = 0, 1.., N − 1
n=0
Solution:
x(n) = [1 2 3 4]
for k=0,1,2,3
3
x(n)e 0 = 4e 0 + 2e 0 + 3e 0 + 4e 0 = [1 + 2 + 3 + 4] = 10
P
X (0) =
n=0
3 2πn
x(n)e −j = 1e 0 + 2e −jπ/2 + 2e −jπ + 4e −j3π/2 = [1 − j2 − 3 + j4] = [−2 + j2]
P
X (1) = 4
n=0
3 −j4πn
= 1e 0 + 2e −jπ + 3e −j2π + 4e −j3π = [1 − 2 + 3 − 4] = [−1 − 0j] = −2
P
X (2) = x(n)e 4
n=0
3 −j6πn
= 1e 0 + 2e −j3π/2 + 3e −j3π + 4e −j9π/2 = [1 + 2j − 3 − 4j][−2 − j2]
P
X (3) = x(n)e 4
n=0
Find 8 point DFT for a given a sequence x(n) = [1, 1, 1, 1] assume imaginary part is zero. Also
calculate magnitude and phase
Solution:
x(n) = [1 1 1 1]
The 8 point DFT is of length 8. Append zeros at the end of the sequence. x(n) = [1 1 1 1 0 0 0
0]
1 1 1 1 1 1 1 1
X (0) x(0)
X (1) 1 W81 W82 W83 W84 W85 W86 W87 x(1)
X (2) 1 W82 W84 W86 W88 W810 W812 W814 x(2)
X (3) 1 W83 W86 W89 W812 W815 W818 W821 x(3)
= =
X (4) 1 W84 W88 W812 W816 W820 W824 W828 x(4)
X (5) 1 W85 W810 W815 W820 W825 W830 W835 x(5)
X (6) 1 W86 W812 W818 W824 W830 W836 W842 x(6)
X (7) 1 W87 W814 W821 W828 W835 W842 W849 x(7)
1 1 1 1 1 1 1 1
X (0) 1
1 √1 − j √1 −j − √1 − j √1 −1 − √1 + j √1 j 1
√ + j √1
X (1) 2 2 2 2 2 2 2 2 1
X (2)
1 −j −1 j 1 −j −1 j
1
− √1 − j √1 1 − j √1 1 + j √1 − √1 + j √1
X (3)
1 j √ 1 √ −j
1
2 2 2 2 2 2 2 2
= =
X (4) 1 −1 1 −1 1 −1 1 −1 0
− √1 + j √1 1 + j √1 1 − j √1 − √1 − j √1
X (5)
1 −j √ −1 √ j 0
2 2 2 2 2 2 2 2
X (6)
1 j −1 −j 1 j −1 −j
0
X (7) 1 0
1 √ + j √1 j − √1 + j √1 −1 − √1 − j √1 −j √1 − j √1
2 2 2 2 2 2 2 2
4 0
XR (0) 4 XI (0)
√ √
1 − j(1 + 2) XR (1) 1 XI (1) −(1 + 2)
0 0
XR (2) 0 XI (2)
√ √
1 + j(1 − 2) XR (3) 1 XI (3) (1 − 2)
= and
0 XR (4) 0 XI (4) 0
√
X (5)
√
1 − j(1 − 2)
R
1
XI (5) −(1 − 2)
X (6) 0 XI (6)
0 0
√ R √
1 + j(1 + 2) XR (7) 1 XI (7) (1 + 2)
Solution:
X (0) 1 1 1 1 2
X (1) 1
= W W2 W 3 3
=
X (2) 1 W2 W4 W6 4
X (3) 1 W3 W6 W9 4
2π 2π π
WN = e − N = e− 4 = e − 2 = −j
W 2 = −j 2 = −1, W 3 = −j 3 = j
Using the property of periodicity of W W p = W P+r .N = j with basic period N = 4
W 4 = W 4−4 = W 0 = 1, W 6 = W 6−4 = W 2 = −1, W 9 = W 9−2.4 = W 1 = −j
X (0) 1 1 1 1 2 13
X (1) 1 −j −1 j
3
−2 + j
X (2) =
=
1 −1 1 −1 4 −1
X (3) 1 j −1 −j 4 −2 − j
Solution:
X (0) 1 1 1 1 1
X (1) 1
= W W2 W 3 2
=
X (2) 1 W2 W4 W6 3
X (3) 1 W3 W6 W9 4
2π 2π π
WN = e − N = e− 4 = e − 2 = −j
W 2 = −j 2 = −1, W 3 = −j 3 = j
Using the property of periodicity of W W p = W P+r .N = j with basic period N = 4
W 4 = W 4−4 = W 0 = 1, W 6 = W 6−4 = W 2 = −1, W 9 = W 9−2.4 = W 1 = −j
X (0) 1 1 1 1 1 10
X (1) 1 −j −1 j
2
−2 + 2j
X (2) =
=
1 −1 1 −1 3 −2
X (3) 1 j −1 −j 4 −2 − 2j
Inverse DFT: Find the IDFT for X (k) = [10, − 2 + j2, − 2, − 2 − j2]
N−1
1 X 2π
x(n) = X (k)e N kn for n = 0, 1.., N − 1
N k=0
N−1
1 X 2π
x(n) = X (k)W ∗kn for n = 0, 1.., N − 1 where W∗ = e N
N k=0
N−1
1 X
x(0) = X (k)e j0 = X (0)e j0 + X (1)e j0 + X (2)e j0 + X (3)e j0
4 k=0
1
= (10 + (−2 + j2) − 2 + (−2 − j2)) = 1
4
N−1
1 X kπ π 3π
x(1) = X (k)e j 2 = X (0)e j0 + X (1)e j 2 + X (2)e jπ + X (3)e j 2
4 k=0
1
= (X (0) + jX (1) − X (2) − jX (3)
4
1
= (10 + j(−2 + j2) − (−2) − j(−2 − j2)) = 2
4
N−1
1 X kπ
x(2) = X (k)e j 2 = X (0)e j0 + X (1)e jπ + X (2)e j2π + X (3)e j3π
4 k=0
1
= (X (0) − X (1) + X (2) − X (3)
4
1
= (10 − (−2 + j2) + (−2) − (−2 − j2)) = 3
4
N−1
1 X kπ3 3π 9π
x(1) = X (k)e j 2 = X (0)e j0 + X (1)e j 2 + X (2)e j3π + X (3)e j 2
4 k=0
1
= (X (0) − jX (1) − X (2) + jX (3)
4
1
= (10 − j(−2 + j2) − (−2) + j(−2 − j2)) = 4
4
Find the Discrete Fourier Transform of the following signal: x(n), n = 0,1,2,3 = [1, 1, -1, -1].
Solution:
N=4 The matrix notation is
X = T .f
Find the Inverse Discrete Fourier Transform of the following signal: x(n), n = 0,1,2,3 = [0, 2-2j,
0, 2+2j].
Solution:
The IDFT of the discrete signal X(k)is x(n):
N = 4 and W4 = e −π/2
N−1
1 X 2π
x(n) = X (k)WN−kn for n = 0, 1.., N − 1 where W = e− N
N k=0
Find DFT for a given a sequence x[0]=1, x[1]=2, x[2]=2, x[3]=1, x[n]=0 otherwise: x =
[1,2,2,1]
Solution:
x(n) = [1 2 2 1]
for k=0,1,2,3
3
x(n)e 0 = 1e 0 + 2e 0 + 2e 0 + 1e 0 = [1 + 2 + 2 + 1] = 6
P
X (0) =
n=0
3 2πn
x(n)e −j = 1e 0 + 2e −jπ/2 + 2e −jπ + 1e −j3π/2 = [1 − j2 − 2 + j1] = [−1 − j1]
P
X (1) = 4
n=0
3 −j4πn
= 1e 0 + 2e −jπ + 2e −j2π + 1e −j3π = [1 − 2 + 2 − 1] = [0] = 0
P
X (2) = x(n)e 4
n=0
3 −j6πn
= 1e 0 + 2e −j3π/2 + 2e −j3π + 1e −j9π/2 = [1 + 2j − 2 − 1j][−1 + j1]
P
X (3) = x(n)e 4
n=0
Find IDFT for a given a sequence X[0]=6, X[1]=-1-j1, X[2]=0, X[3]=-1+j1, X[n]=0 otherwise:
x = [6, − 1 − j1, 0, − 1 + j1]
Solution:
x(n) = [6, − 1 − j1, 0, − 1 + j1]
for k=0,1,2,3
3
X (0) = 14 x(n)e 0 = 6e 0 + (−1 − j1)e 0 + 0e 0 + (−1 + j1)e 0 = 14 [6−1−j1+0−1+j1] = 1
P
n=0
3 2πn
1
x(n)e j = 6e 0 + (−1 − j1)e jπ/2 + 0e jπ + (−1 + j1)e j3π/2 =
P
X (1) = 4
4
n=0
1
4
[6− j + 1 + j + 1] = [2]
3 j4πn
X (2) = 14 x(n)e 4 = 6e 0 + (−1 − j1)e jπ + 0e j2π + (−1 + j1)e j3π =
P
n=0
1
4
[6+ (−1 − j1)(j) + 0 + (−1 + j)(−j)] = 14 [6 − j1 + 1 + 0 + 1 + j] = [2]
3 −j6πn
X (3) = 14 x(n)e 4 = 6e 0 + (−1 − j1)e j3π/2 + 0e j3π + (−1 + j1)e j9π/2 =
P
n=0
1
4
[6 + (−1 − j1)(−j) + 0 + (−1 + j)(j)] = 14 [6 + j1 − 1 + 0 − 1 − j] = [1]
Z∞
1
x(t) = X (jω)e jωt dω
2π
−∞
N−1
X 2π nk
X (k) = x(n)e −j N
x=0
N−1
X
= x(0)e 0 = 1 × 1 = 1
x=0
N−1
X 2π nk
X (k) = x(n)e −j N
x=0
N−1 N−1
X 2π nk X 2πk
= an e −j N = (ae −j N )n
x=0 x=0
N−1
!
1 − aN e −j2πk X aN1 − aN2 +1
X (k) = Using series expansion ak =
1 − ae −j2πk /N k=0
1−a
e −j2πk =1
1 − aN
X (k) =
1 − ae −j2πk /N
1 − (0.5)4 0.9375
X (k) = =
1 − 0.5e −j2πk /4 1 − 0.5e −jπ/2k
Solution:
x(0) = cos(0) = 1
x(1) = cos( 1π
4
) = 0.707
x(2) = cos( 2π
4
)=0
x(3) = cos( 3π
4
) = −0.707
x(0) 1 1 1 1 1 1
x(1) 1 1 −j −1 j
0.707
1 − j1.414
x(2) = N
=
1 −1 1 −1 0 1
x(3) 1 j −1 −j −0.707 1 + j1.414
∞
X
X e jw = x [n] e −jwn
n=−∞
sin (5ω/2)
X e jω = e −j2ω
sin (ω/2)
Consider a causal sequence x[n] where;
∞
X ∞
X
X e jw = (0.5)n u[n]e −jwn = (0.5)n (1)e −jwn
n=−∞ n=0
∞
X n 1
= 0.5e jw =
n=0
1 − 0.5e −jw
Solution:
x(0) = 4 + cos 2 (0) = 5
x(1) = 4 + cos 2 ( 2π1
10
) = 4.6545
x(2) = 4 + cos 2 ( 2π2
10
) = 4.09549
x(3) = 4 + cos 2 ( 2π3
10
) = 4.09549
x(4) = 4 + cos 2 ( 2π4
10
) = 4.09549
x(5) = 4 + cos 2 ( 2π5
10
)=5
x(6) = 4 + cos 2 ( 2π6
10
) = 4.6545
x(7) = 4 + cos 2 ( 2π7
10
) = 4.09549
x(8) = 4 + cos 2 ( 2π8
10
) = 4.09549
x(9) = 4 + cos 2 ( 2π9
10
) = 4.6545
x(n) = x(N − n)
Cosine function is even function
x(n) = x(−n)
N−1
X 2πkn
X (k) = x(n)cos 0≤k ≤N −1
n=0
N
N−1
X
2πn 2πkn
X (k) = 4 + cos 2 ( ) cos 0≤k ≤N −1
n=0
N N
IDFT expression is
N−1
1 X
x(n) = X (k)e j2πkn/N n = 0, 1, · · · N − 1 (2)
N k=0
Fourier series is
N−1
X 2π nk
xp (n) = ck e j N −∞≤n ≤∞ (3)
k=0
By comparing X (k) and ck fourier series coefficients has the form of a DFT.
x(n) = xp (n) 0 ≤ n ≤ N − 1
X (k) = Nck 0≤n ≤N −1
Fourier series has the form of an IDFT
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September
5] 11, 2014 73 / 91
Relationship of the DFT to other Transforms Relationship of the DFT to other Transforms
∞
X
X (ω) = x(n)−jωn −∞≤n ≤∞ (5)
n=−∞
∞
X 2π nk
X (k) = X (ω|ω=2πk/N ) = x(n)−j N −∞≤n ≤∞ (6)
n=−∞
∞
X
xp (n) = x(n − lN) (7)
n=−∞
xp (n) is determined by aliasing x(n) over the interval 0 ≤ n ≤ N − 1. The finite duration
sequence
xp (n) 0 ≤ n ≤ N − 1
x̂(n) =
0 Otherwise
The relation between x̂(n) and x(n) exist when x(n) is of finite duration
x(n) = x̂(n) 0≤n ≤N −1
∞
X
X (z) = x(n)z −n (8)
n=−∞
Sample X(z) at N equally spaced points on the unit circle. These points will be
Zk = e j2πk/N k = 0, 1, · · · N − 1 (9)
∞
X
X (z)|zk = e j2πk/N = x(n)e −j2πkn/N (10)
n=−∞
Parseval’s Theorem
Consider a sequence x(n) and y(n)
DFT
x(n) ↔ X (k)
DFT
y (n) ↔ Y (k)
N−1 N−1
X 1 X
x(n)y ∗ (n) = X (k)Y ∗ (k) (13)
n=0
N k=0
When x(n)=y(n)
N−1 N−1
X 1 X
|x(n)|2 = |X (k)|2 (14)
n=0
N k=0
This equation give the energy of finite duration sequence it terms of its frequency
components
1
2
−2≤n ≤2
Determine the DFT of the sequence for N=8, h(n) =
0 otherwise
Plot the magnitude and phase response for N=8
Solution:
1 1 1 1 1
h(n) = , , , ,
2 2 2 2 2
↑
DFT
xp (n) ↔ X (k)
where xp (n) is the periodic sequence of x(n) in this example x(n) is of h(n) and is of
1 1 1 1 1
h(n) = , , , ,
2 2 2 2 2
↑
There are 5 samples in h(n) append 3 zeros to the right side of the sequence h(n)
1 1 1 1 1
h(n) = , , , , , 0, 0, 0
2 2 2 2 2
↑
DFT DFT
The DFT of h(n) and hp (n) is h(n) ↔ H(k) hp (n) ↔ H(k)
h( n )
1
2
-2 -1 0 1 2 3 4 5 n
-10 -9 -8 -7 -6 -5 -4 -3 -2 -1 0 1 2 3 4 5 6 7 8 9 10 11 12 13 n
1 1 1 1 1 1 1 1
X (0) x(0)
X (1) 1 W81 W82 W83 W84 W85 W86 W87 x(1)
X (2) 1 W82 W84 W86 W88 W810 W812 W814 x(2)
X (3) 1 W83 W86 W89 W812 W815 W818 W821 x(3)
= =
X (4) 1 W84 W88 W812 W816 W820 W824 W828 x(4)
X (5) 1 W85 W810 W815 W820 W825 W830 W835 x(5)
X (6) 1 W86 W812 W818 W824 W830 W836 W842 x(6)
X (7) 1 W87 W814 W821 W828 W835 W842 W849 x(7)
2.5
W80 = W88 = W816 = W824 = W840 ... = 1
2
W81 = W89 = W817 = W825 = W833 ... = √1 − j √1
1 1.5
2 2
W82 = W810 = W818 = W826 = W834 ... = −j
.5
W83 = W811 = W819 = W827 = W835 ... = − √1 − j √1
2 2
0
W84 = W812 = W820 = W828 = W836 ... = −1 0 1 2 3 4 5 6 7 k
-180
1 1 1 1 1 1 1 1
1
X (0)
1 √1 − j √1 −j − √1 − j √1 −1 − √1 + j √1 j 1
√ + j √1 2
1
X (1) 2 2 2 2 2 2 2 2
1 −j −1 j 1 −j −1 j 2
1
X (2)
− √1 − j √1 1 − j √1 1 + j √1 − √1 + j √1 2
X (3)
1 j √ 1 √ −j
2 2 2 2 2 2 2 2 = 0
=
X (4) 1 −1 1 −1 1 −1 1 −1 0
− √1 + j √1 1 + j √1 1 − j √1 − √1 − j √1
X (5)
1 −j √ −1 √ j 0
2 2 2 2 2 2 2 2
1
X (6)
1 j −1 −j 1 j −1 −j
2
X (7) 1 1
1 √ + j √1 j − √1 + j √1 −1 − √1 − j √1 −j √1 − j √1 2
2 2 2 2 2 2 2 2
2.5 2.5∠0
1.207 1.207∠0
−0.5 0.5∠ − 180
−0.207 0.207∠ − 180
=
0.5 0.5∠0
−0.207
0.207∠ − 180
−0.5 0.5∠ − 180
1.207 1.207∠0
Dr. Manjunatha. P (JNNCE) UNIT - 1: Discrete Fourier Transforms (DFT)[1, 2, 3, 4,September
5] 11, 2014 80 / 91
Problems and Solutions on DFT Problems and Solutions on DFT
The unit sample response of the first order recursive filter is given as h(n) = an u(n)
i) Determine the Fourier transform H(ω)
ii) DFT H(k) of h(n)
iii) Relationship between H(ω) and H(k)
∞
X
H(ω) = h(n)e −jωn
n=−∞
∞
X
= an u(n)e −jωn
n=−∞
∞
X n
= (ae −jω) ∵ u(n) = 0 for n < 0
n=0
N−1
(
X N for a = 1
ak = 1−aN
1−a
for a 6= 1
k=0
Consider l=-p
−∞
X ∞
X
hp (n) = h(n + pN) hp (n) = h(n + pN)
l=∞ l=−∞
N−1
X 2π kn
H(k) = h(n)e −j N
n=0
N−1 ∞
X X 2π kn
H(k) = h(n + pN) e −j N
n=0 n=−∞
N−1 ∞
X X 2π kn
H(k) = a (n+pN)
u(n + pN) e −j N
n=0 n=−∞
N−1 ∞
" #
X X 2π kn
= a (n+pN)
e −j N ∵ u(n) = 0 for n < 0
n=0 n=0
N−1 ∞
" #
X X 2π kn
= an apN e −j N
n=0 n=0
∞ N−1
X X 2π kn
H(k) = apN an e −j N
n=0 n=0
N
X 1 − aN
ak =
k=0
1−a
∞ ∞
X X p 1 − (aN )∞+1 1
apN = aN = =
p=0 p=0
1 − aN 1 − aN
N−1 N−1
X 2π kn X 2π k)n (ae −j2πk/N )0 − (ae −j2πk/N )N
an e −j N = (ae −j N =
n=0 n=0
1 − (ae −j2πk/N )
N−1
X 2π k)n 1 − aN e −j2πk 1 − aN
(ae −j N = −j2πk/N
= ∵ e −j2πk = 1
n=0
1 − (ae ) 1 − (ae −j2πk/N )
1 1 − aN
H(k) =
1 − aN 1 − (ae −j2πk/N )
1
=
1 − (ae −j2πk/N )
1 1
H(ω) = = and H(k) =
1 − ae −jω 1 − (ae −j2πk/N )
H(k) = H(ω)|ω=2πk/N
Compute the DFT of the following finite length sequence of length N x(n) = u(n) − u(n − N)
u(n)
Unit step sequence u(n)
u(n-N)
Unit step sequence delayed by N samples
x(n)=u(n)-u(n-N)
DFT expression is
N−1
X
X (k) = x(n)e −j2πkn/N k = 0, 1, . . . N − 1
n=0
N−1
X
= 1e −j2πkn/N
n=0
N−1
"N−1 #
X X 1 − aN
= (e −j2πk/N )n (1) ak =
n=0 k=0
1−a
1 − e −j2πk 1−1
X (k) = = −j2πk/N = 0
e −j2πk/N e
When k=0 From the expression (1)
N−1
X
X (k) = (1)n = N
n=0
0 when k 6= 0
X (k) =
N when k = 0
X (k) = Nδ(k)
7 7
|X (k)|2
P P
If x(n)=[1,2,0,3,-2, 4,7,5] evaluate the following i) X(0) ii) X(4) iii) X (k) iv)
k=0 k=0
X(0) is
N−1
X
X (k) = x(n)e −j2πkn/N
n=0
N−1
X
X (0) = x(n) = 1 + 2 + 0 + 3 − 2 + 4 + 7 + 5 = 20
n=0
X(4) is
N−1
X
X (k) = x(n)e −j2πkn/N
n=0
N−1
X N−1
X N−1
X
X (4) = x(n)e −j2π4n/8 = x(n)e −jπn = x(n)(−1)n
n=0 n=0 n=0
X (4) == 1 − 2 + 0 − 3 − 2 − 4 + 7 − 5 = −8
7
P
iii) X (k)
k=0
We Know the IDFT expression as
N−1
1 X
x(n) = X (k)e j2πkn/N
N n=0
N−1
1 X
x(0) = X (k)
8 n=0
N−1
X
∴ X (k) = 8x(0) = 8 × 1 = 8
n=0
7
|X (k)|2 is
P
The value of
k=0
The expression for Parseval’s theorem is
N−1 N−1
X 1 X
|x(n)|2 = |X (k)|2
n=0
N k=0
7
|X (k)|2 is related as
P
k=0
N−1 N−1
X 1 X
|x(n)|2 = |X (k)|2
n=0
N k=0
N=8 Then
7 7
X 1X
|x(n)|2 = |X (k)|2
n=0
8 k=0
7
X 7
X
|X (k)|2 = 8 |x(n)|2 = 8[1 + 4 + 0 + 9 − 4 + 4 + 49 + 25] = 864
k=0 n=0
Dr. Manjunatha. P
[email protected]
Professor
Dept. of ECE
DSP Syllabus
PART - A
Periodicity
DFT
x(n) ↔ X (k)
if
x(n + N) = x(n)
Then
X (k + N) = X (k)
N−1
X 2π kn
X (k) = x(n)e −j N
n=0
N−1 N−1
X 2π (k+N)n X 2π kn
X (k + N) = x(n)e −j N = x(n)e −j2πn e −j N
n=0 n=0
N−1
X 2π kn
X (k + N) = x(n)e −j N = X (k) since e −j2πn = 1
n=0
Linearity
DFT
x1 (n) ↔ X1 (k)
DFT
x2 (n) ↔ X2 (k)
DFT
ax1 (n) + bx2 (n) ↔ aX1 (k) + bX2 (k)
Proof
N−1
X
X (k) = ax1 (n) + bx2 (n)WNkn
n=0
N−1
X N−1
X
= ax1 (n)WNkn + bx2 (n)WNkn
n=0 n=0
= aX1 (k) + bX2 (k)
0
xp (n) = xp (n − k)
∞
X
= x(n − k − lN)
l=−∞
0
0 xp (n) for 0 ≤ n ≤ N − 1
x (n) =
0 otherwise
0
x (n) = x(n − k − lN)
= x(n − k, modulo N)
= x((n − k))N
x ( n)
0≤n≤3
5
4 The sequence
x(n)
Amplitude
2
0 1 2 3 n
Amplitude
xp (n)
The sequence
x(n)
5 5 5
4 4 4
3 3 3
2 2 2
-4 -3 -2 -1 0 1 2 3 4 5 6 7 n
Amplitude
x 'p (n) = x p (n − 2)
The sequence
x(n)
5 5 5
4 4 4
3 3
2 2
-2 -1 0 1 2 3 4 5 6 7
The sequence
x(n) circularly
shifted by two
samples
5 4
3
Amplitude
0 1 2 3 4 n
0
x (n) = x((n − k))N
0
Consider x (n) with k=2 and N=4 then
0
x (n) = x((n − 2))4
0 0
x (0) = x(−2)4 = x(2) x (1) = x(−1)4 = x(3)
0 0
x (2) = x(0)4 = x(0) x (3) = x(1)4 = x(1)
These shifting operations are as shown in Figures
x(1)=4 x(1)=5
x(1)=2 x(1)=3
The circularly shifting in clockwise is represented by x((n + 1))4 and is as shown in Figure
x(2)=3
x(3)=2
x(1)=4
x(0)=5 X((n+1))4
Symmetry Property
Let the sequence x(n) be of complex valued and is expressed as
x(n) = xR (n) + jxI (n)
Its DFT is
X (k) = XR (k) + jXI (k)
N−1
X 2π kn
X (k) = x(n)e −j N
n=0
N−1
X 2π kn
= [xR (n) + jxI (n)]e −j N
n=0
N−1
X 2π 2π
= [xR (n) + jxI (n)] cos kn − jsin kn
n=0
N N
N−1
X
2π 2π
= xR (n)cos kn + jxI (n)sin kn
n=0
N N
N−1
X
2π 2π
−j xR (n)sin kn − xI (n)cos kn
n=0
N N
N−1
X
2π 2π
XR (k) = xR (n)cos kn + xI (n)sin kn
n=0
N N
N−1
X
2π 2π
XI (k) = − xR (n)sin kn − xI (n)cos kn
n=0
N N
x(n) = xR (n) + jxI (n) real and imaginary parts of sequence x(n) is
N−1
1 X 2π 2π
xR (n) = XR (k)cos kn − XI (k)sin kn
N k=0 N N
N−1
1 X 2π 2π
xI (n) = XR (k)sin kn + XI (k)cos kn
N k=0 N N
N−1
X 2π
X (k) = x(n)cos kn
n=0
N
N−1
X 2π
X (k) = −j x(n)sin kn
n=0
N
Let k = N − k :
N−1
X N−1
X
X (N − k) = x(n)e −j2π(N−k)n/N = x(n)e j2πkn/N e −j2πn
n=0 n=0
N−1
X
X (N − k) = x(n)e j2πkn/N = X ∗ (k) complex conjugate of X (k)
n=0
X (N − k) = X ∗ (k)
The first five points of the eight point DFT of a real valued sequence are {0.25, 0.125 - j0.3018,
0, 0.125 - j0.0518, 0} Determine the remaining three points
X(0)=0.25 X(1)=0.125 - j0.3018, X(2)=0, X(3)=0.125 - j0.0518, X(4)=0}
The remaining three points X(5), X(6) and X(7) are determined using symmetry property
X (N − k) = X ∗ (k)
X (8 − k) = X ∗ (k)
By taking complex conjugate on both sides
X ∗ (8 − k) = X (k)
X (k) = X ∗ (8 − k)
For k=5
X (5) = X ∗ (8 − 5) = X ∗ (3)
But X (3) = 0.125 − j0.0518 and X ∗ (3) = 0.125 + j0.0518 = X (5)
For k=6
X (6) = X ∗ (8 − 6) = X ∗ (2)
But X (2) = 0 and X ∗ (2) = 0 = X (6)
For k=7
X (7) = X ∗ (8 − 7) = X ∗ (1)
But X (1) = 0.125 − j0.3018 and X ∗ (1) = 0.125 + j0.3018 = X (7)
Hence The remaining the DFTs are {0.125 + j0.0518, 0, 0.125 + j0.3018}
The first five points of the eight point DFT of a real valued sequence are {0.25, -j0.3018, 0, 0,
0.125-j0.0518} Determine the remaining three points
X(0)=0.25 X(1)=-j0.3018, X(2)=0, X(3)=0, X(4)=0.125-j0.0518}
The remaining three points X(5), X(6) and X(7) are determined using symmetry property
X (N − k) = X ∗ (k)
X (8 − k) = X ∗ (k)
By taking complex conjugate on both sides
X ∗ (8 − k) = X (k)
X (k) = X ∗ (8 − k)
For k=5
X (5) = X ∗ (8 − 5) = X ∗ (3)
X (3) = 0 X ∗ (3) = 0
For k=6
X (6) = X ∗ (8 − 6) = X ∗ (2)
X (2) = 0 X ∗ (2) = 0
For k=7
X (7) = X ∗ (8 − 7) = X ∗ (1)
X (1) = −j0.3018 X ∗ (1) = +j0.3018
Hence the remaining the DFTs are {0.25, −j0.3018, 0, 0.125 − j0.0518, 0, 0, j0.3018}
Circular Shift
Circular shift of x(n) can be defined:
Xm (k) = DFT [xm (n)] = DFT [x((n + m))N RN (n)] = WN−mk X (k)
= WN−mk X (k)
Shift of a sequence
DFS
x̃ [n] ↔ X̃ [k]
DFS
x̃ [n − m] ↔ WNkm X̃ [k]
WN = e −j(2π/N)
DFS
WN−nl x̃ [n] ↔ X̃ [k − l]
then
DFT
x(n)e j2πn/N ↔ X ((k − l))N
Shifting the frequency components of DFT circularly is equivalent to multiplying the time
domain sequence by e j2πn/N
Circular Correlation
DFT
x(n) ←−
−→ X (k)
N
DFT
y (n) ←−
−→ Y (k)
N
DFT
−→= R̃xy (k) = X (k)Y ∗ (k)
r̃xy (l) ←−
N
Multiplication of DFT one sequence and conjugate DFT of another sequence is equivalent
to circular cross correlation of these two sequences in time domain
Proof:
N−1
X
r̃xy (l) = x(n)y ∗ ((n − l))N
n=0
N−1
X 2π kl
DFT {y ∗ (−l)} = y ∗ (−l)e −j N
l=0
let n = −l
when l = 0 n = 0 and
when l = N − 1 n = −(N − 1)
−(N−1)
X 2π kN
DFT {y ∗ (−l)} = y ∗ (n)e j N
n=0
N−1
X 2π kN
DFT {y ∗ (−l)} = y ∗ (n)e j N
l=0
"N−1 #∗
X 2π nk
= y (n)e −j N
n=0
= [Y (k)]∗ = [Y ∗ (k)]
N−1
X 2π kn
DFT {x ∗ (n)} = x ∗ (n)e −j N
n=0
2πnN
ej N =1
N−1
X 2π kn 2πnN
DFT {x ∗ (n)} = x ∗ (n)e −j N ej N
n=0
N−1
X 2π kn 2πnN
DFT {x ∗ (n)} = x ∗ (n)e −j N ej N
n=0
N−1
X 2πn (N−k)
= x ∗ (n)e j N
n=0
"N−1 #∗
X 2πn (N−k)
= x(n)e −j N
n=0
= [X (N − k)]∗ = [X ∗ (N − k)]
DFT
x((−n))N = x(N − n) = ↔ X ((−k))N = X (N − k)
Proof
If the sequence is circularly folded its DFT is also circularly folded.
x((−n))N = x(N − n)
N−1
X 2π kn
DFT {x(N − n)} = x(N − n)e −j N
n=0
m=N
x(N − n) is circular and DFT is periodic. The summation is performed from 0 to N-1 i.e
for N samples. If the index is changed from (0+N) to (N-1+N). The limits are same
N−1 N−1
X 2π k(N−m) X
DFT {x(N − n)} = x(m)e −j N = x(m)e −j2πk e −j2πkm/N
m=0 m=0
N−1
X
= x(m)e j2πkm/N
m=0
N−1
X
DFT {x(N − n)} = x(m)e −j2πkm/N e −j2πm
m=0
N−1
X
= x(m)e −j2πm(N−k)/N
m=0
DFT
y (n) ←−
−→ Y (k)
N
Then
DFT 1
y (n)y (n) ←−
−→ X (k) N Y (k)
N N
Multiplication of two sequences in time domain is equivalent to circular convolution of their
DFTs in frequency domain
Circular Convolution
For two finite-duration sequences x1 (n) and (x2 (n) both of length N, with DFTs X1 (k)
and X2 (k)
DFT DFT
x1 (n) ↔ X1 (k) and x2 (n) ↔ X2 (k)
Then
X1 (k)X2 (k) = x1 (n) N x2 (n)
Consider X3 (k)
X3 (k) = X1 (k)X2 (k)
Now consider x3 (m) is an IDFT of X3 (k) and is represented as
N−1
1 X 2π
x3 (m) = X3 (k)e j N km
N k=0
N−1
1 X 2π
x3 (m) = X1 (k)X2 (k)e j N km
N k=0
N−1 N−1
"N−1 #
j 2π
X X X
k(m−n−l)
x3 (m) = x1 (n) x2 (l) e N
N−1 N−1
"N−1 #
X X X 2π k(m−n−l)
x3 (m) = x1 (n) x2 (l) ej N
N−1
X 2π k(m−n−l)
ej N =N when (m − n − l) is multiple ofN
K =0
N−1
X 2π k(m−n−l) 1 − e j2πk(m−n−l)
ej N = 2π k(m−n−l)
when (m − n − l) is not multiple of N
K =0 1 − ej N
e j2πk(m−n−l) = 1
N−1
X 2π k(m−n−l) 1−1
ej N = =0 when (m − n − l) is not multiple of N
j 2π k(m−n−l)
K =0 1−e N
N−1
X 2π k(m−n−l) N when (m − n − l) is not multiple of N
ej N =
0 otherwise
k=0
Dr. Manjunatha. P (JNNCE) UNIT - 2: Properties of Discrete Fourier Transforms (DFT)[?,
September
?, ?,14,
?] 2014 30 / 49
Circular Convolution Circular Convolution
N−1 N−1
1 X X
x3 (m) = x1 (n) x2 (l)N when (m − n − l) is not multiple of N
N n=0 l=0
N−1
X N−1
X
= x1 (n) x2 (l)
n=0 l=0
m − n − l = −pN Then l = m − n + pN
N−1
X
x3 (m) = x1 (n)x2 (m − n + pN)
n=0
x2 (m − n + pN) represents x2 shifted circularly by n samples
x2 (m − n + pN) = x2 (m − n, mpdulo N)
x2 (m − n + pN) = x2 ((m − n))N
N−1
X
x3 (m) = x1 (n)x2 ((m − n))N m = 0, 1, . . . N − 1
n=0
N−1
X
x3 (m) = x1 (n) N x2 (n) = x1 (n)x2 ((m − n))N m = 0, 1, . . . N − 1
n=0
x1 (n) = 4 3 5 2
x2 (1 − n) = 4 3 2 1
P3
x3 (1) = x1 (n)x2 (1 − n)4 = 16 +9 +10 +2 =37
x=0
x1 (n) = 4 3 5 2
x2 (2 − n) = 1 4 3 2
P3
x3 (2) = x1 (n)x2 (2 − n)4 = 4 +12 +15 +4 =35
x=0
x1 (n) = 4 3 5 2
x2 (−n) = 2 1 4 3
3
P
x3 (3) = x1 (n)x2 (3 − n)4 = 8 +3 +20 +6 =37
x=0
3x2=6 3x3=9
x1(1)=3 x1(1)=3
x1(3)=2 x1(3)=2
2x4=8 2x1=2
x2(1)=4 x2(2)=1
x2(2)=1
x2(1)=4
3x1=3
3x4=12 x1(1)=3
x1(1)=3
x2(1)=4 x2(3)=2
x1(2)=5 x1(0)=4
x2(0)=3 x1(2)=5 x1(0)=4 x2(2)=1 4x2=8
5x4=20
5x3=15 4x1=4 x1(n) x2((3-n))4
x1(n) x2((2-n))4
x1(3)=2
x1(3)=2 2x3=6
2x2=4
x2(0)=3
x2(3)=2
N−1
X
x3 (m) = x1 (m)x2 (m − n), 0≤m ≤N−1
n=0
N−1
X
y (m) = x(n)h(m − n), 0≤m ≤N−1
n=0
y (0) = x(0)h(0) + x(1)h(−1) + x(2)h(−2) + . . . + x(N − 2)h(−(N − 2)) + x(N − 1)h(−(N − 1))
= x(0)h(0) + x(1)h(N − 1) + x(2)h(N − 2) + . . . x(N − 2)h(2) + x(N − 1)h(1)
y (0) x(0)
h(0) h(N − 1) h(N − 2) ··· h(2) h(1)
y (0) x(1)
h(1) h(0) h(N − 1) h(3) h(2)
y (0) x(2)
h(2) h(1) h(0) h(4) h(3)
. = = .
. .
. h(N − 2) h(N − 3) h(N − 4) h(0) h(N − 1) .
y (N − 2) x(N − 2)
h(N − 1) h(N − 2) h(N − 3) h(1) h(0)
y (N − 2) x(N − 1)
First determine the DFT of the given sequences and multiply both the DFTs i,e.,
Y (k) = X (k).H(k)
X (0) 1 1 1 1 4 14
X (1) 1 −j −1 j
3
= −1 − 1j
X (2) = 1
−1 1 −1 5 4
X (3) 1 j −1 −j 2 −1 + 1j
X (0) 1 1 1 1 3 10
X (1) 1 −j −1 j
4
= 2 − 2j
X (2) = 1
−1 1 −1 1 −2
X (3) 1 j −1 −j 2 (2 + 2j)
Y (k) = X (k).H(k)
Y (0) 14 × 10 140 140
= (−1 − 1j) × (2 − 2j) = (−1 − 1j) × (2 − 2j) = −4
Y (1)
Y (2) 4 × (−2) −8 −8
Y (3) (−1 + 1j)(2 + 2j) (−1 + 1j)(2 + 2j) −4
%--------------------------------------------------------------------------
% GENERALAZED CIRCULAR CONVOLUTION COMPUTING CODE IN MATLAB WITHOUT
% USING MATLAB BUILTIN FUNCTION [cconv(a,b,n)]
%--------------------------------------------------------------------------
clc; clear all; close all;
x=[4 3 5 2]
h=[3 4 1 2]
for i=1:N
y(i)=0;
for j=1:N
k=i-j+1;
if(k<=0)
k=k+N;
end
y(i)=y(i)+a(j)*b(k);
end
end
y
y1=cconv(x,h, N)% This is to verify the result
subplot(3,1,1); stem(x);
xlabel(’------------->n’);ylabel(’Sequence x[n]’);
subplot(3,1,2);stem(h);
xlabel(’------------->n’);ylabel(’Sequence h[n]’);
subplot(3,1,3); stem(y);
xlabel(’------------->n’);ylabel(’Y[n]’);title(’Convolution without using "conv" function’);
% -----------------------------------------------------------------
% Program for Circular Convolution using DFT & IDFT of equal length
%------------------------------------------------------------------
% 1. Define the sequence x1 and x2
% 2. Take DFT of x1 and x2 i.e., X1=DFT(x1) & X2=DFT(x2)
% 3. Multiply X1 & X2
% 4. Take IDFT for the resultant.
%------------------------------------------------------------------
clc; clear all; close all;
% Let us define the input sequence x1 & x2
x1 = input(’Enter the first sequence:’);
x2 = input(’Enter the second sequence:’);
%Now let us take DFT of x1 and x2 i.e., X1=DFT(x1) & X2=DFT(x2)
X1 = fft(x1)
X2 = fft(x2)
% Now let us multiply X1 & X2
Y = X1.*X2
% Now let us take IDFT for the resultant
y = ifft(Y)
% Now let us plot this result
subplot(5,2,1); stem(x1); title(’First Sequence’);
subplot(5,2,2); stem(x2); title(’Second Sequence’);
subplot(5,2,3); stem(abs(X1)); title(’Magnitude of DFT of Sequence x1’);
subplot(5,2,4); stem(abs(X2)); title(’Magnitude of DFT of Sequence x2’);
subplot(5,2,5); stem(angle(X1)); title(’Angle of DFT of Sequence x2’);
subplot(5,2,6); stem(angle(X2)*pi/180); title(’Angle of DFT of Sequence x2’);
subplot(5,2,7); stem(abs(Y)); title(’Magnitude of multiplied o/p of X1 & X2 = Y’);
subplot(5,2,8); stem(angle(Y)); title(’Angle of multiplied o/p of X1 & X2 = Y’);
subplot(5,2,9); stem(abs(y)); title(’Magnitude of IDFT of Sequence Y’);
subplot(5,2,10); stem(angle(y)); title(’Angle of IDFT of Sequence Y’);
X (0) 1 1 1 1 1 4
X (1) 1 −j −1 j
0
−1 + j
X (2) =
=
1 −1 1 −1 2 2
X (3) 1 j −1 −j 1 −1 − j
4 4 16
−1 + j −1 + j −j2
. =
2 2 4
−1 − j −1 − j j2
Let x(n) be the sequence x(n) = 2δ(n) + δ(n − 1) + δ(n − 3) Find the sequence
y (n) = x(n) 5 x(n) i.e. 5 point circular convolution of x(n) with itself
Solution:
x(n) = 2δ(n) + δ(n − 1) + δ(n − 3)
x(0) = 2δ(0) + δ(0 − 1) + δ(0 − 3) = 2 + 0 + 0 = 2
x(1) = 2δ(1) + δ(1 − 1) + δ(1 − 3) = 0 + 1 + 0 = 1
x(2) = 2δ(2) + δ(2 − 1) + δ(2 − 3) = 0 + 0 + 0 = 0
x(3) = 2δ(3) + δ(3 − 1) + δ(3 − 3) = 0 + 0 + 1 = 1
x(n) = [2, 1, 0, 1]
The 5 point circular convolution is achieved by appending zero at the end of the sequence
x(n) i.e., x(n) = [2 1 0 1 0]
Using Matrix approach
x=[2 1 0 1 0] folded sequence is =[0 1 0 1 2]
Then shift circularly right once it becomes [2 0 1 0 1]
y (0) 2 0 1 0 1 2 4+0+0+0+0=4
y (1) 1 2 0 1 0 1 2 + 2 + 0 + 1 + 0 = 5
y (2) = 0 1 2 0 1 0 = 0 + 1 + 0 + 0 + 0 = 1
y (3) 1 0 1 2 0 1 2 + 0 + 0 + 2 + 0 = 4
y (4) 0 1 0 1 2 0 0+1+0+1+0=2
Compute the circular convolution between the following sequences using DFT and IDFT method
x(n) = {1, 2, 3, 4} y (n) = {−1, −2, −3, −4} x(n) and y (n) are periodic sequences with period
↑ ↑
N=4.
The 4 point DFT x(n) can be obtained by matrix method
X (0) 1 1 1 1 1 10
X (1) 1
= −j −1 j
2
−2 + j2
=
X (2) 1 −1 1 −1 3 −2
X (3) 1 j −1 −j 4 −2 − j2
10 10 −100
−2 + j2 2 − j2 j8
. =
−2 2 −4
−2 − j2 2 + j2 −j8
Evaluate circular convolution y (n) = x(n) N x(n) where x(n) = u(n) − u(n − 4) and
h(n) = u(n) − u(n − 3) assuming N=8 show your calculations by int0 approximate usage of
equations and relevant sketches. Plot y(n). (ii) Verify the result using DFT and IDFT method
u(n)
u(n)
Unit step sequence u(n)
Unit step sequence u(n)
0 1 2 3 4 5 6 7 8 9 10 11 n
0 1 2 3 4 5 6 7 8 9 10 11 n
u(n-4)
u(n-3)
Unit step sequence u(n) delayed by 4 samples Unit step sequence u(n) delayed by 3 samples
0 1 2 3 4 5 6 7 8 9 10 11 n
0 1 2 3 4 5 6 7 8 9 10 11 n
x(n)=u(n-u(n-4)
h(n)=u(n-u(n-3)
x(n) is generated by subtracting u(n) by u(n-4)
h(n) is generated by subtracting u(n) by u(n-3)
0 1 2 3 4 5 6 7 8 9 10 11 n
0 1 2 3 4 5 6 7 8 9 10 11 n
y(n)
4
0 1 2 3 4 5 6 n
y (0) 1 0 0 0 0 0 1 1 1 1
y (1) 1 1 0 0 0 0 0 1 1 2
y (2) 1 1 1 0 0 0 0 0 1 3
y (3) 0 1 1 1 0 0 0 0 1 3
= =
y (4) 0 0 1 1 1 0 0 0 0 2
y (5) 0 0 0 1 1 1 0 0 0 1
y (6) 0 0 0 0 1 1 1 0 0 0
y (7) 0 0 0 0 0 1 1 1 0 0
N−1
X j2πkn
Xc (k) = xc (n)e − N
n=0
N−1
1 X j2πln j2πln j2πkn
Xc (k) = x(n) e N + e − N e− N
2 n=0
N−1 N−1
1 X j2πln j2πkn 1 X j2πln j2πkn
= x(n)e N e − N + x(n)e − N e − N
2 n=0 2 n=0
DFT DFT
x(n)e j2πn/N ↔ X ((k − l))N = x(n)e −j2πn/N ↔ X ((k + l))N
1 1
Xc (k) = X ((k − l))N + X ((k + l))N
2 2
2πln 1 j2πln j2πln
xs (n) = x(n)sin = x(n) e N − e− N
N 2j
N−1
X j2πkn
Xs (k) = xs (n)e − N
n=0
N−1
1 X j2πln j2πln j2πkn
Xs (k) = x(n) e N − e − N e− N
2j n=0
N−1 N−1
1 X j2πln j2πkn 1 X j2πln j2πkn
= x(n)e N e − N − x(n)e − N e − N
2j n=0 2j n=0
DFT DFT
x(n)e j2πn/N ↔ X ((k − l))N = x(n)e −j2πn/N ↔ X ((k + l))N
1 1
Xc (k) = X ((k − l))N − X ((k + l))N
2j 2j
Dr. Manjunatha. P
[email protected]
Professor
Dept. of ECE
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 2 / 69
Unit 5 Syllabus
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 3 / 69
IIR Filter Design Introduction
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 4 / 69
IIR Filter Design Introduction
H(Ω) cannot have an infinitely sharp cutoff from passband to stopband, that is H(Ω)
cannot drop from unity to zero abruptly.
It is not necessary to insist that the magnitude be constant in the entire passband of the
filter. A small amount of ripple in the passband is usually tolerable.
The filter response may not be zero in the stopband, it may have small nonzero value or
ripple.
The transition of the frequency response from passband to stopband defines transition
band.
The passband is usually called bandwidth of the filter.
The width of transition band is Ωs − Ωp where Ωp defines passband edge frequency and
Ωs defines stopband edge frequency.
The magnitude of passband ripple is varies between the limits 1 ± δp where δp is the ripple
in the passband
The ripple in the stopand of the filter is denoted as δp
Ωp = Passband edge frequency in rad/second Ωs = Stopband edge frequency in rad/second
ωp = Passband edge frequency in rad/sample ωs = Stopband edge frequency in rad/sample
Ap = Gain at passband edge frequency As = Gain at stopband edge frequency
ωp ωs
Ωp = and Ωs =
T T
1
where T = fs
= Sampling frequency
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 6 / 69
Butterworth Filter Design
1 Properties of
|H(jΩ)|2 = 2N
1 + ΩΩ
c
butterworth filter
|HN (jΩ)|2 |Ω=0 = 1 for all N
|HN (jΩ)|2 |Ω=Ωc = 0.5 for all finite N
|HN (jΩ)||Ω=Ωc = √1 = 0.707 20log |H(jΩ)||Ω = Ωc = −3.01 dB
2
|HN (jΩ)|2 is a monotonically decreasing function of for Ω
|HN (jΩ)|2 approaches to ideal response as the value of N increases
The filter is said to be normalized when cut-off frequency Ωc = 1 rad/sec.
From normalized transfer function LPF, HPF, BPF BSF can be obtained by suitable
transformation to the normalized LPF specification.
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 7 / 69
Butterworth Filter Design
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 8 / 69
Butterworth Filter Design
N=1 ∴ k=0,1 j
S-plane
kπ Unit circle
Sk = 1
s1
N
s0
S0 = 1 0, S1 = 1 π
π kπ
Sk = 1 2N
+ N jΩ
S-plane
s1
π 3π Unit circle s0
S0 = 1 4, S1 = 1 4
5π 7π
S2 = 1 σ
4 , S3 = 1 4
1
H2 (s) =
[s + 0.707 − j0.707][s + 0.707 + j0.707]
1
=
[s + 0.707]2 − [j0.707]2
1
=
s 2 + 20.707s + (0.707)2 + (0.707)2
1
=
s 2 + 1.414s + 1
———————————————————————————————————–
Determine the poles of lowpass Butterworth filter for N=3. Sketch the location of poles on s
plane and hence determine the normalized transfer function of lowpass filter.
Solution:
jΩ
s2 S-plane
Unit circle s1
N=3 ∴ k=0,1,2,3,4,5
N is Odd s3 s0
Sk = 1 kπ σ
N
π 2π
S0 = 1 0, S1 = 1 3, S2 = 1 3
s5
s4
4π 5π
S3 = 1 π, S4 = 1 3 , S5 = 1 3
Left half poles of H3(s) Right half poles of H3(-s)
1 1
HN (s) = Q =
[s − sk ] [s − (s2 )][s − (s3 )][s − (s4 )]
LHP
1
H3 (s) =
[s − (−0.5 + j0.866)][s − (−1)][s − (−0.5 − j0.866)]
1
=
[s + 1][s + 0.5 − j0.866][s + 0.5 + j0.866)]
1 1
= =
[s + 1][(s + 0.5)2 − (j0.866)2 ]] (s + 1)(s 2 + s + 1)
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 11 / 69
Butterworth Filter Design
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 12 / 69
Butterworth Filter Design
20 log H a ( jω )
0
KP
Ks
Ω
ΩP ΩS
1
|H(jΩ)| =
2N 12
Ω
1+ Ωc 2N
ΩP −Kp
= 10 10 −1 (1)
Ωc
Taking 20 log on both sides
Ω = Ωs and K = Ks
1 " 2N #
20 log |H(jΩ)| = 20 log
ΩS
2N 12 KS = −10 log 1 +
Ωc
1 + ΩΩ
c
" 2N # 12
ΩS
2N
−KS
Ω = 10 10 −1 (2)
= −20 log 1 +
Ωc Ωc
" 2N #
Ω Dividing Equation 1 by Equation
= −10 log 1 +
Ωc 2
2N −Kp
Ω = Ωp and K = Kp Ωp 10 10 −1
= −KS
" # ΩS 10 10 −1
2N
ΩP
Kp = −10 log 1 +
Ωc
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 14 / 69
Butterworth Filter Design
−Kp
Ωp 10 10 − 1
2N log = log
−KS
ΩS 10 10 − 1
" −K #
p
10 10 −1
log −KS
10 10 −1
N= h
Ωp
i
2log ΩS
OR
ΩS
ΩC = 1
−KS 2N
10 10 − 1
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 15 / 69
Butterworth Filter Design
−Kp
" #
10 10 −1
log −KS
10 10 −1
N= h i
Ω
2log Ωp
S
4 From analog lowpass to lowpass frequency transformation, find the desired transfer
function by substituting the following
Ha (s) = HN (s)|s→ s
ΩC
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 16 / 69
Butterworth Filter Design
Design an analog Butterworth low pass filter to meet the following specifications T=1 second
Solution:
Passband edge frequency ωp = 0.3π rad/sample
Stopband edge frequency ωs = 0.75π rad/sample
ω
Passband edge analog frequency Ωp = 1p = 0.3π
1
= 0.3π rad/second
Stopband edge analog frequency Ωs = ω1s = 0.75π
1
= 0.75π rad/second
Kp =20log(0.707)=-3.01 dB, Ks =20log(0.2)=-13.97 dB,
The order of the filter is
Gain in dB
20 log H a ( jω )
−Kp
" #
10 10 −1
log −KS
10 10 −1 0
N = h i
Ω K P = −3.01dB
2log Ωp
S
3.01
10 10 −1 K s = −13.97dB
log 13.97
1
10 10 −1 log 24 Ω
= 0.3π = ΩP = 0.9425 rad/sec ΩS = 2.356 rad/sec
2log 0.75π
2 × (−0.398)
−1.38 Figure 8: LPF specifications
= = 1.7336 ' 2
−0.796
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 17 / 69
Butterworth Filter Design
OR
N=2 ∴ k=0,1,2,3 N is Even
For even N
π + kπ
Sk = 1 2N N
N
2
Y 1
H(sn ) = S0 = 1 π
4 , S1 = 1 3π
4
k=1
s 2 + bk s + 1
5π
S2 = 1 4 , S3 = 1 7π
4
Ωs jΩ
Ωc = −ks 1 S-plane
(10 10 − 1) 2N Unit circle s1
s0
2.3562
= 13.97 1 σ
(10 10 − 1) 4
= 1.0664 rad/sec s2 s3
LHP of H2(s) RHP of H2(-s)
Ha (s) = H2 (s)|s→ s
Ωc
= H2 (s)|s→ s
1.0644
1
=
s2
Ωc 2
+ 1.4142 Ωs + 1
c
1
=
s 2 +1.4142Ωc s+Ωc 2
Ω2c
Ω2c
=
s2 + 1.4142Ωc s + Ωc 2
1.06442
=
s 2 + 1.4142 × 1.0644s + 1.06442
1.133
=
s 2 + 1.5047s + 1.133
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 19 / 69
Butterworth Filter Design
Design an analog Butterworth low pass filter to meet the following specifications T=1 second
Solution:
Passband edge frequency ωp = 0.35π rad/sample
Stopband edge frequency ωs = 0.7π rad/sample
ω
Passband edge analog frequency Ωp = 1p = 0.35π
1
= 0.35π rad/second
Stopband edge analog frequency Ωs = ω1s = 0.7π
1
= 0.7π rad/second
Kp =20log(0.9)=-0.9151 dB, Ks =20log(0.2)=-11.2133 dB,
The order of the filter is
Gain in dB
" −Kp
# 20 log H a ( jω )
10 10 −1
log −KS
10 10 −1 0
N = h i
Ω K P = −0.915dB
2log Ωp
S
0.9151
10 10 −1 K s = −11.213dB
log 11.213
0.234
10 10 −1 log 12.21 Ω
= 0.35π = ΩP = 1.0996 rad/sec ΩS = 2.1991 rad/sec
2log 0.7π
2 × (−0.301)
−1.717 Figure 10: LPF specifications
= = 2.852 ' 3
−0.602
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 20 / 69
Butterworth Filter Design
For odd N=3
N−1 OR
2 N=3 ∴ k=0,1,2,3,4,5 N is Even
1 Y 1
H(sn ) =
(s + 1) k=1 s 2 + bk s + 1 π + kπ
Sk = 1 2N N
S0 = 1 π S1 = 1 3π
h i
(2k−1)π 4 ,
where bk = 2sin 2N
4
N=3 S2 = 1 5π
4 , S3 = 1 7π
4
k = N−1
2
= 3−1
2
=1 The poles lying on left half of s plane
k=1 h i
(2−1)π
bk = b1 = 2sin 2×3 =1 1 1
HN (s) = Q =
[s − sk ] [s − (s1 )][s − (s2 )]
LHP
1 1
H(sn ) = =
[s − (−0.707 + j0.707)][s − (−0.707 − j0.707)]
(s + 1)(s 2
+ s + 1)
1
=
s 3 + 2s 2 + 2s + 1
jΩ
S-plane
Unit circle s1
s0
Ωs σ
Ωc = −ks 1
(10 10 − 1) 2N
s2 s3
2.2 2.2 LHP of H2(s)
= 11.21 1
= RHP of H2(-s)
(10 − 1)
10 6 1.515
= 1.45 rad/sec
Figure 11: Poles of H2 (s)H2 (−s)
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 21 / 69
Butterworth Filter Design
1
Ha (s) = H3 (s)|s→ s = |s→ s
Ωc s 3 + 2s 2 + 2s + 1 Ωc
= H3 (s)|s→ s
Ωc
1
=
s3 2
Ωc 3
+ 2 Ωs 2 + 2 Ωs + 1
c c
1
=
s 3 +2Ωc s 2 +2Ω2c s+Ω3c
Ω3c
Ω3c
=
s 3 + 2Ωc s 2 + 2Ω2c s + Ω3c
1.453
=
s 3 + 2 × 1.45s 2 + 2 × 1.452 s + 1.453
3.048
=
s 3 + 2.9s 2 + 4.205s + 3.048
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 22 / 69
Butterworth Filter Design
Design an analog Butterworth low pass filter to meet the following specifications T=1 second
Solution:
Passband edge frequency ωp = 0.2π rad/sample
Stopband edge frequency ωs = 0.32π rad/sample
ω
Passband edge analog frequency Ωp = 1p = 0.35π
1
= 0.6283 rad/second
Stopband edge analog frequency Ωs = ω1s = 0.7π
1
= 1.0053 rad/second
Kp =20log(0.8)=-1.9 dB, Ks =20log(0.2)=-13.97 dB,
The order of the filter is
Gain in dB
20 log H a ( jω )
−Kp
" #
10 10 −1
log −KS
10 10 −1 0
N = h i
Ω K P = −1.9dB
2log Ωp
S
1.9
10 10 −1 K s = −13.97dB
log 13.97
0.548
10 10 −1 log 24 Ω
= 0.6283 = ΩP = 0.6283 rad/sec ΩS = 1.0053 rad/sec
2log 1.0053
2 × (−0.204)
−1.641 Figure 12: LPF specifications
= = 4.023 ' 4
−0.408
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 23 / 69
Butterworth Filter Design
1
H(sn ) =
(s 2 + 0.764s + 1)(s 2 + 1.8478s + 1)
1
=
s 4 + 2.6118s 3 + 3.4117s 2 + 2.6118s + 1
Ωs
Ωc = −ks 1
(10 10 − 1) 2N
1.0053 1.0053
= 13.97 1
=
(10 10 − 1) 8 1.4873
= 0.676 rad/sec
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 24 / 69
Butterworth Filter Design
1
Ha (s) = H4 (s)|s→ s = |s→ s
Ωc s 4 + 2.6118s 3 + 3.4117s 2 + 2.6118s + 1 Ωc
= H4 (s)|s→ s
Ωc
1
=
s4 3 2
Ωc 4
+ 2.6118 Ωs 3 + 3.4117 Ωs 2 + 2.6118 Ωs + 1
c c c
1
=
s 4 +2.6118Ωc s 3 +3.4117Ω2c s 2 +2.6118Ω3c s+Ω4c
Ω4c
Ω4c
=
s 4 + 2.6118Ωc s 3 + 3.4117Ω2c s 2 + 2.6118Ω3c s + Ω4c
0.6764
=
s 4 + 1.7655s 3 + 1.559s 2 + 0.8068s + 0.2088
0.2088
=
s 4 + 1.7655s 3 + 1.559s 2 + 0.8068s + 0.2088
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 25 / 69
Butterworth Filter Design
Design an analog Butterworth low pass filter which has -2 dB attenuation at frequency 20
rad/sec and at least -10 dB attenuation at 30 rad/sec.
Solution:
Passband edge analog frequency Ωp = 20 rad/second
Stopband edge analog frequency Ωs = 30 rad/second
Kp =-2 dB, Ks =-10 dB,
The order of the filter is
Gain in dB
20 log H a ( jω )
−Kp
" #
10 10 −1
log −KS
10 10 −1 0
N = h i
Ω K P = −1.9dB
2log Ωp
S
2
10 10 −1 K s = −13.97dB
log 10
0.584
10 10 −1 log 9 Ω
= = ΩP = 0.6283 rad/sec ΩS = 1.0053 rad/sec
2log 20
30
2 × (−0.176)
−1.1878 Figure 13: LPF specifications
= = 3.374 ' 4
−0.352
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 26 / 69
Butterworth Filter Design
1
H(sn ) =
(s 2 + 0.764s + 1)(s 2 + 1.8478s + 1)
1
=
s 4 + 2.6118s 3 + 3.4117s 2 + 2.6118s + 1
Ωs
Ωc = −ks 1
(10 10 − 1) 2N
30 30
= 10 1
=
(10 10 − 1) 8 1.316
= 22.795 rad/sec
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 27 / 69
Butterworth Filter Design
1
Ha (s) = H4 (s)|s→ s = |s→ s
Ωc s 4 + 2.6118s 3 + 3.4117s 2 + 2.6118s + 1 22.795
1
=
s4 3 2
Ωc 4
+ 2.6118 Ωs 3 + 3.4117 Ωs 2 + 2.6118 Ωs + 1
c c c
1
=
s 4 +2.6118Ωc s 3 +3.4117Ω2c s 2 +2.6118Ω3c s+Ω4c
Ω4c
Ω4c
=
s4 + 2.6118Ωc s3 + 3.4117Ω2c s 2 + 2.6118Ω3c s + Ω4c
22.7954
=
s4 + 59.535s 3
+ 1772.76s 2 + 30935.611s + 22.7954
22.7954
=
s + 59.535s + 1772.76s 2 + 30935.611s + 22.7954
4 3
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 28 / 69
Problems Problems
Gain in dB
Kp =-1 dB, Ks =-20 dB, 20 log H a ( jω )
The order of the filter is
0
−Kp
" #
10 10 −1 K P = −1dB
log −KS
10 10 −1
N = h i
Ω
2log Ωp K P = −20dB
S
Ω
1 ΩP = 4 rad/sec ΩS = 8 rad/sec
10 10 −1
log 20
=
10 10
4
−1
= 4.289 ' 5 Figure 14: LPF specifications
2log 8
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 29 / 69
Problems Problems
Sk = 1∠θk k = 0, 1 . . . 2N − 1
For odd N θk is
πk
θk =
N
jΩ
Unit circle S-plane
S0 = 1 0=1 0= s3 s2
S1 = 1 π
36◦ = 0.809 + j0.588 s4
5 =1 s1
2π
S2 = 1 5 =1
72◦ = 0.309 + j0.951 s5 s0
3π σ
S3 = 1 5 =1
108◦ = −0.309 + j0.951 s6
4π s9
S4 = 1 5 =1
144◦ = −0.809 − j0.588
S5 = 1 π =1180◦ = −1 s7 s8
6π Left half poles of H5(s) Right half poles of H5(-s)
S6 = 1 5 = 1 216◦ = −0.809 − j0.588
7π
S7 = 1 5 = 1 252◦ = −0.309 − j0.951
8π
S8 = 1 5 = 1 288◦ = 0.309 − j0.951
9π
S9 = 1 5 = 1 324◦ = −0.809 − j0.588
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 30 / 69
Problems Problems
1
H5 (s) = Q
(s − sk )
LHPonly
1
=
(s − s3 )(s − s4 )(s − s5 )(s − s6 )(s − s7 )
1
=
(s − 0.309 + j0.951)(s + 0.809 + j0.588)(s + 1)
(s + 0.809 − j0.588)(s + 0.309 + j0.951)
1
=
[(s − 0.309)2 + (0.951)2 ][(s + 0.809)2 + (0.588)2 ](s + 1)
1
=
[(s 2 + 0.618s + 1)(s 2 + 1.618s + 1)(s + 1)
1
=
s 5 + 3.236s 4 + 5.236s 3 + 5.236s 2 + 3.236s + 1
Ωp
Ωc = −kp
= 4.5784 rad/sec
1
(10 10 − 1) 2N
Ha (s) = H5 (s)|s→ s
4.5787
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 31 / 69
Problems Problems
Ha (s) = H5 (s)|s→ s
Ωc
= H5 (s)|s→ s
4.5787
1
= s s s
( 4.5787 )5 + 3.236( 4.5787 )4 + 5.236( 4.5787 )3 +
s 2 s
5.236( 4.5787 ) + 3.236( 4.5787 ) + 1
2012.4
=
s 5 + 14.82s 4 + 109.8s 3 + 502.6s 2 + 1422.36s + 2012.4
Verification
2012.4
Ha (jΩ) =
(jΩ)5 + 14.82(jΩ)4 + 109.8(jΩ)3 + 502.6(jΩ)2 + 1422.3(jΩ) + 2012.4
2012.4
=
(14.82Ω4 − 502.6Ω2 + 2012.4) + j(Ω5 − 109.8Ω3 + 1422.3Ω)
2012.4
|Ha (jΩ)| = p
(14.82Ω4 − 502.6Ω2 + 2012.4)2 + j(Ω5 − 109.8Ω3 + 1422.3Ω)2
20 log |Ha (jΩ)|4 = −1 dB
20 log |Ha (jΩ)|8 = −24 dB
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 32 / 69
Analog Filter Design Chebyshev Filter Design
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 33 / 69
Chebyshev Filter Design
H ( jω ) H ( jω )
Gain
Gain
1 1
1 δp 1 δp
1+ ε 2 1+ ε 2
δs δs
Ω Ω
ΩP ΩS ΩP ΩS
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 35 / 69
Chebyshev Filter Design
N N−1
2 2
Y Bk B0 Y Bk
H(sn ) = H(sn ) =
k=1
s 2 + bk s + ck s + c0 k=1 s 2 + bk s + ck
h i h i
(2k−1)π (2k−1)π
where bk = 2yN sin 2N
, ck = yN2 + cos 2 2N
c0 = yN
"
1 # N1 " 1 #− N1
1 1 2 1 1 2 1
yN = +1 + − +1 +
2 2 2
1
where = (1/Kp2 ) − 1 2
H(sn )|s=0 = 1
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 36 / 69
Chebyshev Filter Design
Ha (s) = HN (s)|s→ s
ΩC
where ΩC = ΩP
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 37 / 69
Chebyshev Filter Design
Jan 2013, June 2015: Design a Chebyshev IIR analog low pass filter that has -3.0 dB frequency
100 rad/sec and stopband attenuation 25 dB or grater for all radian frequencies past 250
rad/sec
Solution:
Passband ripple Kp =-3.0 dB or in normal value is Kp = 10Kp /20 = 10−3/20 = 0.707
Stopband ripple Ks =25.0 dB or in normal value is Ks = 10Ks /20 = 10−25/20 = 0.056
Passband edge frequency =100 rad/sec Stopband edge frequency =250 rad/sec
" 1 #
(1/Ks2 )−1 2
cosh−1 (1/Kp2 )−1
H ( jω )
Gain
N1 =
Ωs
cosh−1 Ωp 1
" # 1 δp
i1
(1/0.0562 )−1
h
2
cosh−1 1+ ε 2
(1/0.7072 )−1
= 250
cosh−1 100
1 δs
−1 317
cosh 1
2
cosh−1 [17.8] Ω
= = ΩP ΩS
cosh−1 (2.5) cosh−1 [2.5]
3.57 Figure 16: LPF specifications
= = 2.278 ' 3
1.566
N=3
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 38 / 69
Chebyshev Filter Design
When N is odd
B0 Bk
H(sn ) = × 2
s + c0 s + b1 s + c1
N−1
2
B0 Y Bk
H(sn ) = 1
s + c0 k=1 s 2 + bk s + ck
(1/Kp2 ) − 1 2 =
1
(1/0.7072 ) − 1 2 = 1
=
N=3 k = N−1
2
= 3−1
2
= 1
——————————————————————————————————–
"
1 # N1 " 1 #− N1
1 1 2 1 1 2 1
yN = +1 + − +1 +
2 2 2
"
1 # 13 " 1 #− 31
1 1 2 1 1 2 1
= +1 + − +1 +
2 12 1 12 1
1 h 1
i1 h 1
i− 1
3 3
= (2) 2 + 1 − (2) 2 + 1
2
1h 1 1
i 1
= [1.414 + 1] 3 − [1.414 + 1]− 3 = [1.341 − 0.745] ' 0.298
2 2
h i
(2k−1)π
C0 = yN = 0.298 k=1 bk = 2 × yN sin 2×N
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 39 / 69
Chebyshev Filter Design
k=1 h i
(2−1)π
b1 = 2 × 0.298sin 2×3 = 0.298
k=2
B0 B1
H(sn ) = × 2
s + c0 s + b1 s + c1
h
(2k−1)π
i B0 B1
ck = yN2 + cos 2 2N
H(sn ) = ×
s + 0.298 s 2 + 0.298s + 0.838
k=1
When N is odd the values of parameter Bk
(2 − 1)π
are evaluated using
c1 = 0.2982 + cos 2
2×3 H(sn )|s=0 = 1
2 π
h i
= 0.088 + cos
6
" # B0 B1
1 + cos( 2π
6
) H(sn ) = =1
= 0.088 + 0.298 × 0.838
2
= 0.088 + 0.75 = 0.838 B0 B1 = 0.25
B0 = B1
B02 = 0.25
√
B0 = 0.25 = 0.5
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 40 / 69
Chebyshev Filter Design
B0 B1
H(sn ) = × 2
s + 0.298 s + 0.298s + 0.838
0.25
H(sn ) =
s 3 + 0.596s 2 + 0.926s + 0.25
Unnomalized transfer function, H(s) and Ωp = 100 rad/sec
0.25
Ha (s) = H3 (s)|s→ s = |s→ s
Ωp s 3 + 0.596s 2 + 0.926s + 0.25 Ωp
= H3 (s)|s→ s
Ωp
0.25
=
s3 2
Ωp 3
+ 0.596 Ωs 2 + 0.926 Ωs + 0.25
p p
0.25
=
s 3 +0.596Ωp s 2 +0.926Ω2c s+0.25Ω3p
Ω3p
0.25 × Ω3p
=
s3 + 0.596Ωp s 2 + 0.926Ω2c s + 0.25Ω3p
0.25 × 1003
=
s3 + 0.596 × 100s 2
+ 0.926 × 1002 s + 0.25 × 1003
0.25 × 1003
=
s + 59.6s + 926s + 0.25 × 1003
3 2
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 41 / 69
Chebyshev Filter Design
Design a Chebyshev IIR low pass filter that has to meet the following specifications
i) passband ripple ≤0.9151 dB and passband edge frequency 0.25π rad/sec
ii) Stopband attenuation ≥12.395 dB and Stopband edge frequency 0.5π rad/sec
Solution:
Passband ripple Kp =0.9151 dB
or in normal value is Kp = 10Kp /20 = 10−9151/20 = 0.9
Stopband ripple Ks =12.395 dB
or in normal value is Ks = 10Ks /20 = 10−12.395/20 = 0.24
Passband edge frequency 0.25π=0.7854 rad/sec
Stopband edge frequency 0.5π =1.5708rad/sec
" 1 #
(1/Ks2 )−1 2
cosh−1 (1/Kp2 )−1
N1 =
Ωs
cosh−1 Ωp
" #
i1
(1/0.242 )−1
h
2
cosh−1 (1/0.92 )−1
=
cosh−1 1.5708
0.7854
−1 16.3611
1
cosh 0.2346
2
cosh−1 [8.35] 2.8118
= 1.5708
= = = 2.135 ' 3
cosh−1 [2]
cosh−1 0.7854
1.3169
N=3
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 42 / 69
Chebyshev Filter Design
When N is odd
B0 Bk
H(sn ) = × 2
s + c0 s + bk s + ck
N−1
2
B0 Y Bk
H(sn ) =
s + c0 k=1 s 2 + bk s + ck
1
(1/Kp2 ) − 1 2
=
N=3 k = N−1
2
= 3−1
2
=1 =
1
(1/0.92 ) − 1 2 = 0.4843
——————————————————————————————————–
"
1 # N1 " 1 #− N1
1 1 2 1 1 2 1
yN = +1 + − +1 +
2 2 2
"
1 # 13 " 1 #− 13
1 1 2 1 1 2 1
= +1 + − +1 +
2 0.48432 0.4843 0.48432 0.4843
1 h 1
i1 h 1
i− 1
3 3
= (5.2635) 2 + 2.064 − (5.2635) 2 + 2.064
2
1h 1 1
i 1
= [2.294 + 2.064] 3 − [2.294 + 2.064]− 3 = [1.6334 − 0.6122] ' 0.5107
2 2
h i
(2−1)π
C0 = yN = 0.5107 k=1 bk = 2 × 0.5107sin 2×3
= 0.5107
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 43 / 69
Chebyshev Filter Design
h i
(2k−1)π
ck = yN2 + cos 2 2N
B0 B1
H(sn ) = ×
k=1 s + 0.5107 s 2 + 0.5107s + 1.0108
B0 B1 1
H(sn ) = × 2 B0 B1 = = 0.5162
s + c0 s + bk s + ck 1.9372
B0 = B1
B02 = 0.5162
B0 B1 √
H(sn ) = × 2
s + 0.5107 s + b1 s + c1 B0 = 0.5162 = 0.7185
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 44 / 69
Chebyshev Filter Design
B0 B1 0.7185 0.7185
H(sn ) = × 2 = × 2
s + 0.5107 s + 0.5107s + 1.0108 s + 0.5107 s + 0.5107s + 1.0108
0.5162
H(sn ) =
s 3 + 1.0214s 2 + 1.2716s + 0.5162
Unnomalized transfer function, H(s) and Ωp = 0.7854 rad/sec
0.5162
Ha (s) = H3 (s)|s→ s = |s→ s
Ωp s 3 + 1.0214s 2 + 1.2716s + 0.5162 Ωp
0.5162
=
s3 2
Ωp 3
+ 1.0214 Ωs 2 + 1.2716 Ωs + 0.5162
p p
0.5162
=
s 3 +1.0214Ωp s 2 +1.2716Ω2p s+Ω3p
Ω3p
Ω3p
=
s3 + 1.0214Ωp s2 + 1.2716Ω2p s + Ω3p
0.5162 × 0.78543
=
s 3 + 1.0214 × 0.7854s 2 + 1.2716 × 0.78542 s + 0.78543
0.250
=
s 3 + 0.80229s 2 + 0.7844s + 0.2501
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 45 / 69
Chebyshev Filter Design
Design a Chebyshev IIR low pass filter that has to meet the following specifications
i) passband ripple ≤1.0 dB and passband edge frequency 1 rad/sec
ii) Stopband attenuation ≥15.0 dB and Stopband edge frequency 1.5 rad/sec
Solution:
Passband ripple Kp =1.0 dB or in normal value is Kp = 10Kp /20 = 10−1/20 = 0.891
Stopband ripple Ks =15.0 dB or in normal value is Ks = 10Ks /20 = 10−15/20 = 0.177
Passband edge frequency =1 rad/sec Stopband edge frequency =1.5rad/sec
" 1 #
(1/Ks2 )−1 2
cosh−1 (1/Kp2 )−1
H ( jω )
Gain
N1 =
Ωs
cosh−1 Ωp 1
" # 1 δp
h 2 i1
(1/0.177 )−1 2
cosh−1 1+ ε 2
(1/0.8912 )−1
= 1.5
cosh−1 1.0
1 δs
−1 31.0
cosh 0.26
2
cosh−1 [11.0] Ω
= = ΩP ΩS
cosh−1 (1.5) cosh−1 [1.5]
3.08 Figure 17: LPF specifications
= = 3.2 ' 4
0.96
N=4
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 46 / 69
Chebyshev Filter Design
When N is Even B1 B2
H(sn ) = × 2
N s 2 + b1 s + c1 s + b2 s + c2
2
Y Bk
H(sn ) =
k=1
s 2 + bk s + ck
1
(1/Kp2 ) − 1 2
=
N 4
N=4 k = 2
= 2
=2 1
(1/0.8912 ) − 1 2 = 0.51
=
——————————————————————————————————–
"
1 # N1 " 1 #− N1
1 1 2 1 1 2 1
yN = +1 + − +1 +
2 2 2
"
1 # 41 " 1 #− 14
1 1 2 1 1 2 1
= +1 + − +1 +
2 0.512 0.51 0.512 0.51
1 h 1
i1 h 1
i− 1
4 4
= (4.84) 2 + 1.96 − (4.84) 2 + 1.96
2
1h 1 1
i 1
= [2.2 + 1.96] 4 − [2.2 + 1.96]− 4 = [1.428 − 0.7] ' 0.364
2 2
h i
(2k−1)π
C0 = yN = 0.364 k=1 bk = 2 × yN sin 2×N
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 47 / 69
Chebyshev Filter Design
k=1 h i
(2−1)π
b1 = 2 × 0.364sin 2×4 = 0.278
k=2 h i
(2×2−1)π
b2 = 2 × 0.364sin 2×4
= 0.672
h i
2 2 (2k−1)π
ck = yN + cos 2N
k=2
k=1
(2 × 2 − 1)π
c2 = 0.3642 + cos 2
(2 − 1)π
c1 = 0.3642 + cos 2 2×4
2×4
3π
2 π = 0.132 + cos 2
h i
= 0.132 + cos 8
8 " #
1 + cos( 6π )
" #
1 + cos( 2π
8
) = 0.132 + 8
= 0.132 + 2
2
= 0.132 + 0.853 = 0.132 + 0.146 = 0.278
= 0.132 + 0.853 = 0.985
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 48 / 69
Chebyshev Filter Design
B1 B2
H(sn ) = × 2
s 2 + b1 s + c1 s + b2 s + c2
B1 B2
H(sn ) = ×
s 2 + 0.278s + 0.985 s 2 + 0.672s + 0.278
When N is odd the values of parameter Bk
are evaluated using
1 1
H(sn )|s=0 = = = 0.89
(1 + 2 )1/2 (1 + 0.512 )1/2
B1 B2
H(sn ) = = 0.89
0.985 × 0.278
B1 B2 = 0.244
B1 = B2
B12 = 0.244
√
B1 = 0.264 = 0.493
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 49 / 69
Chebyshev Filter Design
B1 B2 0.493 0.493
H(sn ) = × = 2 ×
s 2 + 0.278s + 0.985 s 2 + 0.672s + 0.278 s + 0.278s + 0.985 s 2 + 0.672s + 0.278
0.243
H(sn ) =
s 4 + 0.95s 3 + 1.45s 2 + 1.434s + 0.2738
Unnomalized transfer function, H(s) and Ωp = 1.0 rad/sec
0.243
Ha (s) = H4 (s)|s→ s = |s→ s
Ωp s 4 + 0.95s 3 + 1.45s 2 + 1.434s + 0.2738 1
0.263
=
s 4 + 0.95s 3 + 1.45s 2 + 1.434s + 0.2738
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 50 / 69
Chebyshev Filter Design
July 2014, Dec 2014 Design a Chebyshev IIR low pass filter that has to meet the following
specifications
i) passband ripple ≤2 dB and passband edge frequency 1 rad/sec
ii) Stopband attenuation ≥20 dB and Stopband edge frequency 1.3 rad/sec
Solution:
Passband ripple Kp =2 dB
or in normal value is Kp = 10Kp /20 = 10−2/20 = 0.7943
Stopband ripple Ks =12.395 dB
or in normal value is Ks = 10Ks /20 = 10−20/20 = 0.1
Passband edge frequency 1 rad/sec
Stopband edge frequency 1.3 rad/sec
" 1 #
(1/Ks2 )−1 2
cosh−1 (1/Kp2 )−1
N1 =
Ωs
cosh−1 Ωp
" #
i1
(1/0.12 )−1
h
2
cosh−1 (1/0.79432 )−1
=
cosh−1 1.3
1.0
−1 99.0
1
cosh 0.585
2
cosh−1 [13.00] 3.256
= 1.3
= = = 4.3 ' 5
cosh−1 [1.3]
cosh−1 1.0
0.756
N=5
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 51 / 69
Chebyshev Filter Design
When N is odd
B0 B1 B2
H(sn ) = × ×
s + c0 s 2 + b1 s + c1 s 2 + b2 s + c2
N−1
2
B0 Y Bk
H(sn ) =
s + c0 k=1 s 2 + bk s + ck
1
(1/Kp2 ) − 1
= 2
N−1 5−1 1
N=5 k = = =2 2 = (1/0.79432 ) − 1 2 = 0.7648
2
——————————————————————————————————–
"
1 # N1 " 1 #− N1
1 1 2 1 1 2 1
yN = +1 + − +1 +
2 2 2
"
1 # 51 " 1 #− 51
1 1 2 1 1 2 1
= +1 + − +1 +
2 0.76482 0.7648 0.76482 0.7648
1 h 1
i1 h 1
i− 1
5 5
= (2.71) 2 + 1.307 − (2.71) 2 + 1.307
2
1h 1 1
i 1
= [1.646 + 1.307] 5 − [1.646 + 1.307]− 5 = [1.241 − 0.805] ' 0.218
2 2
h i h i
(2k−1)π (2−1)π
C0 = yN = 0.218 bk = 2 × yN sin 2×N
k=1 b1 = 2 × 0.218sin 2×5
= 0.134
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 52 / 69
Chebyshev Filter Design
k=2 h i
(4−1)π
b2 = 2 × 0.218sin 2×5 = 0.352
h
(2k−1)π
i k=2
ck = yN2 + cos 2 2N
(4 − 1)π
k=1 c2 = 0.2182 + cos 2
2×5
(2 − 1)π
3π
c1 = 0.2182 + cos 2 = 0.047 + cos 2
2×5 10
" #
2 π 1 + cos( 2×3π )
h i
= 0.047 + cos = 0.047 + 10
10 2
" #
1 + cos( 2π
10
) = 0.047 + 0.345 = 0.392
= 0.047 +
2
= 0.047 + 0.904 = 0.951
————————————————————–
B0 B1 B2
H(sn ) = × 2 × 2
s + c0 s + b1 s + c1 s + b2 s + c2
B0 B1 B2
H(sn ) = × 2 × 2
s + 0.218 s + 0.134s + 0.951 s + 0.352s + 0.392
When N is odd the values of parameter Bk are evaluated using
H(sn )|s=0 = 1
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 53 / 69
Chebyshev Filter Design
H(sn )|s=0 = 1
B0 B1 B2
H(sn ) = = 12.3B0 B1 B2 = 1
0.218 × 0.951 × 0.392
1
B0 B1 B2 = = 0.081
12.3
√
3 1
B0 = B1 = B2 Then B03 = 0.081 B0 = 0.081 = 0.081 3 = 0.432
0.432 0.432 0.432
H(sn ) = × 2 × 2
s + 0.218 s + 0.134s + 0.951 s + 0.352s + 0.392
0.081
H(sn ) =
s 5 + 0.7048s 4 + 1.496s 3 + 0.689s 2 + 0.456s + 0.081
Unnomalized transfer function, H(s) and Ωp = 1 rad/sec
Hence
0.081
H(sn ) = 5
s + 0.7048s 4 + 1.496s 3 + 0.689s 2 + 0.456s + 0.081
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 54 / 69
Chebyshev Filter Design
Dec 2014: Design A Chebyshev I low pass filter that has to meet the following specifications
i) passband ripple ≤2 dB and passband edge frequency 1 rad/sec
ii) Stopband attenuation ≥20 dB and Stopband edge frequency 1.3 rad/sec
Solution:
Ωp =1 rad/sec, Ωs =1.3 rad/sec,
Kp =–2 dB, Ks =–20 dB,
H ( jω )
Gain
1
Kp = 20 log √ = −2 1
1 + 2 1 δp
=0.76478 1+ ε 2
1
δp = 1 − √ = 0.20567
1 + 2 δs
Ω
ΩP ΩS
Ks = 20 log δs = −20
δs =0.1 Figure 18: LPF specifications
s
(1 − δp )−2 − 1 The order of the filter is
d= = 0.077
δs−2 − 1
1
cosh−1
d
N= = 4.3 ' 5
Ωp 1 cosh−1 1
K = = = 0.769 K
Ωs 1.3
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 55 / 69
Chebyshev Filter Design
√ !1
N
√ !− 1
N
1 1+ 1 + 2 1 1+ 1 + 2
a= − = 0.21830398
2 2
√ !1
N
√ !− 1
N
1 1+ 1 + 2 1 1+ 1 + 2
b= + = 1.0235520
2 2
h π i h πi
Ωk = b cos (2k − 1) = b cos (2k − 1)
2N 10
h π i h πi
σk = −a sin (2k − 1) = −a sin (2k − 1)
2N 10
where k = 1, 2, . . . 2N i.e., k = 1, 2, . . . 10
The poles those are lie on left half of the s plane is
k σk Ωk
1 -0.0674610 0.9734557
2 -0.1766151 0.6016287
3 -0.2183083 0
4 -0.1766151 -0.6016287
5 -0.0674610 -0.9734557
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 56 / 69
Chebyshev Filter Design
KN KN
H5 (s) = Q =
(s − sk ) (s − s1 )(s − s2 )(s − s3 )(s − s4 )
LHPonly
KN
=
(s + 0.067461 − j0.9734557)(s + 0.067461 + j0.9734557)
(s + 0.1766151 − j0.6016287)(s + 0.1766151 + j0.6016287)(s + 0.2180383)
KN
=
(s 2 + 0.134922s + 0.95215)(s 2 + 0.35323s + 0.393115)(s + 0.2183083)
KN
=
s 5 + 0.70646s 4 + 1.4995s 3 + 0.6934s 2 + 0.459349s + 0.08172
N is odd KN = bo =0.08172
0.08172
H5 (s) =
s 5 + 0.70646s 4 + 1.4995s 3 + 0.6934s 2 + 0.459349s + 0.08172
Verification
0.08172
Ha (jΩ) =
(jΩ)5 + 0.70646(jΩ)4 − 1.49(jΩ)3 − 0.693(jΩ)2 + 0.4593(jΩ) + 0.08172
0.08172
|Ha (jΩ)| = p
(.7064Ω4 − .693Ω2 + .0817)2 + j(Ω5 − 1.499Ω3 + .4593Ω)2
20 log |Ha (jΩ)|1 = −2 dB
20 log |Ha (jΩ)|1 .3 = −24.5 dB
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 57 / 69
Analog Filter Design Analog to analog frequency transformations
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 58 / 69
Analog Filter Design Analog to analog frequency transformations
5 From analog lowpass to high frequency transformation, find the desired transfer function
by substituting the following
Ha (s) = HN (s)| Ωp
s→ Ω S
c
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 59 / 69
Analog Filter Design Analog to analog frequency transformations
Design a Butterworth analog highpass filter that will meet the following specifications
i) Maximum passband attenuation gain 2 dB
ii) Passband edge frequency=200 rad/sec
iii) Minimum stopband attenuation =20 dB
iv) Stopband edge frequency=100 rad/sec
Determine the transfer function Ha (s) of the lowest order Butterworth filter to meet the above
the specifications
Solution:
Gain in dB
20 log H a ( jω )
Gain in dB
20 log H a ( jω )
0
0 K P = −2dB
K P = −2 dB
K s = −20dB
K s = −20 dB Ω
Ω ΩP = 1 ΩS = 2
ΩP = 100 rad/sec Ωu = 200 rad/sec
1
H(sn ) =
(s 2 + 0.7654s + 1)(s 2 + 1.8478s + 1)
1
=
s 4 + 2.6118s 3 + 3.4117s 2 + 2.6118s + 1
Ωs
Ωc = −ks 1
(10 10 − 1) 2N
2 2
= 20 1
=
(10 10 − 1) 8 1.776
= 1.126 rad/sec
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 61 / 69
Analog Filter Design Analog to analog frequency transformations
1
Ha (s) =
(s 2 + 0.7654s + 1)(s 2 + 1.8478s + 1)
Ha (s) = Hp (s)| Ωp
s→ Ω s
c
= H4 (s)|s→ 200
1.126s
= H4 (s)|s→ 177.62
s
s4
=
(s 2 + 135.95s + 31548.86)(s 4 + 328.206s + 31548.86)
Verification
Ω4
Ha (jΩ) =
[(34980.7521 − Ω2 )
+ j1431.1464Ω]
[(34980.7521 − Ω2 ) + j1431.1464Ω]
Ω4
|Ha (jΩ)| = p
[(34980.7521 − Ω2 )2 + (1431.1464Ω)2 ]
p
[(34980.7521 − Ω2 )2 + (1431.1464Ω)2 ]
20 log |Ha (jΩ)|Ω=200 = −2 dB
20 log |Ha (jΩ)|Ω=100 = −21.83 dB
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 62 / 69
Analog Filter Design Analog to analog frequency transformations
Design a Butterworth analog bandpass filter that will meet the following specifications
i) a -3.0103 dB upper and lower cutoff frequency of 50 Hz and 20 KHz
ii) a Stopband attenuation of atleast 20 dB at 20 Hz and 45 KHz and
iii) Monotonic frequency response.
Solution:
Gain in dB
20 log H a ( jω )
20 log H a ( jΩ)
Gain in dB
0 0
K P = −2dB
KP
K s = −20dB
Ω
ΩP = 1 ΩS = 2
Ks
Ω
Figure 22: normalized LPF
Ω1 Ωl Ωu Ω2 specifications
Figure 21: HPF specifications
−Ω2 l + Ωl Ωu
A= = 2.51
Ωl (Ωu − Ωl )
Ω1 = 2π × 20 = 125.663rad/sec
Ω2 = 2π × 45 × 103 = 2.827 × 105 rad/sec −Ω2 2 − Ωl Ωu
B= = 2.25
Ωu = 2π × 20 × 103 = 1.257 × 105 rad/sec Ω2 (Ωu − Ωl )
Ωl = 2π × 50 × 103 = 314.159 × rad/sec ΩS = Min[|A|, |B|] = 2.25
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 63 / 69
Analog Filter Design Analog to analog frequency transformations
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 64 / 69
Analog Filter Design Analog to analog frequency transformations
1
Let H(s) = s 2 +s+1 represent the transfer function of LPF with passband of 1 rad/sec. Use
frequency transformation to find the transfer functions of the following analog filters
i) A lowpass filter with a passband of 10 rad/sec
ii) A highpass filter with a cutoff frequency of 1 rad/sec
iii) A highpass filter with a cutoff frequency of 10 rad/sec
iv) A bandpass filter with a passband of 10 rad/sec and a center frequency of 100
rad/sed
v) A bandstop filter with a stopband of 2 rad/sec and a center frequency of 10
rad/sed
Solution: Lowpass to highpass transformation
1
H(s) =
(s 2 + s + 1)
Ha (s) = H3 (s)|s→ s
10
1 100
= =
s 2 s s 2 + 10s + 100
10
+ 10
+1
10
Ha (s) = H3 (s)| Ω =
s→ Ω ps 1s
c
1 s2
= =
10 2 10 s 2 + 10s + 100
5
+ s
+1
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 65 / 69
Analog Filter Design Analog to analog frequency transformations
s 2 + Ωu Ωl s + Ω20
s→ =
s(Ωu − Ωl ) s + B0
√
where Ω0 = Ωu Ωl and B0 = Ωu Ωl
Ha (s) = H(s)| 2 4
s→ s +10×10
10s
100s 2
= =
s4 + 10s 3 + 20100s 2 + 104 s + 108
s(Ωu − Ωl ) sB0
s→ = 2
s 2 + Ωu Ωl s + Ω2
Ha (s) = H(s)|s→ 2s
s 2 +100
(s 2 + 100)2
= =
s4 + 2s 3 + 204s 2 + 200s + 104
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 66 / 69
Analog Filter Design Analog to analog frequency transformations
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 67 / 69
Analog Filter Design Analog to analog frequency transformations
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 68 / 69
References
Dr. Manjunatha. P (JNNCE) UNIT - 5: Analog Filter Design November 11, 2016 69 / 69
Design of FIR Filters
Elena Punskaya
www-sigproc.eng.cam.ac.uk/~op205
68
FIR as a class of LTI Filters
69
FIR Filters
70
FIR filters
Note that FIR filters have only zeros (no poles). Hence
known also as all-zero filters
Why bother?
72
FIR Filter using the DFT
FIR filter:
Now N-point DFT (Y(k)) and then N-point IDFT (y(n)) can be used
to compute standard convolution product and thus to perform
linear filtering (given how efficient FFT is)
73
Linear-phase filters
A general FIR filter does not have a linear phase response but
this property is satisfied when
74
Linear-phase filters – Filter types
Some observations:
75
FIR Design Methods
76
Back to Our Ideal Low- pass Filter Example
77
Approximation via truncation
78
Approximated filters obtained by truncation
M M
transition band
M M
M
79
Window Design Method
To be expected …
Truncation is just pre-multiplication by a rectangular window
This is not very clever
– obviously one
introduces a delay
spectrum convolution
80
Rectangular Window Frequency Response
81
Window Design Method
M
M M
M N M
82
Magnitude of Rectangular Window Frequency Response
83
Truncated Filter
84
Truncated Filter
85
Ideal Requirements
M M
88
Solution to Sharp Discontinuity of Rectangular Window
89
Alternative Windows –Time Domain
90
Windows –Magnitude of Frequency Response
91
Summary of Windows Characteristics
92
Filter realised with rectangular/Hanning windows
M=16 M=16
There are much less ripples for the Hanning window but
that the transition width has increased
93
Filter realised with Hanning windows
95
Specification necessary for Window Design Method
ωc - cutoff frequency
δ - maximum passband
ripple
Δω – transition bandwidth
Δωm – width of the window
mainlobe
97
Key Property 2 of the Window Design Method
98
Key Property 3 of the Window Design Method
99
Key Property 4 of the Window Design Method
100
Key Property 5 of the Window Design Method
101
Passband / stopband ripples
102
Summary of Window Design Procedure
5. Peak
transition approximation error
bandwidth is determined by the
window shape,
mainlobe independent of the
width filter order.
104
Summary of the windowed FIR filter design
procedure
δ1 =0.01
δ2 =0.01
106
Step 1. Select a suitable window function
1 if |ω| ≤ 0.25π
0 if 0.25π < |ω|< π
our ideal low-pass filter
frequency response
108
Step 3 Compute the coefficients of the ideal filter
40
40
109
Step 3 Compute the coefficients of the
ideal filter
110
Step 3 Compute the coefficients of the
ideal filter
If the Inverse FFT, and hence the filter coefficients, are to be purely real-
valued, the frequency response must be conjugate symmetric:
Hd(-2πp/N) = Hd* (2πp/N) (1)
Equating (1) & (2) we must set Hd(N-p) = Hd* (p) for p = 1, ..., (N/2-1).
112
Step 4 Multiply to obtain the filter coefficients
40
40
113
Step 5 Evaluate the Frequency Response and Iterate
If the resulting filter does not meet the specifications, one of the following
could be done
• adjust the ideal filter frequency response (for example, move the
band edge) and repeat from step 2
• adjust the filter length and repeat from step 4
• change the window (and filter length) and repeat from step 4
114
Matlab Implementation of the Window Method
B=FIR2(N,F,M)
116
Frequency sampling method
117
FIR Filter Design Using Windows
We now present a method that approximates the desired frequency response by a linear-phase FIR
amplitude function according to the following optimality criterion.
ε 2 = ∫E2(ω)dω
and we assume that the order and the type of the filter are known. Under this assumptions designing
the FIR filter now reduces to determining the coefficients that would minimise ε 2 .
119
Recall Our Example
passband frequency
ωp =0.2π
ωs =0.3π stopband frequency
The filter designed using window method cannot benefit from this
relaxation, however, a least-square method design gives N = 33
(compared to N = 80).
120
Least-Square Design of FIR Filters
121
Equiripple Design
ε = maxω |E(ω)|
122
Equiripple Design
123
Equiripple Design
124 124
Remez method
125
Equiripple Design: Weights
126 126
Equiripple Design: Example
128 128
The Parks-McClellan Remez exchange algorithm
If the filter length M+1 is odd, then the final term in curly brackets above is the single term
bM/2, that is the centre coefficient ('tap') of the filter.
130
Symmetric impulse response
Symmetric impulse response: if we put bM = b0, bM-1 = b1, etc., and note that exp(jθ)
+exp(-jθ) = 2cos(θ), the frequency response becomes
This is a purely real function (sum of cosines) multiplied by a linear phase term, hence
the response has linear phase, corresponding to a pure delay of M/2 samples, ie half the
filter length.
A similar argument can be used to simplify antisymmetric impulse responses in terms of a
sum of sine functions (such filters do not give a pure delay, although the phase still has a
linear form π/2-mΩ/2)
131 131
Implementation of symmetric FIR filters
The symmetric FIR filters of length N can be implemented using the folded delay line
structure shown below, which uses N/2 (or (N+1)/2) multipliers rather than N
132 132
Limitations of the algorithm
Linear phase in the stopbands is never a real requirement, and in some
applications strictly linear phase in the passband is not needed either.
The linear phase filters designed by this method are therefore longer than
optimum non-linear phase filters.
However, symmetric FIR filters of length N can be implemented using the folded
delay line structure shown below, which uses N/2 (or (N+1)/2) multipliers rather
than N, so the longer symmetric filter may be no more computationally intensive
than a shorter non-linear phase one.
133 133
Further options for FIR filter design
More general non-linear optimisation (least squared error or minimax) can of course
be used to design linear or non-linear phase FIR filters to meet more general frequency
and/or time domain requirements.
134 134
UNIT - 7: FIR Filter Design
Dr. Manjunatha. P
[email protected]
Professor
Dept. of ECE
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 2 / 94
Unit 7 Syllabus
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 3 / 94
FIR Filter Design Introduction
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 4 / 94
FIR Filter Design Introduction
−π −ωc 0 ωc π ω
The impulse response is given by
Figure 1: Ideal low pass filter
Zωc ( ωc
1 π
n=0
h(n) = H(ω)e jωn dω = ωc sin(ωc n)
2π π ωc n
n 6= 0
−ωc
Paley-Wiener Theorem:
If h(n) has finite energy and h(n) = 0 for n < 0
then
Zπ
| ln |H(ω)||dω < ∞ Figure 2: Unit sample response
−π
H(ω) can be zero at some frequencies. but it cannot be zero over any finite of
frequencies, since the integral then becomes infinite.
H(ω) cannot be exactly zero over any band of frequencies. (Except in the trivial case where h[n]
= 0.) Furthermore, |H(ω)| cannot be flat (constant) over any finite band.
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 5 / 94
FIR Filter Design Introduction
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 6 / 94
FIR Filter Design Introduction
Ideal filters are noncausal, hence physically unrealizable for real time signal processing
applications.
Causality implies that the frequency response characteristic H(ω) of the filter cannot be
zero, except at finite set of points in the frequency range. And also H(ω) cannot have an
infinitely sharp cutoff from passband to stopband, that is H(ω) cannot drop from unity to
zero abruptly.
It is not necessary to insist that the magnitude be constant in the entire passband of the
filter. A small amount of ripple in the passband is usually tolerable.
The filter response may not be zero in the stopband, it may have small nonzero value or
ripple.
The transition of the frequency response from passband to stopband defines transition
band.
The passband is usually called bandwidth of the filter.
The width of transition band is ωs − ωp where ωp defines passband edge frequency and ωs
defines stopband edge frequency.
The magnitude of passband ripple is varies between the limits 1 ± δ1 where δ1 is the ripple
in the passband
The ripple in the stopand of the filter is denoted as δ2
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 7 / 94
FIR Filter Design FIR Filter Design
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 8 / 94
FIR Filter Design FIR Filter Design
An FIR system does not have feedback. Hence y (n − k) term is absent in the system. FIR
output is expressed as
M
X
y (n) = bk x(n − k)
k=0
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 9 / 94
FIR Filter Design Symmetric and Antisymmetric FIR Filters
Linear phase is a property of a filter, where the phase response of the filter is a linear
function of frequency. The result is that all frequency components of the input signal are
shifted in time (usually delayed) by the same constant amount, which is referred to as the
phase delay. And consequently, there is no phase distortion due to the time delay of
frequencies relative to one another.
Linear-phase filters have a symmetric impulse response.
The FIR filter has linear phase if its unit sample response satisfies the following condition:
h(n) = h(M − 1 − n) n = 0, 1, 2, . . . , N − 1
M−1
X
H(z) = h(n)z −n
n=0
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 10 / 94
FIR Filter Design Symmetric and Antisymmetric FIR Filters
-2 -1 0 1 2 3 4
-2 -1 0 1 2 3 4
0 1 2 3 4 5 6 7 8 n 0 1 2 3 4 5 6 7 8 n
-2 -1 0 1 2 3 4
0 1 2 3 4 5 6 7 8 n 0 1 2 3 4 5 6 7 8 n
Center of Symmetry
Center of Symmetry
-2 -1 0 1 2 3 4
-2 -1 0 1 2 3 4
Symmetric impulse response with M=odd Then
h(n) = h(M − 1 − n) and (z = e jω )
(M−3)/2 0 1 2 3 4 5 6 7 8 n
M −1 M−1 X h i
H(z) = h z 2 + h(n) z −n + z −(M−1−n)
2 n=0 Center of Symmetry
-2 -1 0 1 2 3 4
-2 -1 0 1 2 3 4
M−1 M−1 M−1 M−1
e −jωn = e −jωn e jω( 2
)
e −jω( 2
)
= e jω( 2
−n)
.e −jω( 2
)
M−1
−jω M−1 jω −n −jω M−1 −n
e −jωn + e −jω(M−1−n) = e 2 e 2 +e 2 Center of Symmetry
−jω M−1 M −1
= e 2 2cosω −n
2
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 12 / 94
FIR Filter Design Symmetric and Antisymmetric FIR Filters
M−3
2
M − 1 −jω( M−1 ) X
H(e jω
) = h( )e 2 + h(n)[e −jωn + e −jω(M−1−n) ]
2 n=0
M−3
2
M −1 −jω M−1 X M −1
−jω M−1
= h e 2 + h(n)e −n2 2cosω
2 n=0
2
M−3
2
−jω M−1 M − 1 X M − 1
= e 2
h +2 h(n)cos ω −n
2 n=0
2
M−3
2
M −1 X M −1
|H(ω)| = h +2 h(n)cos ω −n
2 n=0
2
−ω M−1 for |H(ω)| > 0
2
∠H(ω) =
−ω M−1 + π for |H(ω)| < 0
2
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 13 / 94
FIR Filter Design Symmetric and Antisymmetric FIR Filters
-2 -1 0 1 2 3 4
-2 -1 0 1 2 3 4
H(ω) = |H(ω)|e j∠H(ω)
M −1
2 0 1 2 3 4 5
6 7 8 n 0 1 2 3 4 5 6 7 8 n
X M −1
|H(ω)| = 2 h(n)cos ω −n
n=0
2
Center of Symmetry Center of Symmetry
−ω M−1 for |H(ω)| > 0
Antisymmetry: h(n)=-h(M-1-n) Odd M Antisymmetry: h(n)=-h(M-1-n) Even M
2
∠H(ω) = h[n] h[n]
−ω M−1 + π for |H(ω)| < 0
2
-2 -1 0 1 2 3 4
-2 -1 0 1 2 3 4
0 1 2 3 4 5 6 7 8 n 0 1 2 3 4 5 6 7 8 n
Center of Symmetry
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter
CenterDesign
of Symmetry October 25, 2016 14 / 94
FIR Filter Design Design of linear-phase FIR filters using windows
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 15 / 94
FIR Filter Design
Design steps for Linear Phase FIR Filter (Fourier Series method)
1 Based on the desired frequency response specification Hd (e jω ) determine the
corresponding unit sample response hd (n).
∞
X
Hd (e jω ) = hd (n)e −jωn
n=0
2 Obtain the impulse response hd (n) for the desired frequency response Hd (ω) by evaluating
the inverse Fourier transform.
1
Z π
hd (n) = Hd (e jω )e jωn dω
2π −π
3 In general the sample response hd (n) is infinite in duration and must be truncated at
some point to get an FIR filter of length M. Truncation is achieved by multiplying hd (n)
by window function.
h(n) = hd (n)w (n)
where w (n) is window function
4 Obtain the H(z) for h(n) by taking z transform
5 Obtain the magnitude response |H(e jω )| and phase response θ(ω)|
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 16 / 94
FIR Filter Design
H d (ω ) H d (ω )
1 1
ω ω
0 ωp π 0 ωp π
Low pass Filter High pass Filter
H d (ω ) H d (ω )
1 1
ω π
ω
0 ω1 ω2 π 0 ω1 ω2 ω3 ω4
Band pass Filter Band stop pass Filter
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 18 / 94
FIR Filter Design Window Design Techniques
Rectangular window
wR (n)
attenuation.
The width of main lobe is 4π/N Figure 6: Rectangular window
1 for n = 0, 1, M − 1
ωR (n) =
0 otherwise
| sin( ωM
2
)|
|WR (ω)| =
| sin( ω2 )|
n
0 1 2 3 4 5 6 M-1
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 20 / 94
FIR Filter Design Window Design Techniques
Hanning window
wH (n)
n
0 1 2 3 4 5 6 M-1
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 21 / 94
FIR Filter Design Window Design Techniques
Hamming window
This is a modified version of the raised cosine window
2πn
w (n) = 0.54 − 0.46 cos
M −1
2π 2π
W (ω) ≈ 0.54WR (ω) + 0.23 WR (ω − ) + WR (ω + )
M M
8π
The width of main lobe is: M
wH (n)
n
0 1 2 3 4 5 6 M-1
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 22 / 94
FIR Filter Design Window Design Techniques
Blackman window
This is a 2nd -order raised cosine window.
2πn 4πn
w (n) = 0.42 − 0.5 cos + 0.08 cos
M −1 M −1
2π 2π
W (ω) ≈ 0.42WR (ω) + 0.25 WR (ω − M
) + WR (ω + M
)
+0.04 WR (ω − 4π ) + WR (ω + 4π
M M
)
n
0 1 2 3 4 5 6 M-1
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 23 / 94
FIR Filter Design Window Design Techniques
Kaiser window
This is one of the most useful and optimum windows.
r !
2
2n
I0 β 1− 1− M−1
w (n) =
I0 (β)
Where I0 (X ) is the modified zero-order Bessel function, and is a parameter that can be chosen
to yield various transition widths and stop band attenuation. This window can provide different
transition widths for the same N.
β = 0 → rectangularwindow
β = 5.44 → Hammingwindow
β = 8.5 → Blackmanwindow
wH (n)
n
0 1 2 3 4 5 6 M-1
Figure 16:
Dr. Manjunatha. P Kaiser windowUNIT - 7: FIR Filter DesignFigure 17: Kaiser
(JNNCE) window
October 25, 2016 24 / 94
FIR Filter Design Window Design Techniques
Gibbs Phenomenon
The magnitude of the frequency response H(ω) is as shown in Figure. Large oscillations
or ripples occur near the band edge of the filter. The oscillations increase in frequency as
M increases, but they do not dimmish in amplitude.
These large oscillations are due to the result of large sidelobes existing in the frequency
characteristic W (ω) of the rectangular window.
The truncation of the Fourier series is known to introduce ripples in the frequency
response characteristic H(ω) due to the nonuniform convergence of the Fourier series at a
discontinuity.
The oscillatory behavior near the band edge of the filter is called the Gibbs Phenomenon.
To alleviate the presence of large oscillations in both the passband and the stopband
window function is used that contains a taper and decays toward zero gradually .
Design a LPF using rectangular window for the desired frequency response of a low pass filter
given by ωc = π2 rad/sec, and take M=11. Find the values of h(n). Also plot the magnitude
response.
Solution:
H d (e jω )
1
e −jωτ − ωc ≤ ω ≤ ωc
jω
Hd (e ) = 0 − π ≤ ω ≤ −ωc
0 ωc ≤ ω ≤ π
ω
−π −
π
0 π π
M −1 2 2
τ = =5
2
−jωτ Figure 20: Frequency response of LPF
e − ωc ≤ ω ≤ ωc
Hd (e jω ) =
0 Otherwise
By taking inverse Fourier transform
" # ωc
Z π 1 e jω(n−τ )
1 hd (n) =
hd (n) = Hd (e jω )e jωn dω 2π j(n − τ )
2π −π −ωc
1
Z ωc 1 h i
= e −jωτ e jωn dω = e jωc (n−τ )
− e −jωc (n−τ )
2π −ωc 2jπ(n − τ )
" #
e jωc (n−τ ) − e −jωc (n−τ )
Z ωc
1 1
= e jω(n−τ ) dω =
2π −ωc π(n − τ ) 2j
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 27 / 94
FIR Filter Design Low Pass FIR Filter Design
M−3
2
M −1 X M −1
|H(e jω )| = h +2 h(n)cos ω −n
2 n=0
2
4
X
= h(5) + 2 h(n)cos ω(5 − n)
n=0
= h(5) + 2h(0)cos 5ω + 2h(1)cos 4ω + 2h(2)cos 3ω + 2h(3)cos 2ω + 2h(4)cos ω
= 0.5 + 0.127cos 5ω − 0.212cos 3ω + 0.636cos ω
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 29 / 94
FIR Filter Design Low Pass FIR Filter Design
|H(ejw)|dB
−20
0.2π 0.9535 -0.41
0.3π 1.0758 0.63 −30
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 30 / 94
FIR Filter Design Low Pass FIR Filter Design
M −1
τ = =3
2
Z π
1
hd (n) = Hd (e jω )e jωn dω
2π −π H d (e jω )
Z ωc 1
1
= e −jωτ e jωn dω
2π −ωc
ω
Z ωc
1 3π 3π
= e jω(n−τ ) dω −π − 0 π
2π −ωc 4 4
" # ωc
1 e jω(n−τ )
=
2π j(n − τ )
−ωc
sinωc (n − τ )
hd (n) =
" #
1 e jωc (n−τ ) − e −jωc (n−τ ) π(n − τ )
=
π(n − τ ) 2j
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 31 / 94
FIR Filter Design Low Pass FIR Filter Design
3π(0−3)
sin 4
hd (0) = = 0.075
π(0 − 3)
3π(1−3)
sin 4
hd (1) = = −0.159
π(1 − 3)
3π M−1
n 6= 3 ωc = τ = =3
4 2 3π(2−3)
sin 4
hd (2) = = 0.225
h
3π(n−3)
i π(2 − 3)
sin 4
hd (n) = 3π(3−3)
sin
π(n − 3) 4
hd (3) = = 0.75
π(3 − 3)
for n=3 hd (n) = 00 . Using L Hospital’s Rule
3π(4−3)
sin 4
hd (4) = = 0.225
sin
3π
(n − 3)
π(4 − 3)
4 3π/4
lim = = 0.75
3π(5−3)
n→3 π(n − 3) π sin 4
hd (5) = = −0.159
π(5 − 3)
3π(6−3)
sin 4
hd (6) = = 0.075
π(6 − 3)
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 32 / 94
FIR Filter Design Low Pass FIR Filter Design
2πn
w (n) = 0.54 − 0.46cos
M −1 To calculate the value of h(n)
0
ω(0) = 0.54 − 0.46cos = 0.08 h(n) = hd (n)w (n)
6
2π
ω(1) = 0.54 − 0.46cos = .31
6
h(0) = hd (0)w (0) = 0.075 × 0.08 = 0.006
4π
ω(2) = 0.54 − 0.46cos = .77 h(1) = hd (1)w (1) = −0.159 × 0.31 = −0.049
6
h(2) = hd (2)w (2) = 0.225 × 0.77 = 0.173
6π
ω(3) = 0.54 − 0.46cos =1 h(3) = hd (3)w (3) = 0.750 × 1 = 0.750
6
8π h(4) = hd (4)w (4) = 0.225 × 0.77 = 0.173
ω(4) = 0.54 − 0.46cos = 0.77 h(5) = hd (5)w (5) = −0.159 × 0.31 = −0.049
6
h(6) = hd (6)w (6) = 0.075 × 0.08 = 0.006
10π
ω(5) = 0.54 − 0.46cos = .31
6
12π
ω(6) = 0.54 − 0.46cos = .08
6
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 33 / 94
FIR Filter Design Low Pass FIR Filter Design
|H(ejw)|dB
−4
0.2π 0.9959 -0.0354
0.3π 1.9722 -0.2445 −6
Matlab code
clc; clear all; close all;
M= input(’enter the value of M:’);
omega= input(’enter the value of omega:’);
tau=(M-1)/2 ;
for n=0:M-1;
% c(n+1)=.5-.5*cos((2*pi*n)/(M-1));
c(n+1)=.54-.46*cos((2*pi*n)/(M-1));
if n==tau
h(n+1)=omega/pi;
else
h(n+1)=sin(omega*(n-tau))/(pi*(n-tau));
end
end
h
c
for n=1:M
y=h(n)*c(n)’
end
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 35 / 94
FIR Filter Design Low Pass FIR Filter Design
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 36 / 94
FIR Filter Design Low Pass FIR Filter Design
Determine the filter coefficients hd (n) for the desired frequency response of a low pass filter
given by
for − π4 ≤ ω ≤ π4
−2jω
e
Hd (e jω ) =
0 for π4 ≤ |ω| ≤ −π
If we define the new filter coefficients by hd (n) = hd (n)ω(n) where
1 for 0 ≤ n ≤ 4
ω(n) =
0 otherwise
Determine h(n) and also the frequency response H(e jω ) July-2013, July-2011
Solution:
π H d (e jω )
Z
1
hd (n) = Hd (e jω )e jωn dω 1
2π −π
1
Z π/4
= e −j2ω e jωn dω π ω
2π −π/4 −π − 0 π π
4 4
1
Z π/4
= e jω(n−2) dω
2π −π/4
" #π/4
1 e jω(n−2) 1 h π π
i
= hd (n) = e j 4 (n−2) − e −j 4 (n−2)
2π j(n − 2) 2jπ(n − 2)
−π/4 " π π #
1 e j 4 (n−2) − e −j 4 (n−2)
=
π(n − 2) 2j
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 37 / 94
FIR Filter Design Low Pass FIR Filter Design
π n hd (n) n hd (n)
sin 4
(n − 2) π/4
lim = = 0.25 0 0.159091 3 0.224989
n→2 π(n − 2) π 1 0.224989 4 0.159091
2 0.25
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 38 / 94
FIR Filter Design Low Pass FIR Filter Design
|H(ejw)|dB
−20
0.2π 0.7123 -2.9464
0.3π 0.4162 -7.6132 −30
Design the symmetric FIR lowpass filter whose desired frequency response is given as
e −jωτ
for |ω| ≤ ωc
Hd (ω) =
0 Otherwise
The length of the filter should be 7 and ωc = 1 radians/sample. Use rectangular window.
Solution:
Desired frequency response Hd (ω)
Length of the filter M=7 H d (e jω )
1
Cut-off frequency ωc = 1 radians/sample.
Unit sample response is defined as
Z π ω
1 −π π
hd (n) = Hd (e jω )e jωn dω −1 0 1
2π −π
Given Hd (ω) is Figure 24: Frequency response of
LPF
e −ωτ
for − 1 ≤ ω ≤ 1
Hd (ω) =
0 Otherwise
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 40 / 94
FIR Filter Design Low Pass FIR Filter Design
Thus hd (n) is
This is the unit sample response of required
(
sin(n−τ ) FIR filter. The filter is symmetric and satis-
for n 6= τ
hd (n) = π(n−τ ) fies h(n) = h(M − 1 − n)
1
π
for n = τ
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 41 / 94
FIR Filter Design Low Pass FIR Filter Design
2πn
ω(n) = 0.5(1 − cos )
M −1
2πn
ω(n) = 0.5(1 − cos )
6
To calculate the value of h(n)
ω(0) = 0.0
2π h(0) = hd (0)w (0) = 0.01497 × 0 = 0
ω(1) = 0.5(1 − cos ) = .25
6 h(1) = hd (1)w (1) = 0.014472 × 0.25 = 0.03618
4π
ω(2) = 0.5(1 − cos ) = .75 h(2) = hd (2)w (2) = 0.26785 × 0.75 = 0.20089
6
6π h(3) = hd (3)w (3) = 0.31831 × 1 = 0.31831
ω(3) = 0.5(1 − cos )=1 h(4) = hd (4)w (4) = 0.26785 × 0.75 = 0.20089
6
8π h(5) = hd (5)w (5) = 0.14472 × 0.25 = 0.03618
ω(4) = 0.5(1 − cos ) = .75
6 h(6) = hd (6)w (6) = 0.014497 × 0.0 = 0
10π
ω(5) = 0.5(1 − cos ) = .25
6
12π
ω(6) = 0.5(1 − cos )=0
6
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 42 / 94
FIR Filter Design Low Pass FIR Filter Design
Design a lowpass digital filter to be used in an A/D Hz D/A structure that will have a -3 dB
cut-off at 30 π rad/sec and an attenuation of 50 dB at 45 π rad/sec. The filter is required to
have linear phase and the system will use sampling rate of 100 samples/second.
Solution:
3 dB cut-off at 30 π rad/sec
ωc = 30πrad/sec
Sampling frequency FSF = 100 Hz
Stopband attenuation of 50 dB at 45 π rad/sec
As =50 dB for ωs = 45πrad/sec H d (e jω )
ω = FΩ 1
sf
ω1 =
Ω1
=
30π
= 0.3π rad/sample ω
Fsf 100 −π −0.3π 0 0.3π π
Ω2 45π
ω2 = = = 0.45π rad/sample Figure 25: Frequency response of LPF
Fsf 100
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 43 / 94
FIR Filter Design Low Pass FIR Filter Design
Type of window is
The stopband attenuation of 50 dB
e −jωτ
is provided by the Hamming window for − ωc ≤ ω ≤ ωc
Hd (ω) =
which of -53 dB. Hence Hamming win- 0 Otherwise
dow is selected for the given specifica-
tions. τ = (M − 1)/2 = 55 − 1/2 = 27
To determine the order of the filter ωc = 0.3π
The width of the main lobe in Ham-
1
Z ωc
ming window is 8πM hd (n) = e −jωτ e jωn dω
2π −ωc
2π 8π Z 0.3π
k = 1
M M = e jω(n−27) dω
2π −0.3π
8π " #0.3π
M= 1 e ω(n−27)
ω2 − ω1 =
2π j(n − 27)
The order of the filter M is: −0.3π
sin[ωc (n − 27)]
8π = for n 6= 27
M= = 53.33 π(n − 27)
0.45π − 0.3π
when n = 27
Assume linear phase FIR filter of odd
length Hence select next odd integer ωc
hd (n) = = 0.3
length of 55. π
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 44 / 94
FIR Filter Design Low Pass FIR Filter Design
n h(n) n h(n)
The selected window is Hamming M=27 0 0.0 28 0.2567
1 0.0 29 0.1495
2 -0.0012 30 0.0319
3 0.0 31 -0.0445
2πn 4 0.0 32 -0.0588
w (n) = 0.54 − 0.46cos 5 0.0021 33 - 0.0278
M −1 6 0.0023 34 0.012
πn
7 0.0 35 0.0308
= 0.54 − 0.46cos 8 -0.0036 36 0.0220
18 9 -0.0052 37 -0.0
10 -0.0021 38 -0.0157
The value of h(n) 11 0.0048 39 -0.0156
12 0.0098 40 -0.0043
13 0.0069 41 0.0069
h(n) = hd (n)w (n) 14 -0.0043 42 0.0098
15 -0.0156 43 0.0048
16 -0.0157 44 -0.0021
for M= 27 17 0.0 45 -0.0052
18 0.0220 46 -0.0036
19 -0.0308 47 0.0
sin[0.3π(n − 27)] h πn i
20 -0.0120 48 0.0023
h(n) = 0.54 − 0.46cos
π(n − 27) 18 21 -0.0278 49 0.0021
22 -0.0588 50 0.0
23 -0.0445 51 0.0
for n 6= 27 24 0.0319 52 -0.0012
25 0.1495 53 0.0
h πn i 26 0.2567 54 0.0
h(n) = 0.3 0.54 − 0.46cos 27 0.3
18
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 45 / 94
FIR Filter Design Low Pass FIR Filter Design
An analog signal contains frequencies upto 10 KHz. The signal is sampled at 50 KHz. Design
an FIR filter having linear phase characteristic and transition band of 5 KHz. The filter should
provide minimum 50 dB attenuation at the end of transition band.
Solution:
3 dB cut-off at 30 π rad/sec
Ωp = 2π × 10 × 103 rad/sec
Ωs = 2π × (10 + 5) × 103 rad/sec
Sampling frequency FSF = 100 Hz
Stopband attenuation of 50 dB at 45 π rad/sec
As =50 dB for ωs = 45πrad/sec H d (e jω )
1
ω = FΩ
sf
Ωp 2π × 10 × 103 ω
ωp = = = 0.4π −π −0.5π 0 0.5π π
Fsf 50 × 103
Ωs 2π × (10 + 5) × 103 Figure 26: Frequency response of LPF
ωs = = = 0.6π
Fsf 50 × 103
ωp = 0.4π rad/sample
ωs = 0.6π rad/sample
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 46 / 94
FIR Filter Design Low Pass FIR Filter Design
Type of window is
e −jωτ
The stopband attenuation of 50 dB for − ωc ≤ ω ≤ ωc
Hd (ω) =
is provided by the Hamming window 0 Otherwise
which of -53 dB. Hence Hamming win-
dow is selected for the given specifica- τ = (M − 1)/2 = 41 − 1/2 = 20
tions. ωc = ωp + ∆ω = 0.4π + 0.2π
2 2
To determine the order of the filter ωc = 0.5π
The width of the main lobe in Ham-
ming window is 8πM 1
Z ωc
hd (n) = e −jωτ e jωn dω
2π 8π 2π −ωc
k = Z 0.5π
M M 1
= e jω(n−20) dω
2π −0.5π
8π
M≥ " #0.5π
ωs − ωp 1 e ω(n−27)
=
2π j(n − 20)
The order of the filter M is: −0.5π
sin[ωc (n − 20)]
8π = for n 6= 20
M≥ ≥ 40 π(n − 20)
0.6π − 0.4π
when n = 20
Assume linear phase FIR filter of odd
length Hence select next odd integer ωc 0.5π
length of 41. hd (n) = = = 0.5
π π
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 47 / 94
FIR Filter Design Low Pass FIR Filter Design
n h(n) n h(n)
The selected window is Hamming M=41
0 0.0 21 0.3148
1 -0.00146 22 0.0
2πn
2 0.0 23 -0.1
w (n) = 0.54 − 0.46cos 3 -0.00247 24 0.0
M −1
4 0 25 0.055
2πn 5 -0.00451 26 0.0
= 0.54 − 0.46cos
40 6 0.0 27 -0.0337
7 0.0079 28 0.0
The value of h(n) 8 0.0 29 0.0213
9 -0.0136 30 0.0
h(n) = hd (n)w (n) 10 0.0 31 -0.0136
11 0.002135 32 0.0
for M= 41 n 6= 20 12 0.0 33 0.0079
13 -0.03375 34 0
14 0.0 35 -0.0045
sin[0.5π(n − 20)] 2πn
h(n) = 0.54 − 0.46cos 15 0.05504 36 0.0
π(n − 20) 20 16 0.0 37 0.0024
17 -0.1006 38 0.0
for n = 20 18 0.0 39 -0.0014
19 0.3148 40 0.0
2πn 20 0.5
h(n) = 0.5 0.54 − 0.46cos
20
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 48 / 94
FIR Filter Design Low Pass FIR Filter Design
Design an FIR filter (lowpass) using rectangular window with passband gain of 0 dB, cutoff
frequency of 200 Hz, sampling frequency of 1 kHz. Assume the length of the impulse response
as 7.
Solution:
Fc = 200 Hz, Fs = 1000 Hz,
fc = FFc 1000
200
= 0.2cycles/sample
s
ωc = 2π ∗ fc = 2π × 0.2 = 0.4πrad H d (e jω )
1
M=7
ω
e −jωτ π
Hd (ω) =
for − ωc ≤ ω ≤ ωc −π −0.4π 0 0.4π
0 Otherwise
Figure 27: Frequency response of LPF
τ = (M − 1)/2 = 7 − 1/2 = 3
ωc = 0.4π
when n 6= 3
1
Z ωc
hd (n) = e −jωτ e jωn dω
2π −ωc sin[0.4π(n − 3)]
0.4π
hd (n) =
π(n − 3)
Z
1
= e jω(n−3) dω
2π −0.4π
" #0.4π when n = 3
1 e ω(n−3)
= 0.4π
2π j(n − 3) hd (n) = = 0.4
−0.4π
π
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 49 / 94
FIR Filter Design Low Pass FIR Filter Design
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 50 / 94
FIR Filter Design Low Pass FIR Filter Design
Using rectangular window design a lowpass filter with passband gain of unity, cutoff frequency of
1000 Hz, sampling frequency of 5 kHz. The length of the impulse response should be 7.
DEC:2013,DEC:2012
Solution:
Fc = 1000 Hz, Fs = 5000 Hz,
fc = FFc 5000
1000
= 0.2cycles/sample
s
ωc = 2πfc = 2 × π × 0.2 = 0.4πrad
M=7
The filter specifications (ωc and M=7) are similar to the previous example. Hence same filter
coefficients are obtained.
h(0)=-0.062341, h(1)=0.093511, h(2)=0.302609
h(3)=0.4, h(4)=0.302609, h(5)=0.093511, h(6)=-0.062341
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 51 / 94
FIR Filter Design Low Pass FIR Filter Design
Design a normalized linear phase FIR low pass filter having phase delay of τ = 4 and at least 40
dB attenuation in the stopband. Also obtain the magnitude/frequency response of the filter.
M −1 ω
τ = −π −1 0 1 π
2
For τ = 4 M=9
Figure 28: Frequency response of
LPF
Desired unit sample response hd (n) is
1
Z ωc when n 6= 4
hd (n) = e −jωτ e jωn dω
2π −ωc
sin[(n − 4)]
1
Z1 hd (n) =
= e jω(n−4) dω π(n − 4)
2π −1
" #1 when n = 4
1 e ω(n−4)
=
2π j(n − 4) 1
Z 1 ω 1
−1
hd (n) = 1dω = =
2π −1 π π
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 52 / 94
FIR Filter Design Low Pass FIR Filter Design
for n = 0 to 8
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 53 / 94
FIR Filter Design Low Pass FIR Filter Design
|H(ejw)|dB
−20
0.2π 0.7123 -2.9464
0.3π 0.4162 -7.6132 −30
Design a HPF using Hamming window. Given that cutoff frequency the filter coefficients hd (n)
for the desired frequency response of a low pass filter given by ωc = 1rad/sec, and take M=7.
Also plot the magnitude response.
Solution: −jωτ
e − π ≤ ω ≤ −ωc
jω
Hd (e ) = e −jωτ ωc ≤ ω ≤ −π
0 − ωc ≤ ω ≤ ωc
M −1
τ = =3
2
e −jωτ
− π ≤ −ω ≤ ωc
Hd (e jω ) =
0 Otherwise
H d ( e jω )
1
1
Z π
hd (n) = Hd (e jω )e jωn dω
2π −π −ωc ωc π ω
−π 0
Z −ωc Z π
1 jω(n−τ ) jω(n−τ )
= [ e dω + e dω
2π −π ωc
" #−ωc " #π
1 e jω(n−τ ) 1 e jω(n−τ )
= +
2π j(n − τ ) 2π j(n − τ )
−π ωc
" #
1 e −jωc (n−τ ) − e −jπ(n−τ ) + e jπ(n−τ ) − e jωc (n−τ )
=
π(n − τ ) 2j
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 55 / 94
FIR Filter Design High Pass FIR Filter Design
" #
e jπ(n−τ ) − e −jπ(n−τ ) − e jωc (n−τ ) − e −jωc (n−τ )
1
hd (n) =
π(n − τ ) 2j
1
= [sinπ(n − τ ) − sinωc (n − τ ]
π(n − τ )
1
τ = 3 ωc = 1 hd (n) = π(n−3) [sinπ(n − 3) − sin(n − 3)]
when n = τ using L Hospital rule
1 sinπ(n − 3) sinωc (n − 3) 1 1
hd (n) = − = [π − ωc ] = [π − 1]
π (n − 3) (n − 3) π π
The given window function is Hamming window. In this case h(n) = hd (n)ω(n)) for 0 ≤ n ≤ 6
2πn
w (n) = 0.54 − 0.46cos
M −1
1 2πn
h(n) = [sinπ(n − 3) − sin(n − 3)] × 0.54 − 0.46cos
π(n − 3) M −1
n h(n) n h(n)
0 -0.00119 4 -0.00119
1 -0.00448 5 -0.00448
2 -0.2062 6 -0.2062
3 0.6816
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 56 / 94
FIR Filter Design High Pass FIR Filter Design
For M=7
2
X
|H(e jω )| = h (3) + 2 h(n)cosω(3 − n)
n=0
= h (3) + 2h(0)cos3ω + 2h(1)cos2ω + 2h(2)cosω
= 0.6816 − 0.000238cos3ω − 0.0896cos2ω − 0.4214cosω
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 57 / 94
FIR Filter Design Band Pass FIR Filter Design
Design the bandpass linear phase FIR filter having cut off frequencies of ωc1 = 1rad/sample and
ωc2 = 2rad/sample. Obtain the unit sample response through following window.
1 for 0 ≤ n ≤ 6
ω(n) =
0 Otherwise
Solution:
H d ( e jω )
1
e −jωτ ωc1 ≤ |ωc | ≤ ωc2
Hd (ω) =
0 Otherwise
−π −ωc 2 −ωc1 0 ωc 1 ωc 2 π ω
1
Z π
hd (n) = Hd (ω)e jωn dω
2π −π
"Z #
1 −ωc1 Z ωc2
−jωτ jωn −jωτ jωn
= e e dω + e e dω
2π −ωc2 ωc1
"Z #
1 −ωc1 Z ωc2
= e jω(n−τ ) + e jω(n−τ ) dω
2π −ωc2 ωc1
" #−ωc " #ωc
1 e jω(n−τ ) 1
e jω(n−τ ) 2
= +
2π (n − τ ) (n − τ )
−ωc2 ωc1
sinωc2 (n − τ ) − sinωc1 (n − τ )
= for n 6= τ
π(n − τ )
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 58 / 94
FIR Filter Design Band Pass FIR Filter Design
sinωc2 (n − τ ) − sinωc1 (n − τ )
hd (n) =
π(n − τ )
ωc2 − ωc1
= for n = τ
π
The linear phase FIR filter is normalized means its n h(n) n h(n)
cut-off frequency is of ωc = 1rad/sample 0 -0.044 4 0.0215
The length of the filter with given τ is related by 1 -0.165 5 0.265
2 0.215 6 -0.044
M −1 7−1 3 0.3183
τ = = =3
2 2
M−3
2
M −1 X M −1
H(ω) = h +2 h(n)cos ω −n
2 n=0
2
2
X
H(ω) = h(3) + 2 h(n)cos ω (n − 3)
n=0
Estimate the H(ω) by substituting the required values in the above equation.
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 60 / 94
FIR Filter Design Band Pass FIR Filter Design
Solution:
H d ( e jω )
1
e −jωτ ω
c1 ≤ |ωc | ≤ ωc2
Hd (ω) =
0 Otherwise
−π −ωc 2 −ωc1 0 ωc 1 ωc 2 π ω
1
Z π
hd (n) = Hd (ω)e jωn dω
2π −π
"Z #
1 −ωc1 Z ωc2
−jωτ jωn −jωτ jωn
= e e dω + e e dω
2π −ωc2 ωc1
"Z #
1 −ωc1 Z ωc2
= e jω(n−τ ) + e jω(n−τ ) dω
2π −ωc2 ωc1
" #−ωc " #ωc
1 e jω(n−τ ) 1
e jω(n−τ ) 2
= +
2π (n − τ ) (n − τ )
−ωc2 ωc1
sinωc2 (n − τ ) − sinωc1 (n − τ )
= for n 6= τ
π(n − τ )
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 61 / 94
FIR Filter Design Band Pass FIR Filter Design
sinωc2 (n − τ ) − sinωc1 (n − τ )
hd (n) =
π(n − τ )
ωc 2 − ωc 1
= for n = τ
π
( sinωc2 (n−τ )−sinωc1 (n−τ )
π(n−τ )
for n 6= τ
hd (n) = ωc2 −ωc1
π
for n = τ for
The length of the filter with given τ is related by
M −1 11 − 1
τ = = =5
2 2
π 3π
and ωc2 = 4
rad/sample ωc = 4
rad/sample
h i h i
3π(n−5) π(n−5)
sin 4
−sin 4
for n 6= 5
hd (n) = π(n−5)
3π − π
4 4
π
for n = 5 for
Design a BPF using Hanning window with M=7. Given that lower cutoff frequency
ωc1 = 2rad/sec and ωc2 = 3rad/sec.
Solution:
−jωτ
e for − ωc2 ≤ ω ≤ −ωc1
jω
Hd (e )= e −jωτ for ωc1 ≤ ω ≤ ωc2
0 for − ωc − ωc1 ω ≤ ωc1
M −1
τ = =3
2
1
Z π
−π −ωc 2 −ωc1 ωc 1 ωc 2 π ω
hd (n) = Hd (e jω )e jωn dω 0
2π −π
Z −ωc1 Z ωc2
1 jω(n−τ )
= [ e dω + e jω(n−τ ) dω
2π −ωc2 ωc1
" #−ωc1 " #ωc1
1 e jω(n−τ ) 1 e jω(n−τ )
= +
2π j(n − τ ) 2π j(n − τ )
−ωc2 ωc2
1
= [sinωc2 (n − τ ) − sinωc1 (n − τ ]
π(n − τ )
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 63 / 94
FIR Filter Design Band Pass FIR Filter Design
τ = M−12
= 7−1
2
=3
ωc1 = 2 rad/sec ωc2 = 3 rad/sec
for n 6= 3
1
hd (n) = [sin3(n − 3) − sin2(n − 3)]
π(n − 3)
n h(n) n h(n)
for n = τ 0 0 4 0
1 0.0189 5 0.0189
1 sinωc2 (n − τ ) sinωc1 (n − τ ) 2 -0.01834 6 -0.01834
hd (n) = lim − lim
π n→τ (n − τ ) n→τ (n − τ ) 3 0.3183
1 1
hd (n) = [ωc2 − ωc1 ] =
π π
The given window function is Hanning window
2πn
ω(n) = 0.5 − 0.5cos 0≤n ≤M −1
M −1
This is rectangular window of length M=11. In this case h(n) = hd (n)ω(n) = hd (n)
for 0 ≤ n ≤ 6
sin3(n − τ ) − sin2(n − τ ) 2πn
h(n) = 0.5 − 0.5cos
π(n − 3) M −1
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 64 / 94
FIR Filter Design Band Pass FIR Filter Design
M−1
X 6
X
H(z) = h(n)z −n = h(n)z −n
n=0 n=0
3
X
|H(e jω )| = h (3) + 2h (3 − n) cosωn
n=1
5
X
= h(3) + 2h (5 − n) cosωn
n=1
= h(3) + 2h(2)cosω + 2h(1)cos2ω + 2h(0)cos3ω
= 0.3183 − 0.3668cosω + 0.0378cos2ω
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 65 / 94
FIR Filter Design Bandstop FIR Filter Design
Design a bandstop filter to reject the frequencies from 2 to 3 rad/sec using rectangular window
with M=5. Find the frequency response.
Solution:
H d ( e jω )
−jωτ
e for − π ≤ ω ≤ −ωc2 1
−jωτ
jω e for − ωc1 ≤ ω ≤ ωc1
Hd (e ) =
e −jωτ for ωc2 ≤ ω ≤ π
0 for ωc1 ≤ |ω| ≤ ωc2 −ωc 2 −ωc1 ωc 1 ωc 2 ω
−π 0 π
1
Z π
hd (n) = Hd (e jω )e jωn dω
2π −π
Z −ωc2 Z ωc1 Z π
1 jω(n−τ )
= [ e dω + e jω(n−τ ) dω + e jω(n−τ ) dω
2π −π −ωc1 ωc2
" #−ωc2 " #ωc1 " #π
1 e jω(n−τ ) 1 e jω(n−τ ) 1 e jω(n−τ )
= + +
2π j(n − τ ) 2π j(n − τ ) 2π j(n − τ )
−π −ωc1 ωc2
1
= [sinωc1 (n − τ ) + sinπ(n − τ − sinωc2 (n − τ ]
π(n − τ )
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 66 / 94
FIR Filter Design Bandstop FIR Filter Design
1
hd (n) = [sin2(n − 2) + sinπ(n − 2) − sin3(n − 2)] for n 6= 2
π(n − 2)
for n = τ
1 sinωc1 (n − τ ) sinπ(n − τ ) sinωc2 (n − τ )
hd (n) = lim + lim − lim
π n→τ (n − τ ) n→τ (n − τ ) n→τ (n − τ )
1 1
hd (n) = [ωc1 + π − ωc2 ] = [π − 1]
π π
The given window function is Rectangular window
ω(n) = 1 0≤n ≤M −1
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 67 / 94
FIR Filter Design Bandstop FIR Filter Design
sin2(0 − 2) + sinπ(0 − 2) − sin3(0 − 2)
n = 0 h(0) = = −0.0759
π(0 − 2)
sin2(1 − 2) + sinπ(1 − 2) − sin3(1 − 2)
n = 1 h(1) = = 0.2445
π(1 − 2)
1
n = 2 h(2) = [π − 1] = 0.6817
π
sin2(3 − 2) + sinπ(3 − 2) − sin3(3 − 2)
n = 3 h(3) = = 0.2445
π(3 − 2)
sin2(4 − 2) + sinπ(4 − 2) − sin3(4 − 2)
n = 4 h(4) = = −0.0759
π(4 − 2)
M−1
X 4
X
H(z) = h(n)z −n = h(n)z −n
n=0 n=0
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 68 / 94
FIR Filter Design Bandstop FIR Filter Design
For M=5
2
X
|H(e jω )| = h (2) + 2h (2 − n) cosωn
n=1
3
X
|H(e jω )| = h (3) + 2h (3 − n) cosωn
n=1
= h(2) + 2h(1)cosω + 2h(0)cos2ω
= 0.6817 + 2(0.2445)cosω + 2h(−0.0759)cos2ω
= 0.6817 + 0.4890cosω − 0.1518cos2ω
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 69 / 94
FIR Filter Design FIR Filter Design Using Kaiser Window
∞
X 1 x k
I0 (x) = 1+
k=1
k! 2
0.25x 2 (0.25x 2 )2 (0.25x 2 )3
= 1+ + + +
(1!)2 (2!)2 (3!)2
α = 0 if A < 21
= 0.5842(A − 21)0.4 + 0.07886(A − 21) if 21 ≤ A ≤ 50 dB
= 0.1102(A − 8.7)) if A > 50 dB
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 70 / 94
FIR Filter Design FIR Filter Design Using Kaiser Window
H (ω ) δ1 Passband ripple
1 + δ1 δ 2 Stopband ripple
A P
1
1 − δ1 Ideal
LPF
A S
Gain
δ2
ωP ωC ωS ω
Passband Transition
Stopband
band
Figure 30: Frequency response of LPF
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 71 / 94
FIR Filter Design FIR Filter Design Using Kaiser Window
where ωc = 12 (ωp + ωs )
2 Chose δ such that the actual passband ripple, Ap is equal to or less than the specified
passband ripple Ãp , and the actual minimum stopband attenuation A is equal or greater
than the specified minimum stop attenuation Ãs
δ = min(δp , δs )
0.05Ãp
10 −1
where δp = and δs = 10−0.05Ãs
100.05Ãp +1
3 The actual stopband attenuation is
A = −20log10 δ
4 The parameter α is
0 for A ≤ 21
α= 0.5842(A − 21)0.4 + 0.07886(Aa − 21) for 21 < A ≤ 50
0.1102(A − 8.7) for A > 50
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 72 / 94
FIR Filter Design FIR Filter Design Using Kaiser Window
M−1
X
H(z) = h(n)z −n
n=0
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 73 / 94
FIR Filter Design FIR Filter Design Using Kaiser Window
Design a lowpass filter with a cutoff frequencies from wc = π4 ∆ω = 0.02π and a stopband
ripple δs = 0.01. Use Kaiser window
Solution:
1 for |ω| ≤ ωc
Hd (e jω ) =
0 for ωc ≤ |ω| ≤ π
A = −20log δs = −20log (0.01) = 40 dB
The inverse transform of the Hd (e jω ) is
1
Z π α = 0.5842(A − 21)0.4 + 0.07886(A − 21)
hd (n) = Hd (e jω )e jωn dω
2π −π = 0.5842(40 − 21)0.4 + 0.07886(40 − 21)
Z ωc
1 = 3.4
= e jωn dω
2π −ωc
ω
1 e jωn c
0.02π
= ∆f = = 0.01
2π jn −ωc 2π
1 h jωc n i
= e − e −jωc n A − 7.95
2jπn M≥ ≥ 223.189 ' 225
14.36∆f
1 e jωc n − e −jωc n
= 225 − 1
πn 2j τ = = 112
sinωc n 2
=
πn
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 74 / 94
FIR Filter Design FIR Filter Design Using Kaiser Window
" r #
2
2n
I0 α 1− M−1
wk (n) = 0≤n ≤M −1
I0 (α)
q
2n 2
I0 3.4 1 − 224
wk (n) = 0≤n ≤M −1
I0 (3.4)
q
2n 2
I0 3.4 1 − 224
1
h(n) = hd × wk (n) = [sinωc n] ×
πn I0 (3.4)
where
0 ∆ω 0.02π
ωc = ωc + = 0.25π + = 0.26π
2 2
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 75 / 94
FIR Filter Design FIR Filter Design Using Kaiser Window
Find an expression for the impulse response h(n) of a linear phase lowpass FIR filter using Kaiser
window to satisfy the following magnitude response specifications for the equivalent analog
filter.
Stopband attenuation: 40 dB
Passband ripple: 0.01 dB
Transition width: 1000 π rad/sec
Ideal cutoff frequency: 2400 π rad/sec
Sampling frequency: 10 KHz
Solution:
x(t ) x ( n) y ( n) y (t )
A/D Filter D/A
A = −20log δs = 40 dB
∆Ω 1000π
log δs = −2 ⇒ δs = 0.01 ∆ω = = = 0.1π rad
fs 10 × 103
20log (1 + δp ) = 0.01
0.1π
∆f = = 0.05
log (1 + δp ) = 0.0005 2π
δp = 0.00115 A − 7.95 58.8 − 7.95
M≥ ≥ = 70.82 ' 71
14.36∆f 14.36 × 0.05
δmin(δp , δs ) = 0.00115
71 − 1
A = −20log (0.00115) = 58.8 dB τ = = 35
2
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 76 / 94
FIR Filter Design FIR Filter Design Using Kaiser Window
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 77 / 94
FIR Filter Design FIR Filter Design Using Kaiser Window
Find an expression for the impulse response h(n) of a linear phase Design a lowpass FIR filter
satisfying the following specifications using Kaiser window
αp ≤ 0.1 dB αs ≥ 44 dB
ωp = 20 rad/sec ωs = 30 rad/sec ωsf = 100 rad/sec
Solution:
1 for |ω| ≤ ωc
Hd (e jω ) =
0 for ωc ≤ |ω| ≤ π
∆ω = ωs − ωp = 10rad/sec
The inverse transform of the Hd (e jω ) is 1
ωc = (ωp + ωs ) = 25rad/sec
Z π 2
1
hd (n) = Hd (e jω )e jωn dω 25 π
2π −π ωc (in discrete and radian) = (2π) = rad
Z ωc 100 2
1
= e jωn dω
2π −ωc δs = 10−0.05As = 10−0.05×44 = 6.3096 × 10−3
ω
1 e jωn c 100.05Ap − 1 100.05×0.1 − 1
= δp = 0.05A
= = 5.7563×10−3
2π jn −ωc 10 p +1 100.05×0.1 + 1
1 h jωc n
δ = min(δp , δs ) = 5.7563 × 10−3
i
= e − e −jωc n
2jπn
sinωc n A = −20log10 (δ) = 44.797dB
=
πn
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 78 / 94
FIR Filter Design FIR Filter Design Using Kaiser Window
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 79 / 94
FIR Filter Design FIR Filter Design Using Kaiser Window
Design a high pass digital satisfying the following specifications using Kaiser window
Passband cut-off frequency fp = 3200Hz Stopband cut-off frequency fs = 1600Hz
Passband ripple αp ≤ 0.1dB Stopband ripple αs ≥ 40dB
Sampling frequency F = 10000Hz
Solution:
0 for |ω| ≤ ωc
Hd (e jω ) =
1 for ωc ≤ |ω| ≤ π
∆ω = ωp − ωs = 3200π rad/sec
The inverse transform of the Hd (e jω ) is
1
ωc = (ωp + ωs ) = 4800π rad/sec
1
Z −ωc Z π 2
hd (n) = e jωn dω + e jωn dω
2π −π ωc 4800
ωc (discrete, radian) = (2π) = 0.48πrad
" −ωc π # 20000
e jωn e jωn
1
= +
2π jn −π jn ωc δs = 10−0.05As = 10−0.05×40 = 0.01
1 h i
= e −jωc n − e −jπn + e jπn − e jωc n
2jπn
sinπn − sinωc n 100.05Ap −1 100.05×0.1−1
= δp = = = 0.005756
πn 100.05A p +1 100.05×0.1+1
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 81 / 94
Design of FIR system Frequency Sampling for FIR Filters
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 82 / 94
Design of FIR system Frequency Sampling for FIR Filters
In this method a set of M equally spaced
samples in the interval (0, 2π)are taken in
the desired frequency response Hd (ω).
The continuous frequency ω is replaced by
2π
ω = ωk = k k = 0, 1, . . . M − 1
M
2π k 2π k
| H d (ω ) | ωk = =
M 17
K=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 83 / 94
Design of FIR system Frequency Sampling for FIR Filters
For the FIR filter to be realizable the coefficients h(n) must be real. This is possible if all
complex terms appear in complex conjugate pairs. Consider the term
H(M − k)e j2πn(M−k)/M
H(M − k) = H ∗ (k)
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 84 / 94
Design of FIR system Frequency Sampling for FIR Filters
P
!
1 X h i
h(n) = H(0) + 2 Re H(k)e j2πkn/M
M k=1
where P is M−1
2
if M is odd
P= M
2
− 1 if M is even
M−1
X
H(ω) = h(n)e −jωn
n=0
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 85 / 94
Design of FIR system Frequency Sampling for FIR Filters
Design a lowpass FIR filter using frequency sampling technique having cut-off frequency of π/2
rad/sample. The filter should have linear phase and length of 17.
Solution:
The Ideal LPF frequency response Hd (ω)
for the linear phase is
2π k 2π k
ωk = =
(
−jω M−1 | H d (ω ) |
Hd (ω) = e 2 0 ≤ ω ≤ π2 K=0 1 2 3 4 5 6 7 8
M
9
17
10 11 12 13 14 15 16 17
π
0 2
≤ω≤π
ω
e −j8ω 0 ≤ ω ≤ π2 8π π 30π
4π π 20π 3π 2π
Hd (ω) = π 17 2 17
0 2
≤ω≤π 17 17 2
θ (ω )
2πk 2πk
To sample put ω = M
= 17 ω
16π (k − 17)
θk = −
16π k 17
( 2πk θ k = −8ωk = −
e −j 17
8
0 ≤ 2πk ≤ π2 17
Hd (ω) = π
17
2πk
0 2
≤ 17
≤ π
The range of k is
2πk
17
= π2 k = 17 4
'4
2πk 17
= π k = ' 8
( 16πk
e −j 17 0 ≤ k ≤ 17 17 2
Hd (ω) = 17
4
0 4
≤ k ≤ 17
2
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 86 / 94
Design of FIR system Frequency Sampling for FIR Filters
The range of k is 0 ≤ k ≤ 17 8
!
4 1 X h
j2πkn/17
i
k is an integer. = 1+2 Re H(k)e
Hence the range is 0 ≤ k ≤ 4 17 k=1
Similarly 17
4
≤ k ≤ 17
2
= 4.25 ≤ k ≤ 8.5
The range 5 ≤ k ≤ 8 |H(k)| = 1 0≤k≤4
1 0≤k≤4
4
!
|H(k)| = 0 5≤k≤8 1 X h 16πk
i
1 13 ≤ k ≤ 16 h(n) = 1+2 Re e −j 17 e j2πkn/17
17 k=1
4
!
1 X h i
= 1+2 Re e j2πk(n−8)/17
17 k=1
4 !
1 X 2πk(n − 8)
= 1+2 cos
17 k=1
17
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 87 / 94
Design of FIR system Frequency Sampling for FIR Filters
Determine the impulse response h(n) of a filter having desired frequency response
(M−1)ω
(
−j
Hd (w ) = e 2 0 ≤ |ω| ≤ π2
π
0 2
≤ω≤π
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 88 / 94
Design of FIR system Frequency Sampling for FIR Filters
The value of h(n)is given by
The range of k is 0 ≤ k ≤ 74
M−1
2
k is an integer. 1 X h i
h(n) = H(0) + 2 Re H(k)e j2πkn/M
Hence the range is 0 ≤ k ≤ 1 M k=1
Similarly 74 ≤ k ≤ 72 = 1.75 ≤ k ≤ 3.5
The range 2 ≤ k ≤ 3 3
!
1 X h i
= 1+2 Re H(k)e j2πkn/7
1 0≤k≤1 7 k=1
|H(k)| = 0 2≤k≤3
1 k=6
|H(k)| = 1 0≤k≤1
1
!
n h(n) n h(n) 1 X h 6πk
i
h(n) = 1+2 Re e −j 7 e j2πkn/7
0 -0.1146 4 321 7 k=1
1 0.0793 5 0.0793 1
!
2 0.321 6 -0.1146 1 X h
j2πk(n−3)/7
i
= 1+2 Re e
3 0.4283 7 k=1
1 !
1 X 2πk(n − 3)
= 1+2 cos
7 k=1
7
Determine the filter coefficients h(n) obtained by frequency sampling Hd (w ) given by
(
e −j3ω 0 ≤ |ω| ≤ π
2
Hd (w ) = π ≤ ω ≤ π
0 2
Also obtain the frequency response H(w ). Take N=7. DEC 2011
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 89 / 94
Design of FIR system Frequency Sampling for FIR Filters
Solution:
2π k 2π k
ωk = =
1 0≤k≤3 | H d (ω ) | M 15
|H(k)| = 0 4 ≤ k ≤ 11 K=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
1 12 ≤ k ≤ 14
ω
4π 6π π π 18π 3π 28π
2π
15 15 2 15 2 15
14 θ (ω )
− 15 πk 0≤k≤7
θ(k) = ω
14π − 1415
πk = − 14
15
π(k − 15) 8 ≤ k ≤ 14
14π (k − 15)
θk = −
14π k 15
θ k = −7ωk = −
15
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 90 / 94
Design of FIR system Frequency Sampling for FIR Filters
7
! n h(n) n h(n)
1 X h
j2πkn/7
i
0 -0.05 8 0.3188
= 1+2 Re H(k)e
15 k=1
1 0.041 9 0.034
2 0.066 10 -0.108
3 -0.036 11 -0.036
|H(k)| = 1 0≤k≤3 4 -0.108 12 0.066
5 0.034 13 0.041
3
!
1 X h 17πk
i 6 0.3188 14 -0.05
h(n) = 1+2 Re e −j 15 e j2πkn/15 7 0.466
715 k=1
3
!
1 X h i
= 1+2 Re e j2πk(n−7)/15
15 k=1
3 !
1 X 2πk(n − 7)
= 1+2 cos
15 k=1
15
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 91 / 94
Design of FIR system Frequency Sampling for FIR Filters
Solution:
1 0≤k≤3
2π k 2π k
ωk = =
0.4 k = 4 | H d (ω ) |
M 15
|H(k)| = 0 5 ≤ k ≤ 10 K=0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
0.4 k = 11
0.4
0.4
1 12 ≤ k ≤ 14 ω
4π 6π π π 18π 3π 28π
2π
15 15 2 15 2 15
θ (ω )
14 ω
− 15 πk 0≤k≤7
θ(k) = 14
− 15 π(k − 15) 8 ≤ k ≤ 14 14π (k − 15)
θk = −
14π k 15
θ k = −7ωk = −
15
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 92 / 94
Design of FIR system Frequency Sampling for FIR Filters
7
!
1 X h i n h(n) n h(n)
j2πkn/7
= 1+2 Re H(k)e 0 -0.0143 8 0.313
15 k=1 1 -0.002 9 -0.0181
2 0.04 10 -0.091
|H(k)| = 1 0 ≤ k ≤ 3 3 0.0122 11 0.0122
|H(k)| = 0.4 k = 4&11 4 -0.091 12 0.04
5 -0.0181 13 -0.002
3
! 6 0.313 14 -0.0143
1 X h 17πk
i
7 0.520
h(n) = 1+2 Re e −j 15 e j2πkn/15
715 k=1
3
!
1 X h
j2πk(n−7)/15
i h
j2π4(n−7)/15
i
= 1+2 Re e + 2Re 0.4e
15 k=1
3 !
1 X 2πk(n − 7) 8π(n − 7)
= 1+2 cos + 0.8cos
15 k=1
15 15
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 93 / 94
References
Dr. Manjunatha. P (JNNCE) UNIT - 7: FIR Filter Design October 25, 2016 94 / 94
UNIT - 8: Implementation of Discrete-time
Systems[?, ?, ?, ?]
Dr. Manjunatha. P
[email protected]
Professor
Dept. of ECE
PART - B
Linearity: x2 (n)
System
y2 ( n)
Figure 1: Linearity
Time invariance: A system is said to be time invariant if its behavior and characteristics does
not change with time.
If input x(n) produces response y (n) then if x(n − n0 ) produces response y (n − n0 ), then the
system is called as time invariant
Causality: A system is causal if the output depends only on present and past, but not future
inputs. All memoryless systems are causal.
Some of the examples for such analog systems are Oscillator, regulated power supply.,,
Dr. Manjunatha. P (JNNCE) UNIT - 8: Implementation of Discrete-time Systems[?, ?, ?,
October
?] 18, 2016 4 / 151
Realization of FIR system Realization of FIR system
Digital filters are discrete Linear Time Invariant (LTI) systems and described by difference
equations and are implemented in hardware or software.
The discrete time sytems can be of finite impulse response (FIR) or infinite impulse
response IIR type.
A FIR filter is a filter whose impulse response is of finite duration, because it settles to
zero in finite time, because there is no feedback in the FIR system.
The basic components of discrete-time system are, delay element, multiplier, and adder. The
details of these components and their symbols with its input output relationship is as shown in
Figure 2.
x ( n) y (n) = x (n − 1)
Z −1
Delay Element
x ( n) y (n) = ax(n)
a
Multiplier
x1 (n)
y (n) = x1 (n) + x2 (n)
x2 (n)
+
Adder
where x is the input signal, y is the output signal ak and bk are called the coefficients.
The second term in this equation is usually termed as feedback for the system. This is the
equation used to represent Infinite Impulse Response (IIR) system.
If the feedback term is absent then this equation is used to represent Finite Impulse
Response (FIR) system.
XM
y (n) = bk x(n − k)
k=0
N M
" #
X X
Y (z) 1 + ak z −k = bk z −k X (z)
k=1 k=0
M
−k
P
bk z
k=0
H(z) =
N
ak z −k
P
1+
k=1
An FIR system does not have feedback. Hence y (n − k) term is absent in the system. FIR
output is expressed as
M
X
y (n) = bk x(n − k)
k=0
x ( n)
Z-1 Z-1 Z-1 Z-1
h(M-1)
h(0) h(1) h(2) h(M-2)
h( M − 1) x(n − M + 1)
h(1) x( n − 1) h(2) x( n − 2)
x(n)h(0)
+ + x(n)h(0) + + + M −1
x(n)h(0)
+ h(1) x(n − 1) y ( n) = ∑ h( k ) x( n − k )
+ h(1) x(n − 1) k =0
+ h(2) x(n − 2)
Realize a direct form FIR filter for the following impulse response.
1 1 1
h(n) = δ(n) + δ(n − 1) − δ(n − 2) + δ(n − 4) + δ(n − 3)
2 4 2
1 −1 1 1
H(z) = 1 + z − z −2 + z −3 + z −4
2 4 2
1 1 1
Y (z) = X (z)H(z) = 1 + z −1 − z −2 + z −3 + z −4 X (z)
2 4 2
1 −1 1 −2 1 −3
= X (z) + z X (z) − z X (z) + z X (z) + z −4 X (z)
2 4 2
1 1 1
y (n) = x(n) + x(n − 1) − x(n − 2) + x(n − 3) + x(n − 4)
2 4 2
x ( n) x( n − 1) x(n − 2) x( n − 3) x(n − 4)
Z-1 Z-1 Z-1 Z-1
h(0) = 1 1 −1 1 h(4) = 1
h(1) = h(2) = h(3) =
2 4 2
y(n)
+ + + +
DEC-2010 EE
Realize the system function H(z) = 1 + 32 z −1 + 54 z −2 + 95 z −3 + 19 z −4 using direct form II
Solution:
3 4 5 1
H(z) = 1 + z −1 + z −2 + z −3 + z −4
2 5 9 9
3 4 5 1
Y (z) = X (z)H(z) = 1 + z −1 + z −2 + z −3 + z −4 X (z)
2 5 9 9
3 −1 4 −2 5 −3 1
= X (z) + z X (z) + z X (z) + z X (z) + z −4 X (z)
2 5 9 9
3 4 5 1
y (n) = x(n) + x(n − 1) + x(n − 2) + x(n − 3) + x(n − 4)
2 5 9 9
x ( n)
Z-1 Z-1 Z-1 Z-1
h(0) = 1 3 4 5 1
h(1) = h(2) = h(3) = h(4) =
2 5 9 9
y(n)
+ + + +
June 2012 EC
A FIR filter is given by y (n) = x[n] + 25 x[n − 1] + 34 x[n − 2] + 13 x[n − 3] draw the direct form.
Solution:
x ( n)
Z-1 Z-1 Z-1
h(0) = 1 2 3 1
h(1) = h(2) = h(3) =
5 4 3
y(n)
+ + +
Determine a direct form realization for the following linear phase filters
h(n) = [1, 2, 3, 4, 3, 2, 1]
Solution:
H(z) = 1 + 2z −1 + 3z −2 + 4z −3 + 3z −4 + 2z −5 + 1z −6 ]
X (z)H(z) = 1 + 2z −1 + 3z −2 + 4z −3 + 3z −4 + 2z −5 + 1z −6 X (z)
Y (z) =
= X (z) + 2z −1 X (z) + 3z −2 X (z) + 4z −3 X (z) + 3z −4 X (z) + 2z −5 X (z) + 1z −6 X (z)
y (n) = x(n) + 2x(n − 1) + 3x(n − 2) + 4x(n − 3) + 3x(n − 4) + 2x(n − 5) + 1x(n − 6)
x ( n)
Z-1 Z-1 Z-1 Z-1 Z-1 Z-1
y(n)
+ + + + + +
Determine a direct form realization for the following linear phase filters
h(n) = [1, 2, 3, 3, 2, 1]
Solution:
H(z) = 1 + 2z −1 + 3z −2 + 3z −3 + 2z −4 + 1z −5 ]
X (z)H(z) = 1 + 2z −1 + 3z −2 + 3z −3 + 2z −4 + 1z −5 X (z)
Y (z) =
= X (z) + 2z −1 X (z) + 3z −2 X (z) + 3z −3 X (z) + 2z −4 X (z) + 1z −5 X (z)
y (n) = x(n) + 2x(n − 1) + 3x(n − 2) + 3x(n − 3) + 2x(n − 4) + 1x(n − 5)+
x ( n)
Z-1 Z-1 Z-1 Z-1 Z-1
y(n)
+ + + + +
For the following FIR filter system function sketch a direct form
Solution:
x ( n)
Z-1 Z-1 Z-1 Z-1
y(n)
+ + + +
Realize direct form FIR filter with impulse response h(n) is given
h(n) = 4δ(n) + 5δ(n − 1) + 6δ(n − 2) + 7δ(n − 3). With input x(n) = [1, 2, 3] calculate output
y (n)
Solution:
h(n) = 4δ(n) + 5δ(n − 1) + 6δ(n − 2) + 7δ(n − 3)
H(z) = 4 + 5z −1 + 6z −2 + 7z −3
X (z)H(z) = 4 + 5z −1 + 6z −2 + 7z −3 X (z)
Y (z) =
= 4X (z) + 5z −1 X (z) + 6z −2 X (z) + 7z −3 X (z)
y (n) = 4x(n) + 5x(n − 1) + 6x(n − 2) + 7x(n − 3)
x ( n)
3
2 x ( n) x( n − 1) x(n − 2) x(n − 3)
Z-1 Z-1 Z-1
June 2015 Obtain the direct form realization of linear phase FIR system given by
2 −1 15 −2
H(z) = 1 + z + z
3 8
Solution:
x ( n)
Z-1 Z-1
h(0) = 1 2 15
h(1) = h(2) =
3 8
y(n)
+ +
-2 -1 0 1 2 3 4
-2 -1 0 1 2 3 4
(usually delayed) by the same
constant amount, which is
referred to as the phase delay. 0 1 2 3 4 5 6 7 8 n 0 1 2 3 4 5 6 7 8 n
-2 -1 0 1 2 3 4
symmetric impulse response.
The FIR filter has linear phase if
0 1 2 3 4 5 6 7 8 n 0 1 2 3 4 5 6 7 8 n
its unit sample response satisfies
the following condition: Center of Symmetry
Center of Symmetry
M/2−1
Y (z) X h i
= h(n) z −n + z −(M−1−n)
X (z) n=0
M/2−1 h i
X
Y (z) = h(n) z −n + z −(M−1−n) X (z)
n=0
x( n) x( n − 1) x(n − 2) x(n − 3)
Z-1 Z-1 Z-1
Z-1
+ + + +
Y (z)
H(z) =
X (z)
(M−3)/2
Y (z) M −1 − M−1 X h i
=h z 2 + h(n) z −n + z −(M−1−n)
X (z) 2 n=0
(M−3)/2
M −1 − M−1 X h i
Y (z) = h z 2 X (z) + h(n) z −n + z −(M−1−n) X (z)
2 n=0
for M=9
x ( n) x( n − 1) x(n − 2) x( n − 3) x(n − 4)
Z-1 Z-1 Z-1 Z-1
+ + + +
Realize a linear phase FIR filter with the following impulse response. Give necessary equations
h(n) = δ(n) + 12 δ(n − 1) − 41 δ(n − 2) + δ(n − 4) + 12 δ(n − 3)
Solution: h(n) = {1, 21 , −1/4, 12 , 1}. Here M=5 h(0) = h(4), h(1) = h(3)
1 1 1
h(n) = δ(n) + δ(n − 1) − δ(n − 2) + δ(n − 3) + δ(n − 4)
2 4 2
1 1 1
H(z) = 1 + z −1 − z −2 + z −3 + z −4
2 4 2
1 1 1
Y (z) = X (z)H(z) = 1 + z −1 − z −2 + z −3 + z −4 X (z)
2 4 2
1 −1 1 −2 1 −3
Y (z) = X (z) + z X (z) − z X (z) + z X (z) + z −4 X (z)
2 4 2
1 1 1
y (n) = x(n) + x(n − 1) − x(n − 2) + x(n − 3) + x(n − 4)
2 4 2
1 1
y (n) = [x(n) + x(n − 4)] + [x(n − 1) + x(n − 3)] − x(n − 2)
2 4
x ( n) x( n − 1) x(n − 2)
Z-1 Z-1
+ +
Z-1 Z-1
x(n − 4) x(n − 3)
h(0)=1 h(1)=1/2 h(3)=-1/4
y ( n)
+ +
DEC 2010,2011, 2012 Realize a linear phase FIR filter having the following impulse response
h(n) = δ(n) + 14 δ(n − 1) − 81 δ(n − 2) + 14 δ(n − 3) + δ(n − 4)
Solution: h(n) = {1, 14 , −1/8, + 14 , 1}. Here M=5 h(0) = h(4), h(1) = h(3)
1 1 1
h(n) = δ(n) + δ(n − 1) − δ(n − 2) + δ(n − 3) + δ(n − 4)
4 8 4
1 1 1
H(z) = 1 + z −1 − z −2 + z −3 + z −4
4 8 4
1 1 1
Y (z) = X (z)H(z) = 1 + z −1 − z −2 + z −3 + z −4 X (z)
4 8 4
1 −1 1 −2 1 −3
Y (z) = X (z) + z X (z) − z X (z) + z X (z) + z −4 X (z)
4 8 4
1 1 1
y (n) = x(n) + x(n − 1) − x(n − 2) + x(n − 3) + x(n − 4)
4 8 4
1 1
y (n) = [x(n) + x(n − 4)] + [x(n − 1) + x(n − 3)] − x(n − 2)
4 8
x ( n) x( n − 1) x(n − 2)
Z-1 Z-1
+ +
Z-1 Z-1
x(n − 4) x(n − 3)
1 1
1 −
4 8
y ( n)
+ +
Dr. Manjunatha. P (JNNCE) UNIT - 8: Implementation of Discrete-time Systems[?, ?,October
?, ?] 18, 2016 25 / 151
Realization of FIR system Linear Phase FIR structure
May 2010 Realize a linear phase FIR filter having the following impulse response
h(n) = δ(n) − 14 δ(n − 1) + 21 δ(n − 2) + 12 δ(n − 3) − 14 δ(n − 4) + δ(n − 5)
Solution: h(n) = {1, − 41 , 12 , 12 , − 14 , 1}. Here M=6 h(0) = h(5), h(1) = h(4), h(2) = h(3)
1 1 1 1
h(n) = δ(n) − δ(n − 1) + δ(n − 2) + δ(n − 3) − δ(n − 4) + δ(n − 5)
4 2 2 4
1 1 1 1
H(z) = 1 − z −1 + z −2 + z −3 − z −4 + z −5
4 2 2 4
1 1 1 1
Y (z) = X (z)H(z) = 1 − z −1 + z −2 + z −3 − z −4 + z −5 X (z)
4 2 2 4
1 −1 1 −2 1 −3 1
Y (z) = X (z) − z X (z) + z X (z) + z X (z) − z −4 X (z) + z −5 X (z)
4 2 2 4
1 1 1 1
y (n) = x(n) − x(n − 1) + x(n − 2) + x(n − 3) − x(n − 4) + x(n − 5)
4 2 2 4
1 1
y (n) = [x(n) + x(n − 5)] − [x(n − 1) + x(n − 4)] + [x(n − 2) + x(n − 3)]
4 2
x ( n) x(n − 1) x(n − 2)
Z-1 Z-1
+ + + Z-1
-1 -1
Z Z
x( n − 5) x(n − 4) x(n − 3)
1 1 1
− 2
4
y ( n)
+ + +
May 2010
Obtain the direct form Realization of linear phase FIR system given by
H(z) = 1 + 23 z −1 + 15
8
z −2 + 32 z −3 + z −4
Solution: h(n) = {1, 3 , 15/8, 23 , 1}. Here M=5 h(0) = h(4), h(1) = h(3)
2
2 −1 15 −2 2
H(z) = 1+ z + z + z −3 + z −4
3 8 3
2 15 −2 2
Y (z) = X (z)H(z) = 1 + z −1 + z + z −3 + z −4 X (z)
3 8 3
2 −1 15 −2 2 −3
Y (z) = X (z) + z X (z) + z X (z) + z X (z) + z −4 X (z)
3 8 3
2 15 2
y (n) = x(n) + x(n − 1) + x(n − 2) + x(n − 3) + x(n − 4)
3 8 3
2 15
y (n) = [x(n) + x(n − 4)] + [x(n − 1) + x(n − 3)] + x(n − 2)
3 8
x ( n) x( n − 1) x(n − 2)
Z-1 Z-1
+ +
Z-1 Z-1
x(n − 4) x(n − 3)
2 15
1
3 8
y ( n)
+ +
Dr. Manjunatha. P (JNNCE) UNIT - 8: Implementation of Discrete-time Systems[?, ?,October
?, ?] 18, 2016 27 / 151
Realization of FIR system Linear Phase FIR structure
Solution:
2
H(z) = 1 + (z + z −1 )
3
2
Y (z) = X (z)H(z) = 1 + (z + z −1 ) X (z)
3
2
Y (z) = X (z) + (z + z −1 )X (z)
3
2
y (n) = x(n) + [x(n − 1) + x(n + 1)]
3
x ( n)
+ y ( n)
2
x( n + 1) 3
Z +
Z-1
x( n − 1)
Solution:
1 −1
H(z) = 1 + (z + z −2 ) + z −3
4
1
Y (z) = X (z)H(z) = 1 + (z −1 + z −2 ) + z −3 X (z)
4
1 −1
= X (z) + (z X (z) + z −2 X (z)) + z −3 X (z)
4
1
y (n) = [x(n) + x(n − 3)] + [x(n − 1) + x(n − 2)]
4
x( n) x( n − 1)
Z-1
Z-1
+ +
Z-1
x(n − 3) x( n − 2)
h(0)=1 1
h(1) =
4
y ( n)
+
Realize the following system function by linear phase FIR structure: h(n) = [1, 2, 3, 4, 3, 2, 1]
Solution:
H(z) = 1 + 2z −1 + 3z −2 + 4z −3 + 3z −4 + 2z −5 + 1z −6
X (z)H(z) = 1 + 2z −1 + 3z −2 + 4z −3 + 3z −4 + 2z −5 + 1z −6 X (z)
Y (z) =
= X (z) + 2z −1 X (z) + 3z −2 X (z) + 4z −3 X (z) + 3z −4 X (z) + 2z −5 X (z) + 1z −6 X (z)
y (n) = x(n) + 2x(n − 1) + 3x(n − 2) + 4x(n − 3) + 3x(n − 4) + 2x(n − 5) + 1x(n − 6)
y (n) = 1[x(n) + x(n − 6)] + 2[x(n − 1) + x(n − 5)] + 3[x(n − 2) + x(n − 4)] + 4x(n − 3)
x ( n) x( n − 1) x(n − 2) x( n − 3)
Z-1 Z-1 Z-1
+ + +
y ( n)
+ + +
h(n) = [1, 2, 3, 3, 2, 1]
Solution:
H(z) = 1 + 2z −1 + 3z −2 + 3z −3 + 2z −4 + 1z −5 ]
X (z)H(z) = 1 + 2z −1 + 3z −2 + 3z −3 + 2z −4 + 1z −5 X (z)
Y (z) =
= X (z) + 2z −1 X (z) + 3z −2 X (z) + 3z −3 X (z) + 2z −4 X (z) + 1z −5 X (z)
y (n) = x(n) + 2x(n − 1) + 3x(n − 2) + 3x(n − 3) + 2x(n − 4) + 1x(n − 5)
y (n) = 1[x(n) + x(n − 5)] + 2[x(n − 1) + x(n − 4)] + 3[x(n − 2) + x(n − 3)]
x ( n) x(n − 1) x(n − 2)
Z-1 Z-1
Z-1
+ + +
Z-1 Z-1
x( n − 5) x(n − 4) x(n − 3)
1 2 3
y ( n)
+ + +
Frequency sampling realization is used when an FIR filter is to operate on some desired
frequency.
The desired frequency may be defined and this reduces the complexity of the system.
Consider a frequency ω
2π
ωk = k k = 0, 1, . . . M − 1
M
2π
H(ω) at ω= ωk = M
k
M−1
2π X
H(ωk ) = H k = h(n)e −j2πkn/M
M n=0
z transform is defined as
M−1
X
H(z) = h(n)z −n
n=0
N
X 1 − aN+1
an =
n=0
1−a
M−1 M
X 1 1 − e j2πk/M z −1
H(z) = H(k)
k=0
M 1 − e j2πk/M z −1
M−1
X 1 1 − e j2πk z −M
= H(k)
k=0
M 1 − e j2πk/M z −1
M−1
X 1 1 − z −M
H(z) = H(k)
k=0
M 1 − e j2πk/M z −1
M−1
1 − z −M X H(k)
H(z) =
M k=0
1 − e j2πk/M z −1
where
1 − z −M
H1 (z) =
M
M−1
X H(k)
H2 (z) =
k=0
1 − e j2πk/M z −1
H1 (z) and H2 (z) are realized independently. H(z) is obtained by multiplication of H1 (z)
and H2 (z).
Dr. Manjunatha. P (JNNCE) UNIT - 8: Implementation of Discrete-time Systems[?, ?,October
?, ?] 18, 2016 36 / 151
Realization of FIR system Frequency Sampling for FIR Systems
M−1
1 − z −M X H(k)
H(z) = j2πk/M z −1
M k=0
1 − e
Realization
of H2(z)
+ +
H(0)
Z-1
Realization
1
of H1(z)
+ +
H(1)
1
x ( n) M Z-1
+ e j 2π / M
-
Z-M + +
H(2)
Z-1
e j 4π / M
+ + y ( n)
H(M-1)
-1
Z
e j 2π ( M −1)/ M
Solution:
h(0) = 1, h(1) = 2, h(2) = 1 The DFT of h(n)
M−1
X
H(k) = h(n)e −j2πkn/M
n=0
With M=3
2
X
H(k) = h(n)e −j2πkn/3
n=0
2
X
H(k) = h(n)e −j2πkn/3
n=0
H(0) = 1+2+1=4
H(1) = 1 + 2e −j2π/3 + e −j4π/3 = −0.5 − j0.866 = e −j2π/3
H(2) = 1 + 2e −j4π/3 + e −j8π/3 = −0.5 − j0.866 = e −j2π/3
For M=3
2
1 − z −3 X H(k)
H(z) = 2πk/3 z −1
3 k=0
1 − e
1−z −3
H(0) H(1) H(2)
= −1
+ −j2π/3 −1
+ −j4π/3 −1
3 1−z 1−e z 1−e z
= H1 (z) × H2 (z)
where
1 − z −3
H1 (z) =
3
" #
4 e −j2π/3 e −j4π/3
H2 (z) = + +
1 − z −1 1 − e −j2π/3 z −1 1 − e −j4π/3 z −1
+ +
4
Z-1
1 1
x ( n) 3 y ( n)
+ + +
e − j 2π /3
Z-3 Z-1
j 2π /3
e
+ +
e − j 4π /3
Z-1
j 4π /3
e
An Infinite Impulse Response (IIR) filters are digital filters with infinite impulse response.
Unlike FIR filters, they have the feedback (a recursive part of a filter) and are known as
recursive digital filters therefore.
IIR filters are computationally more efficient than FIR filters as they require fewer
coefficients due to the fact that they use feedback.
If the coefficients deviate from their true values then the feedback can make the filter
unstable.
N M
X X The general expression of an IIR
y (n) = − ak y (n − k) + bk x(n − k) filter can be expressed as follows:
k=1 k=0
M
−k
P
bk z
By taking z-transform on both sides k=0
H(z) =
N
ak z −k
P
N
X M
X 1+
Y (z) = − ak z −k Y (z) + bk z −k X (z) k=1
k=1 k=0
M
X
" N
# M
H1 (z) = bk z −k
X X
−k −k k=0
Y (z) 1 + ak z = bk z X (z)
k=1 k=0 1
H2 (z) =
N
ak z −k
P
The system function H(z) is defined as 1+
k=1
M
P
bk z −k H(z) = H1 (z).H2 (z)
Y (z) k=0
H(z) = =
X (z) N
ak z −k
P
1+
k=1
M
X
H1 (z) = bk z −k y1 (n)
x ( n) b0
k=0 +
= b0 + b1 z −1 + . . . bM z −M
Z-1
b1
H1 (z) is defined as +
Y1 (z) Z-1
H1 (z) =
X1 (z) b2
+
−1 −M
Y1 (z) = b0 X1 (z)+b1 z X1 (z)+. . . bM z X1 (z)
Z-1
bM
Its inverse z transform is
1 y2 ( n)
H2 (z) = x2 ( n)
N +
z −k
P
1+ ak
k=1
Z-1
-a1
+
H2 (z) is also expressed in terms of system function
Z-1
Y2 (z) 1 -a2
H2 (z) = =
X2 (z) N +
ak z −k
P
1+
k=1
N
X
Y2 (z)[1 + ak z −k ] = X2 (z)
k=1 Z-1
-aN
N
X
Y2 (z) = − ak z −k Y2 (z) + X2 (z)
k=1
Expanding the above function
Z-1 Z-1
b1 -a1
+ +
Z-1 Z-1
b2 -a2
+ +
-1
Z Z-1
b3 -a3
+ +
bM-1 -aN-1
+ +
Z-1 Z-1
bM -aN
N
X
W (z)[1 + ak z −k ] = X (z)
k=1
N
X
W (z) = X (z) − ak z −k W (z)
k=1
M
Y (z) X
H2 (z) = = bk z −k
W (z) k=0
M
X
Y (z) = bk z −k W (z)
k=0
By inverse z transform
y (n) = b0 w (n) + b1 w (n − 1) + b2 w (n − 2) + . . . + bM w (n − M)
w( n ) b0 y ( n)
x ( n) w( n ) +
+
Z-1
Z-1 b1
-a1 +
+
Z-1
Z-1 b2
-a2 +
+
Z-1
-aN Z-1
bM
x ( n) W ( z) w(n) Y ( z) y ( n)
H1 ( z ) = H 2 (z) =
X ( z) W ( z)
x( n) w( n ) b0 y ( n) x( n) w( n ) b0 y ( n)
+ + + +
-aN-1 bM-1
+ + -aN-1 bM-1
+ +
Z-1 Z-1
-aN bM
Z-1
-aN bM
All zero system All pole system
Figure 14: Direct form-II Structure Figure 15: Direct form-II Structure
3 1 1
y (n) − y (n − 1) + y (n − 2) = x(n) + x(n − 1)
4 8 2
Solution:
3 1 1
y (n) = y (n − 1) − y (n − 2) + x(n) + x(n − 1)
4 8 2
1 y ( n) x ( n) w( n ) 1 y ( n)
x ( n)
+ + + +
3 Z-1
Z-1 3 Z-1 1
0.5 4
4 2
+ + +
1 Z-1
− 1 Z-1
8 −
8
[July 2013]:
y (n) = −0.1y (n − 1) + 0.2y (n − 2) + 3x(n) + 3.6x(n − 1) + 0.6x(n − 2)obtain the the direct
form I and direct form II structures
Solution:
x ( n) 3 y (n)x(n) w( n ) 3 y ( n)
+ + + +
June 2010 EC
Obtain direct form I and direct form II for the system described by
Solution:
y (n) = −0.1y (n − 1) + 0.72y (n − 2) + 0.7x(n) − 0.252x(n − 2)
x ( n) 0.7 y ( n) x ( n) w( n ) 0.7 y ( n)
+ + + +
4z 2
H(z) = 3 + 1
− 1
z− 2
z− 4
4z 2 4z 2
H(z) = 3+ 1
− 1
=3+ −
z− 2
z− 4
z − 0.5 z − 0.25
7z 2 − 5.25z + 1.375
=
z 2 − 0.75z + 0.125
(i): By observing the system function it has numerator of polynomial of order 2 as well as
denominator of polynomial of order 2. The system function has poles as well zeros, hence it
represents IIR filter.
x ( n) 7 y ( n)
+ +
Z-1 Z-1
-5.25
0.75
+ +
Z-1 Z-1
1.375 -1.25
1
H(z) = H1 (z).H2 (z) = [7 − 5.25z −1 + 1.375z −2 ]
1 − 0.75z −1 + 0.125z −2
W (z) 1
H1 (z) = =
X (z) 1 − 0.75z −1 + 0.125z −2
x( n) w( n )
+
W (z)[1 − 0.75z −1 + 0.125z −2 ] = X (z)
Z-1
0.75
+
W (z) = X (z)+0.75z −1 W (z)−0.125z −2 W (z)
Taking inverse z transform Z-1
-1.25
Y (z)
H2 (z) = = 7 − 5.25z −1 + 1.375z −2
W (z) w( n ) 7 y ( n)
+
Y (z) Z-1
= 7 − 5.25z −1 + 1.375z −2 -5.25
W (z)
+
Y (z) = 7W (z) − 5.25z −1 W (z) + 1.375z −2 W (z)
Z-1
Taking inverse z transform 1.375
x( n) w( n ) 7 y ( n) x( n) w( n ) 7 y ( n)
+ + + +
Figure 24: Realization of H(z) = H1 (z).H2 (z) Figure 25: Direct form-II, canonic form
(z − 1)(z 2 + 5z + 6)(z − 3)
H(z) =
(z 2 + 6z + 5)(z 2 − 6z + 8)
x ( n) w( n ) y ( n)
+ +
Solution:
Z-1
(z − 1)(z 2 + 5z + 6)(z − 3) 1
H(z) = +
(z 2 + 6z + 5)(z 2 − 6z + 8)
(z 2 − 4z + 3)(z 2
+ 5z + 6) Z-1
= 23
(z 2 + 6z + 5) + (z 2 − 6z + 8) -11
+ +
z 4 + z 3 − 11z 2 − 9z + 18
=
z 4 − 23z 2 + 18z + 40 Z-1
1 + z −1 − 11z −2 − 9z −3 + 18z −4 −18 -9
= + +
1 − 23z −2 + 18z −3 + 40z −4 -1
Z
−40 18
2011 July
Obtain the direct form II realizations of the following system.
(1 + z −1 )
H(z) = 1 −1
(1 − 4
z )(1 − z −1 + 12 z −2 )
Solution:
(1 + z −1 )
H(z) = 5 −1
(1 − 4
z + 34 z −2 − 18 z −3 )
1 (1 + z −1 )
= 5 −1 3 −2 1 −3
× = H1 (z) × H2 (z)
(1 − 4
z + 4
z − 8
z ) 1
W (z) 1
H1 (z) = =
X (z) (1 − 45 z −1 + 34 z −2 − 81 z −3 )
5 −1 3 1
W (z)[1 − z + z −2 − z −3 ] = X (z)
4 4 8
5 −1 3 1
W (z) = X (z) + z W (z) − z −2 W (z) + z −3 W (z)
4 4 8
5 3 1
w (n) = x(n) + w (n − 1) − w (n − 2) + w (n − 3)
4 4 8
Dr. Manjunatha. P (JNNCE) UNIT - 8: Implementation of Discrete-time Systems[?, ?,October
?, ?] 18, 2016 57 / 151
Realization of IIR system Direct form II structure for IIR system
H2 (z) = (1 + z −1 )
Y (z)
H2 (z) = = (1 + z −1 )
W (z)
Y (z) = W (z) + z −1 W (z)
y (n) = w (n) + w (n − 1)
x( n) w( n ) 1 y ( n)
y ( n)
x( n)
+
w(n) 1
+ + +
5 5
Z-1 Z-1 Z-1 -1
4 4
+ -1 +
3 Z-1 Z-1
− 3
4 −
4
1 Z-1
8 1 Z-1
8
June 2010 EE
1 + 15 z −1
H(z) = 1 −1
(1 − 2
z + 13 z −2 )(1 + 14 z −1 ) x ( n) 1
+ +
y ( n)
1 −1 5 −2 1 −3
Y (z) − z Y (z) + z Y (z) − z Y (z) = X (z) + 5z −1 X (z)
4 24 12
By taking inverse Z transform on both sides
1 5 1
y (n) − y (n − 1) + y (n − 2) − y (n − 3) = x(n) + 5x(n − 1)
4 24 12
Dr. Manjunatha. P (JNNCE) UNIT - 8: Implementation of Discrete-time Systems[?, ?,October
?, ?] 18, 2016 59 / 151
Realization of IIR system Direct form II structure for IIR system
8Z 3 −4Z 2 +11Z −2
Obtain direct form II for the system described by H(z) = [December 2010 EC]
(Z − 14 )(Z 2 −Z + 21 )
Solution:
x ( n) w( n ) 8 y ( n)
+ +
Z-1
1.25
-4
8Z 3 − 4Z 2 + 11Z − 2 Y (z) + +
H(z) = =
(Z − 14 )(Z 2 − Z + 12 ) X (z)
Z-1
8Z 3 − 4Z 2 + 11Z − 2 -0.75 11
= + +
Z − 1.25Z 2 + 0.75Z − 0.125
3
8 − 4Z −1 + 11Z −2 − 2Z −3 Z-1
=
1 − 1.25Z −1 + 0.75Z −2 − 0.125Z −1 0.125 -2
Y (z) (Z 2 − 1)(Z 2 − 2Z )
H(z) = =
X (z) (Z 2 − Z + 12 )(Z 2 + 1
16
)
Z4 − 2Z 3 − Z2 + 2Z
= 9 2 1 1
Z4 − Z3 + 16
Z − 16 Z + 32
1− 2Z −1 − Z −2 + 2Z −3
=
9 −2 1 −3 1 −4
1 − Z −1 + 16
− 16
Z + 32
Z
9 1 1
y (n) − y (n − 1) + y (n − 2) − y (n − 3) + y (n − 4) = x(n) − 2x(n − 1) − x(n − 2) + 2x(n − 3)
16 16 32
9 1 1
y (n) = x(n) − 2x(n − 1) − x(n − 2) + 2x(n − 3) + y (n − 1) − y (n − 2) + y (n − 3) − y (n − 4)
16 16 32
Dr. Manjunatha. P (JNNCE) UNIT - 8: Implementation of Discrete-time Systems[?, ?,October
?, ?] 18, 2016 61 / 151
Realization of IIR system Direct form II structure for IIR system
x ( n) w( n ) 1 y ( n)
x ( n) 1 y ( n) + +
+ +
Z-1 Z-1
1 Z-1 1
-2 y (n − 1) -2
+ + + +
x(n − 1)
9 Z-1
Z-1 −
16 y ( n − 2) 9 Z-1
-1 −
x( n − 2) + + 16 -1
+ +
Z-1 1 Z-1
2
16 y ( n − 3) 1 Z-1
x(n − 3) + 16 2
+
1 Z-1
− 1 Z -1
32 −
y (n − 4) 32
Realize direct form-I and form -II for linear time invariant system which is described by the
following input output relation
2y (n) − y (n − 2) − 4y (n − 3) = 3x(n − 2)
Solution:
x ( n) w( n ) y ( n)
+
x ( n) y ( n)
+
Z-1
Z-1 Z-1
Z-1 Z-1
Z-1 0.5
1.5 0.5 1.5
+ +
Z-1 Z-1
2 2
x ( n) w( n )
+
x ( n) y ( n)
+
Z-1
−0.4 y ( n)
0.1
Z-1
0.1 −0.4
Z-1 + +
+ +
Z-1 Z-1
Z-1 −0.45
−0.45 -0.3
-0.3
+ +
Z-1 Z-1
0.05
0.05
M
−k
P
bk z
k=0 b0 + b1 z −1 + b2 z −2 + bM z −M
H(z) = =
N 1 + a1 z −1 + a2 z −2 + aN z −N
ak z −k
P
1+
k=1
The system can be factored into a cascade of second order subsystems such that H(z) can be
expressed as
K
Y
H(z) = H1 (z) × H2 (z) × H3 (z) . . . × Hk (z) = Hk (z)
k=1
where K is the integer part of (N+1)/2 and Hk (z) has the general form
bk0 + bk1 z −1 + bk2 z −2
Hk (z) =
1 + ak1 z −1 + ak2 z −2
Yk (z)
Hk (z) =
Xk (z)
yk −1 (n) = x(n) w( n ) bk 0 yk (n) = xk +1 (n)
Wk (z) Yk (z) + +
=
Xk (z) Wk (z)
Z-1
− ak 1 bk1
= Hk1 (z).Hk2 (z) + +
June 2010 EE
Realize the following system function in cascade form
1 + 15 z −1
H(z) = 1 −1
(1 − 2
z + 31 z −2 )(1 + 14 z −1 )
Solution:
1 1 + 51 z −1
H(z) = H1 (z) × H2 (z) = 1 −1
.
(1 + 4
z ) (1 − 12 z −1 + 31 z −2 )
x( n) 1 y ( n)
+ + +
b20
Z-1 1 1
1 Z-1
− 2 5
4
+ −a
−a11 1 21 b21
−
3
Z-1
−a22
1 − 12 z −1
H(z) = 1 −1 1 −2
(1 − 4
z + 2
z )(1 − 51 z −1 + 16 z −2 )
Solution:
1 1 − 21 z −1
H(z) = H1 (z) × H2 (z) = 1 −1 1 −2
.
(1 − 5
z + 6
z ) (1 − 14 z −1 + 12 z −2 )
x ( n) 1 y ( n)
+ + +
Z-1 1 1
1 Z-1 −
5 4 2
+ +
1
−
2
Z-1 Z-1
1
−
6
1 + 13 z −1
H(z) =
(1 − 15 z −1 )(1 − 43 z −1 + 18 z −2 )
Solution:
1 1 + 31 z −1
H(z) = H1 (z) × H2 (z) = 1 −1
×
(1 − 5
z ) (1 − 34 z −1 + 81 z −2 )
x ( n) 1 y ( n)
+ + +
1 Z-1 3 1
Z-1
5 4 3
+
1
−
8
Z-1
1 − z −1
H(z) =
(1 − 0.2z −1 − 0.15z −2 )
H2 (z)
x ( n) H1 ( z ) 1 y ( n)
+ +
December 2010 EE
Draw the cascade realization for the following system
Solution:
Y (z) 6 + 7z −1 + z −2
H(z) = =
X (z) 1 − 0.75z −1 + 0.125z −2
a = 1, b = −0.75, c = 0.125
Roots of the quadratic equation for
Y (z) 6+ 7z −1
+ z −2 ax 2 +qbx + c = 0 are
H(z) = = −b± b 2 −4ac
X (z) 1 − 0.75z −1 + 0.125z −2 2a
6z 2 + 7z + 1
=
p
0.75 ± 0.752 − 4(0.125)
z2 − 0.75z + 0.125 =
2
(6z + 1)(z + 1) √
= 0.75 ± 0.0625 0.75 ± 0..25
(z − 0.5)(z − 0.25) = =
2 2
(6 + z −1 )(1 + z −1 ) = ⇒ 0.5, 0.25
= = H1 (z) × H2 (z)
(1 − 0.5z −1 )(1 − 0.25z −1 )
6 + z −1
H1 (z) =
1 − 0.5z −1
(1 + z −1 )
H2 (z) =
(1 − 0.25z −1 )
H2 (z)
x ( n) H1 ( z ) 6 1 y ( n)
+ + + +
Z-1 Z-1
0.5 1 0.25 1
x ( n) 1 1 y ( n)
+ + + +
Z-1 Z-1
1 -3 2
+ +
−0.0625
Z-1
Z-1
-0.5 2
Obtain the cascade realization of the following system. The system should have two biquadratic
sections. [EC December 2012]
(z − 1)(z 2 + 5z + 6)(z − 3)
H(z) =
(z 2 + 6z + 5)(z 2 − 6z + 8)
Solution:
(z − 1)(z 2 + 5z + 6)(z − 3)
H(z) =
(z 2 + 6z + 5)(z 2 − 6z + 8)
z 2 − 4z + 3 z 2 + 5z + 6
= 2
× 2
z + 6z + 5 z − 6z + 8
1 − 4z −1 + 3z −2 1 + 5z −1 + 6z −2
= ×
1 + 6z −1 + 5z −2 1 − 6z −1 + 8z −2
x ( n) 1 1 y ( n)
+ + + +
Z-1 Z-1
-6 6
-4 5
+ + + +
Z-1 Z-1
-5 3 -8 6
Solution:
10z(z − 0.5)(z − 0.6667)(z + 2)
H(z) =
(z − 0.75)(z − 0.125)[z − (0.5 + j0.5)][z − (0.5 − j0.5)]
10z(z − 0.5) (z − 0.6667)(z + 2)
= ×
(z − 0.75)(z − 0.125) [z − (0.5 + j0.5)][z − (0.5 − j0.5)]
10z 2 − 5z z 2 + 1.333z − 1.333
= ×
z 2 − 0.875z + 0.0938 z 2 − z + 0.5
10 − 5z −1 1 + 1.333z −1 − 1.333z −2
= ×
1 − 0.875z −1 + 0.0938z −2 1 − z −1 + 0.5z −2
x ( n) 10 1 y ( n)
+ + + +
Z-1 Z-1
0.875 1
-5 1.333
+ + +
Z-1 Z-1
-0.0938 -0.5 -1.333
EC December 2011
Obtain the cascade realization for the following system.
1 + 14 z −1
H(z) = 1 −1
(1 + 2
z )(1 + 21 z −1 + 12 z −2 )
Solution:
1 + 41 z −1
H(z) =
(1 + 21 z −1 )(1 + 21 z −1 + 12 z −2 )
1 + 41 z −1 1
= ×
1 + 12 z −1 1 + 12 z −1 + 12 z −2
x ( n) y ( n)
+ + +
1 Z-1 1 1 Z-1
− −
2 4 2
+
1 Z-1
−
4
Solution:
(1 + z −1 )3
H(z) =
(1 − 14 z −1 )(1 − 21 z −1 + 12 z −2 )
1 + z −1 1 + 2z −1 + z −2
= 1 −1
×
(1 − 4
z ) 1 − z −1 + 12 z −2
= H1 (z) × H2 (z)
x ( n) 1 1 y ( n)
+ + + +
1 Z-1 Z-1
1 1
4 2
+ +
1 Z-1
−
2 1
EC 2011 July
Obtain the direct form II realizations of the following system.
(1 + z −1 )
H(z) = 1 −1
(1 − 4
z )(1 − z −1 + 12 z −2 )
(1 + z −1 )
H(z) =
(1 − 14 z −1 )(1 − z −1 + 21 z −2 )
1 + z −1 1
= ×
(1 − 14 z −1 ) 1 − z −1 + z −2
= H1 (z) × H2 (z)
x ( n) y ( n)
+ + +
1 Z-1 Z-1
1 1
4
+
Z-1
−1
June 2010 EC
Obtain cascade form for the system described by
y (n) = −0.1y (n − 1) + 0.72y (n − 2) + 0.7x(n) − 0.252x(n − 2)
Solution:
H1 ( z )
H2 (z)
x ( n) 0.7 1 y ( n)
+ +
June 2015 EC
Find the transfer function and difference equation realization shown in Figure
x ( n) w( n ) 4 y ( n)
+ +
Z-1
3
+
Z-1
−2
Solution:
Y (z) 4 + 3z −1
H(z) = =
X (z) 1 + 2z −2
M
−k
P
bk z C
k=0
H(z) =
N
ak z −k
P
1+
k=1
H1 ( z ) +
b0 + b1 z −1 + b2 z −2 + bM z −M
=
1 + a1 z −1 + a2 z −2 + aN z −N H 2 (z) +
xk (n) wk ( n) bk 0 yk ( n )
bk0 + bk1 z −1 + +
Hk (z) =
1 + ak1 z −1 + ak2 z −2
Z-1
− ak1 bk1
+ +
wk (n) = ak1 wk (n − 1) − ak2 wk (n − 2) + x(n)
yk (n) = bk0 wk (n) − bk1 wk (n − 1) Z-1
− ak 2
K
X
y (n) = C x(n) + yk (n)
k=1 Figure 50: Direct form II of second order
subsystem
Solution:
4 2z −1
H(z) = 3 + +
1 − 0.5z −1 1 − 14 z −1
4 y ( n)
+ +
x ( n)
Z-1
0.5
Z-1
0.25 2
(1 + z −1 )(1 + 2z −1 )
H(z) = 1 −1
(1 + 2
z )(1 − 14 z −1 )(1 + 18 z −1 )
Solution:
z −2 (z + 1)(z + 2)
H(z) =
z −3 (z
+ 0.5)(z − 0.25)(z + 0.125)
z(z + 1)(z + 2)
H(z) =
(z + 0.5)(z − 0.25)(z + 0.125)
H(z) (z + 1)(z + 2)
=
z (z + 0.5)(z − 0.25)(z + 0.125)
H(z) A B C
= + +
z (z + 0.5) (z − 0.25) (z + 0.125)
(z + 1)(z + 2) A B C
= + +
(z + 0.5)(z − 0.25)(z + 0.125) (z + 0.5) (z − 0.25) (z + 0.125)
H(z) (z + 1)(z + 2)
A = [z + 0.5]|z=−0.5 =
z (z − 0.25)(z + 0.125)
(−0.5 + 1)(−0.5 + 2)
= = 2.66
(−0.5 − 0.25)(−0.5 + 0.125)
H(z) (z + 1)(z + 2)
B = [z − 0.25]|z=0.25 =
z (z + 0.5)(z + 0.125)
(0.25 + 1)(0.25 + 2)
= = 10
(0.25 + 0.5)(0.25 + 0.125)
H(z) (z + 1)(z + 2)
C = [z + 0.125]|z=−0.125 =
z (z + 0.5)(z − 0.25)
(−0.125 + 1)(−0.125 + 2)
= = −11.66
(−0.125 + 0.5)(−0.125 − 0.25)
2.66
+
Z-1
x ( n) y ( n)
−0.5
10
+ +
Z-1
0.25
−11.66
+
Z-1
−0.125
1 − z −1
H(z) =
(1 − 0.2z −1 − 0.15z −2 )
Solution
1 − z −1
H(z) =
(1 − 0.2z −1 − 0.15z −2 )
z2 − z
H(z) =
(z 2 − 0.2z − 0.15)
a = 1, b = −0.2, c = −0.15 √
−b± b 2 −4ac
Roots of the equation ax 2 + bx + c = 0 are = 2a
p √
0.2 ± 0.22 − 4(−0.15) 0.2 ± 0.64 0.2 ± 0.8
= = = ⇒ 0.5, − 0.3
2 2 2
H(z) z −1
=
z (z − 0.5)(z + 0.3)
H(z) A B
= +
z (z − 0.5) (z + 0.3)
−0.625
+
Z-1
x ( n) y ( n)
0.5 +
1.625
+
Z-1
−0.3
1 + 0.33z −1
H(z) =
(1 − 0.75z −1 + 0.125z −2 )
Solution
1 + 0.33z −1 z −1 (z + 0.33)
H(z) = = −2 2
(1 − 0.75z −1 + 0.125z −2 ) z (z − 0.75z −1 + 0.125z −2 )
H(z) z + .33
=
z (z 2 − 0.75z + 0.125)
a = 1, b = −0.75, c = 0.125
Roots of the equation are
p √
0.75 ± 0.752 − 4(0.125) 0.75 ± 0.0625 0.75 ± 0.25
= = = ⇒ 0.5, 0.25
2 2 2
H(z) z + 0.33
=
z (z − 0.5)(z − 0.25)
A B
= +
(z − 0.5) (z − 0.25)
3.33
+
Z-1
x ( n) y ( n)
0.5 +
−2.33
+
Z-1
0.25
Solution
Y (z) 6 + 7z −1 + z −2
H(z) = =
X (z) 1 − 0.75z −1 + 0.125z −2
z −2 [6z 2 + 7z + 1]
H(z) =
z −2 [z 2 − 0.75z + 0.125]
z −2 [6z 2 + 7z + 1]
H(z) =
z −2 [z 2 − 0.75z + 0.125]
[6z 2 + 7z + 1]
=
[z 2 − 0.75z + 0.125]
a = 1, b = −0.75, c = 0.125
Roots of the equation are
√
q
0.75 ± (−0.75)2 − 4(0.125) 0.75 ± 0.0625 0.75 ± 0.25
= = =
2 2 2
0.5, 0.25
6z 2 + 7z + 1
H(z) =
(z − 0.5)(z − 0.25)
H(z) 6z 2 + 7z + 1
=
z z(z − 0.5)(z − 0.25)
H(z) A B C
= + +
z z (z − 0.5) (z − 0.25)
6z 2 + 7z + 1 1
A = H(z)z|z=0 = z= =8
z(z − 0.5)(z − 0.25) (−0.5)(−0.25)
6z 2 + 7z + 1 6(0.5)2 + 7(0.5) + 1
B = H(z)(z − 0.5)|z=0.5 = (z − 0.5z) = = 48
z(z − 0.5)(z − 0.25) 0.5[0.5 − 0.25]
6z 2 + 7z + 1
C = H(z)(z − 0.25z)|z=0.25 = (z − 0.25)
z(z − 0.5)(z − 0.25)
6(0.25)2 + 7(0.25) + 1
= = −50
0.25[0.25 − 0.5]
48 −50
H(z) = 8 + + = H1 (z) + H2 (z) + H3 (z)
(1 − 0.5z 1 ) (1 − 0.25z 1 )
48 y ( n)
+ +
x ( n)
Z-1
0.5
−50
+
Z-1
0.25
8z 3 − 4z 2 + 11z − 2
H(z) =
[z − 14 ][z 2 − z + 12 ]
H(z) 8z 3 − 4z 2 + 11z − 2
=
z z[z − 14 ][z 2 − z + 12 ]
H(z) 8z 3 − 4z 2 + 11z − 2
=
z z[z − 14 ][z 2 − z + 12 ]
H(z) A B Cz + D
= + + 2
z z z − 0.25 z − z + .5
H(z) 8z 3 − 4z 2 + 11z − 2
A = z|z = 0 =
z [z − 0.25][z 2 − z + 0.5]
−2
= = 16
[−0.25][0.5]
H(z) 8z 3 − 4z 2 + 11z − 2
B = [z − 0.5]|z=0.5 =
z z[z 2 − z + 0.5]
8(0.5)3 − 4(0.5)2 + 11(0.5) − 2
= =8
(0.5)[(0.5)2 − (0.5) + 0.5]
H(z) 8z 3 − 4z 2 + 11z − 2
=
z z[z − 0.25][z 2 − z + 0.5]
8z 3 − 4z 2 + 11z − 2 A B Cz + D
= + + 2
z[z − 0.25][z 2 − z + 0.5] z z − 0.25 z − z + .25
8z 3 − 4z 2 + 11z − 2 = A[z − 0.25][z 2 − z + 0.5] +
+Bz[z 2 − z + .25] + (Cz + D)z[z − 0.25]
3 2
8z − 4z + 11z − 2z = z 3 [A + B + C ] + z 2 [−1.25A − B − 0.25C + D] +
+z[0.5A + .25B − .25D] − 0.0625A
8 = A + B + C = 16 + 8 + C
C = −16
16
H(z) A B Cz + D
= + + 2
z z z − 0.25 z − z + .5
8 y ( n)
H(z) 16 8 −16z + 20 + +
= + + 2 x ( n)
z z z − 0.25 z − z + .5
Z-1
8 −16 + 20z −1 0.25
H(z) = 16 + +
1 − 0.25z −1 1 − z −1 + .5z −2
-16
+ +
Z-1
1 20
+
Z-1
−0.5
EE 2010 May
Realize the following System in parallel form:
1 − 15 z −1
H(z) = 1 −1
[1 − 2
z + 31 z −2 ][1 + 14 z −1 ]
Solution:
z −1 (z − 0.2)
H(z) =
z −2 [z 2 − 0.5z + 0.33]z −1 [z + 0.25]
z 2 (z − 0.2)
H(z) =
[z 2 − 0.5z + 0.33z][z + 0.25]
H(z) z(z − 0.2)
=
z [z 2 − 0.5z + 0.33][z + 0.25]
H(z) Az + B C
= +
z [z 2 − 0.5z + 0.333] [z + 0.25]
z(z − 0.2) Az + B C
= +
[z 2 − 0.5z + 0.33][z + 0.25] [z 2 − 0.5z + 0.333] [z + 0.25]
H(z) (z − 0.2)
C = [z + 0.25]|z=−0.25 = 2
z [z − 0.5z + 0.333]
−0.25(−0.25 − 0.2)
= = 0.217
[(−0.25)2 − (0.5)(−0.25) + 0.333]
z(z − 0.2) Az + B C
= +
[z 2 − 0.5z + 0.33][z + 0.25] [z 2 − 0.5z + 0.333] [z + 0.25]
z(z − 0.2) = (Az + B)[z + 0.25] + C [z 2 − 0.5z + 0.33]
2
z − 0.2z = Az 2 + 0.25Az + Bz + 0.25B + Cz 2 − 0.5Cz + 0.33C ]
2
z − 0.2z = z 2 (A + C ) + z(0.25A + B − C ) + 0.25B + 0.33C
Equating coefficients
A+C = 1
A = 1 − C = 1 − 0.217 = 0.783
0.25B + 0.33C = 0
−0.33C
B = = −0.2864
0.25
0.78
+ +
Z-1
0.5
-0.2864
x ( n)
+ y ( n)
+
Z-1
-0.333
0.216
+
Z-1
0.25
EC 2012 December
Realize the following System in parallel form:
Solution:
H(z) A B C D
= + + +
z z − (0.5 + j0.5) z − (0.5 − j0.5) z − j0.25 z + j0.25)
H(z) (z 2 − 1)(z − 2)
A = [z − (0.5 + j0.5)]|z=0.5+j0.5 =
z [z − (0.5 − j0.25)][z − j0.25][z + j0.25]
[(0.5 + j0.5)2 − 1][(0.5 + j0.5 − 2]
=
[0.5 + j0.5 − (0.5 − j0.5)][z 2 + 0.0625]
[0.25 + j0.5 − 0.25 − 1][(0.5 + j0.5 − 2]
=
[j1][z 2 + 0.0625]
[−1 + j0.5][(−1.5 + j0.5]
=
[j1][j0.5 + 0.0625]
[1.5 − j0.5 − j0.75 + 0.25] 1.25 − j1.25 1.767∠ − 45
= = =
−0.5 + j0.0625 −0.5 + j0.0625 0.503∠172
1.767∠ − 45
= = 3.513∠ − 217 = −2.8 + j2.1
0.503∠172
H(z) A B C D
= + + +
z z − (0.5 + j0.5) z − (0.5 − j0.5) z − j0.25 z + j0.25)
−2.8 + j2.1 −2.7683 − j2.1517 3.268 − j7.837 3.268 + j7.837
= + + +
z − (0.5 + j0.5) z − (0.5 − j0.5) z − j0.25 z + j0.25)
We have to design second order system, hence combine first two terms and last two terms.
-5.536
+ +
Z-1
1
0.6112
x ( n)
+ y ( n)
+
-1
Z
-0.5
6.5366
+ +
Z-1
3.9184
Z-1
-0.0625
EE 2010 May
Realize the following System in parallel form:
1 + 14 z −1
H(z) = 1 −1
[1 + 2
z + 41 z −2 ][1 + 12 z −1 ]
Solution:
z −1 (z − 0.25)
H(z) =
z −2 [z 2 − 0.5z + 0.25]z −1 [z + 0.5]
z 2 (z + 0.25)
H(z) =
[z 2 + 0.5z + 0.25][z + 0.5]
H(z) z(z − 0.25)
=
z [z 2 + 0.5z + 0.25][z + 0.25]
H(z) Az + B C
= +
z [z 2 + 0.5z + 0.25] [z + 0.5]
z(z − 0.25) Az + B C
= +
[z 2 + 0.5z + 0.25][z + 0.5] [z 2 + 0.5z + 0.25] [z + 0.5]
z(z + 0.25) Az + B C
= +
[z 2 + 0.5z + 0.25][z + 0.5] [z 2 + 0.5z + 0.25] [z + 0.5]
z(z + 0.25) = (Az + B)[z + 0.5] + C [z 2 + 0.5z + 0.25]
2
z + 0.25z = Az 2 + 0.5Az + Bz + 0.5B + Cz 2 + 0.5Cz + 0.25C ]
2
z + 0.25z = z 2 (A + C ) + z(0.5A + B + 0.5C ) + 0.5B + 0.25C
Equating coefficients
A+C = 1
A = 1 − C = 1 − 0.5 = 0.5
0.5
+ +
Z-1
-0.5
-0.25
x ( n)
+ y ( n)
+
Z-1
-0.25
0.5
+
Z-1
-0.5
1 − 12 z −1
H(z) = 1 −1
(1 − 3
z )(1 − 41 z −1 )
Solution:
z −1 (z − 0.5)
H(z) =
z −1 (z − 0.33)z −1 (z − 0.25)
z(z − 0.5)
H(z) =
(z − 0.33)(z − 0.25)
H(z) (z − 0.33)
=
z (z − 0.33)(z − 0.25)
H(z) A B
= +
z z − 0.33 z − 0.25
(z − 0.5) A B
= +
(z − 0.33)z −1 (z − 0.25) z − 0.33 z − 0.25
H(z) z − 0.5
A = [z − 0.33]|z=0.33 =
z z − 0.25
0.33 − 0.5
= = −2
0.33 − 0.25
H(z) z − 0.5
B = [z − 0.25]|z=0.25 =
z z − 0.33
0.25 − 0.5
= =3
0.25 − 0.33
−2
+
Z-1
x ( n) 1 y ( n)
3 +
3
+
Z-1
0.25
1 + 13 z −1
H(z) =
1 − 34 z −1 + 81 z −2
Solution:
1 + 13 z −1
H(z) =
1 − 34 z −1 + 18 z −2
1 + 0.33z −1
H(z) =
(1 − 0.5z −1 )(1 − 0.25z −1 )
z −1 (z + 0.33)
H(z) =
z −1 (z− 0.5)z −1 (z − 0.25)
z(z + 0.33)
H(z) =
(z − 0.5)(z − 0.25)
H(z) (z + 0.33)
=
z (z − 0.5)(z − 0.25)
H(z) A B
= +
z z − 0.5 z − 0.25
(z + 0.33) A B
= +
(z − 0.5)(z − 0.25) z − 0.33 z − 0.25
3.333
+
Z-1
x ( n) 0.5 y ( n)
+
−2.33
+
Z-1
0.25
EE 2010 May
Realize the following System in parallel form:
Solution:
z(z + 0.25) Az + B C
= +
[z 2 + 0.5z + 0.25][z + 0.5] [z 2 + 0.5z + 0.25] [z + 0.5]
z(z + 0.25) = (Az + B)[z + 0.5] + C [z 2 + 0.5z + 0.25]
2
z + 0.25z = Az 2 + 0.5Az + Bz + 0.5B + Cz 2 + 0.5Cz + 0.25C ]
2
z + 0.25z = z 2 (A + C ) + z(0.5A + B + 0.5C ) + 0.5B + 0.25C
Equating coefficients
A+C = 1
A = 1 − C = 1 − 0.5 = 0.5
0.5
+ +
Z-1
-0.5
-0.25
x ( n)
+ y ( n)
+
Z-1
-0.25
0.5
+
Z-1
-0.5
Hm (z) = Am (z)
m
X
Y (z) = X (z) + am (i)z −i X (z)
i=1 f0 (n) = x(n) and g0 (n − 1) = x(n − 1)
m
X
y (n) = x(n) + am (i)x(n − i)
i=1
f 0 (n )
+ f1 (n) = y (n)
Consider the order of the filter m=1 K1
x( n)
From the figure y(n) is Figure 63: Single stage Lattice filter
y (n) = f0 (n) + k1 g0 (n − 1)
f 0 (n ) f1 (n) f 2 ( n ) = y ( n)
+ +
K1 K2
x ( n)
K1 K2
g0 (n)
Z-1 + g1 ( n)
Z-1 + g 2 ( n)
a2 (1)
K1 = and K2 = a2 (2)
(1 + K2 )
The lattice structure for mth order is obtained from direct form coefficients by the following
recursive equations.
Km = am (m)
am (i) − am (m)am (m − i)
am−1 (i) = 2
i = 1, 2, . . . m − 1
1 − Km
Draw the lattice structure for the following FIR filter function
1 −2
H(z) = 1 + 2z −1 + z
3
Solution:
1 −2 y ( n)
H(z) = 1 + 2z −1 + z + +
3 K1 = 1.5 K 2 = 0.333
x ( n)
K1 = 1.5 K 2 = 0.333
1
a2 (1) = 2, a2 (2) = 3
g 2 ( n)
Km = am (m)
Z-1 + Z-1 +
for m=2
K2 = a2 (2) = 13 Figure 65: Lattice filter
am (i) − am (m)am (m − i)
am−1 (i) = 2
1 − Km
a2 (i) − a2 (2)a2 (2 − i)
a1 (i) =
1 − K22
a2 (1) − a2 (2)a2 (1)
a1 (1) =
1 − K22
2 − (0.333)(2)
=
1 − (0.333)2
= 1.5
2 3 1
y (n) = x(n) + x(n − 1) + x(n − 2) + x(n − 3)
5 4 3
Solution:
2 3 1
y (n) = x(n) + x(n − 1) + x(n − 2) + x(n − 3)
5 4 3
By taking z transform
2 −1 3 −2 1
Y (z) = X (z) + z X (z) + z X (z) + z −3 X (z)
5 4 3
Y (z) 2 3 −2 1
H(z) = = 1 + z −1 + z + z −3
X (z) 5 4 3
= 1 + 0.4z −1 + 0.75z −2 + 0.333z −3
y ( n)
+ + +
K1 = 0.0998 K 2 = 0.693 K 3 = 0.333
x ( n)
K1 = 0.0998 K 2 = 0.693 K 3 = 0.333
By taking z transform
Y (z) = X (z) + 3.1z −1 X (z) + 5.5z −2 X (z) + 4.2z −3 X (z) + 2.3z −4 X (z)
Y (z)
H(z) = = 1 + 3.1z −1 + 5.5z −2 + 4.2z −3 + 2.3z −4
X (z)
f1 ( n) f 2 ( n) f 3 (n ) y(n)
+ + + +
K1 = 0.338 K 2 = 1.167 K 3 = 0.683 K 4 = 2.3
x(n)
K1 = 0.338 K 2 = 1.167 K 3 = 0.683 K 4 = 2.3
Z-1 + Z-1 + Z-1 + Z-1 +
g1 (n) g 2 ( n) g 3 ( n) g 4 ( n)
Determine all the FIR filters which are specified by the lattice parameters K1 = 0.1, K2 = 0.2,
and K3 = 0.3 and draw the structure
Solution:
am (0) = 1
am (m) = Km
am (i) = am−1 (i) + am (m)am−1 (m − i) For m=3
m
X
H(z) = 1+ am (i)z −i
i=1
3
X
= 1+ a3 (i)z −i
i=1
x ( n)
Z-1 Z-1 Z-1
y(n)
+ + +
Determine all the FIR filters which are specified by the lattice parameters K1 = 0.5, K2 = 0.333,
and K3 = 0.25 and draw the structure
Solution:
am (0) = 1
am (m) = Km For m=3
am (i) = am−1 (i) + am (m)am−1 (m − i)
a3 (0) = 1
For m=1 a3 (3) = K3 = 0.25
a3 (i) = a2 (i) + a3 (3)a2 (3 − i)
a1 (0) = 1 a3 (1) = a2 (1) + a3 (3)a2 (2)
a1 (1) = K1 = 0.5 = 0.665 + (0.25)(0.333) = 0.75
a3 (2) = a2 (2) + a3 (3)a2 (1)
For m=2
= 0.333 + (0.667)(0.12) = 0.5
a2 (0) = 1
a2 (2) = K2 = 0.333 a3 (3) = k3 = 0.25
a2 (i) = a1 (i) + a2 (2)a1 (2 − i)
a2 (1) = 0.5 + (0.333)0.5 = 0.665
3
X
H(z) = 1+ a3 (i)z −i
i=1
x ( n)
Z-1 Z-1 Z-1
y(n)
+ + +
Determine the impulse response of a FIR filter with reflection coefficients K1 = 0.6, K2 = 0.3,
K3 = 0.5 and K4 = 0.9 Also draw the direct form structure
Solution:
am (0) = 1
am (m) = Km
For m=3
am (i) = am−1 (i) + am (m)am−1 (m − i)
a3 (0) = 1
For m=1
a3 (3) = K3 = 0.5
a1 (0) = 1 a3 (i) = a2 (i) + a3 (3)a2 (3 − i)
a1 (1) = K1 = 0.5 a3 (1) = a2 (1) + a3 (3)a2 (2)
= 0.78 + (0.5)(0.3) = 0.93
For m=2 a3 (2) = a2 (2) + a3 (3)a2 (1)
= 0.3 + (0.5)(0.78) = 0.69
a2 (0) = 1
a2 (2) = K2 = 0.3
a2 (i) = a1 (i) + a2 (2)a1 (2 − i) a3 (3) = k3 = 0.25
a2 (1) = 0.6 + (0.3)0.6 = 0.78
a4 (0) = 1
a4 (i) = a3 (i) + a4 (4)a3 (4 − i)
a4 (1) = a3 (1) + a4 (4)a3 (3) = 0.93 + (0.9)(0.5) = 1.38
a4 (2) = a3 (2) + a4 (3)a3 (2) = 0.69 + (0.9)(0.69) = 1.311
a4 (3) = a3 (3) + a4 (3)a3 (1) = 0.5 + (0.9)(0.93) = 1.337
a4 (4) = K4 = 0.9
a4 (0) = 1, a4 (1) = 1.38, a4 (2) = 1.311, and a4 (3) = 1.337 and a4 (4) = 0.9
3
X
H(z) = 1+ a3 (i)z −i = 1 + a4 (1)z −1 + a4 (2)z −2 + a4 (3)z −3 + a4 (4)z −3
i=1
x ( n)
Z-1 Z-1 Z-1 Z-1
y(n) y(n)
+ + + +
M
−k
P
bk z
k=0
H(z) =
N
ak z −k
P
1+
k=1
1 1
H1 (z) = =
N AN (z)
aN (k)z −k
P
1+
k=1
Y (z)
But the system function H1 (z) = X (z)
Y (z) 1
=
X (z) N
aN (k)z −k
P
1+
k=1
N
X
Y (z) + aN (k)z −k Y (z) = X (z)
k=1
N
X y (n) = a1 (1)y (n − 1) + x(n)
Y (z) + aN (k)z −k Y (z) = X (z)
k=1
The equation is similar to the FIR Figure 72: Single stage Lattice
Dr. Manjunatha. P (JNNCE) UNIT - 8: Implementation of Discrete-time Systems[?, ?,
October
?, ?] 18, 2016 132 / 151
Realization of IIR system Lattice structure for IIR Systems
f2 (n) = x(n)
f1 (n) = f2 (n) − K2 g1 (n − 1)
g2 (n) = K2 f1 (n) + g1 (n − 1)
f0 (n) = f1 (n) − K1 g0 (n − 1)
g1 (n) = K1 f0 (n) + g0 (n − 1)
y (n) = f0 (n) = g0 (n)
g2(n) K2 K1
+ Z-1 + Z-1
g1(n) g0(n)
N
X
y (n) = − aN (k)y (n − k) + x(n)
k=1
2
X
y (n) = − a2 (k)y (n − k) + x(n)
k=1
2
X
y (n) = − a2 (k)y (n − k) + x(n)
k=1
= −a2 (1)y (n − 1) − a2 (2)y (n − 2) + x(n)
a2 (1)
K1 = and K2 = a2 (2)
(1 + a2 (2))
The lattice structure for mth order is obtained by the following recursive equations.
Km = am (m)
M
X
βi = bi − βm am (m − i) i = M, M − 1, M − 2, . . . 1, 0
m=i+1
KN
gN(n) gN-1(n) g2(n) g1(n) g0(n)
+ Z-1 + Z-1 + Z-1
β0
β N −1 β1
βN β2
y ( n)
+ + β0
+ +
for m=3
Develop the lattice ladder structure for the filter with difference equation
3 1
y (n) + y (n − 1) + y (n − 2) = x(n) + 2x(n − 1)
4 4
Solution:
3 1
y (n) + y (n − 1) + y (n − 2) = x(n) + 2x(n − 1)
4 4
By taking z transform
3 −1 1
Y (z) + z Y (z) + z −2 Y (z) = X (z) + 2z −1 X (z)
4 4
Y (z) 1 + 2z −1
H(z) = =
X (z) 1 + 34 z −1 + 14 z −2
B(z) = 1 + 2z −1
A(z) = 1 + 43 z −1 + 41 z −2
a2 (1) = 0.75, a2 (2) = 0.25
M
X
βi = bi − βm am (m − i)
m=i+1
for m=2
K2 = a2 (2) = 0.25 1
X
β0 = b0 − βm am (m)
am (i) − am (m)am (m − i) m=1
am−1 (i) = 2
1 − Km = b0 − β1 a1 (1) = 1 − 2(0.6) = −0.2
a2 (i) − a2 (2)a2 (2 − i)
a1 (i) =
1 − K22
a2 (1) − a2 (2)a2 (1)
a1 (1) =
1 − K22
0.75 − (0.25)(0.75)
= = 0.6 x(n) f1(n) f0(n)
1 − (0.25)2 + +
- K2=0.25 - K1=0.6
for m=1
g1(n) g0(n)
K1 = a1 (1) = 0.6
+ Z-1 + Z-1
Ladder coefficients are
B(z) = 1 + 2z −1 M=1 β 0 = −0.2
β1 = 2
b0 = 1, b1 = β1 = 2 y ( n)
+ +
where
for m=3
K3 = a3 (3) = −0.0276
am (i) − am (m)am (m − i)
am−1 (i) = 2
for m=2
1 − Km K2 = a2 (2) = 0.3485
a3 (i) − a3 (3)a3 (3 − i)
a2 (i) =
1 − K32 a2 (i) − a2 (2)a2 (2 − i)
a1 (i) =
a3 (1) − a3 (3)a3 (2) 1 − K22
a2 (1) =
1 − K32 a2 (1) − a2 (2)a2 (1)
a1 (1) =
−0.2971 − (−0.0276)(0.3564) 1 − K22
=
1 − (−0.2971)2 0.2875 − (0.3485)(−0.2875)
=
= −0.2875 1 − (0.3485)2
a3 (2) − a3 (3)a3 (1) = −0.2132
a2 (2) =
1 − K32
0.3564 − (−0.0276)(−0.2971) for m=1
= K1 = a1 (1) = −0.2132
1 − (−0.0.0276)2
= 0.3485
i =1
3
X
β1 = b1 − βm am (m − 1)
m=2
= b1 − β2 a2 (1) − β3 a3 (2) = 0.3867 − (0.4252)(−0.2875) − (0.129)(0.3564) = 0.4630
i =0
3
X
β0 = b0 − βm am (m)
m=1
= b0 − β1 a1 (1) − β2 a2 (2) − β3 a3 (3)
= 0.129 − (0.4630)(−0.2132) − (0.4252)(0.3485) − (0.129)(−0.0276) = 0.0831
1 + z −1 + z −2
H(z) =
(1 + 0.5z −1 )(1 + 0.3z −1 )(1 + 0.4z −1 )
1 + z −1 + z −2
H(z) =
(1 + 0.5z −1 )(1 + 0.3z −1 )(1 + 0.4z −1 )
1 + z −1 + z −2
=
1 + 1.2z −1 + 0.47z −2 + 0.06z −3
1
H(z) = B(z)
A(z)
where
for m=3
K3 = a3 (3) = 0.06
am (i) − am (m)am (m − i)
am−1 (i) = for m=2
1 − Km 2
K2 = a2 (2) = 0.4
a3 (i) − a3 (3)a3 (3 − i)
a2 (i) =
1 − K32 a2 (i) − a2 (2)a2 (2 − i)
a1 (i) =
a3 (1) − a3 (3)a3 (2) 1 − K22
a2 (1) =
1 − K32 a2 (1) − a2 (2)a2 (1)
a1 (1) =
1.2 − (−0.06)(0.47) 1 − K22
=
1 − (−0.06)2 1.176 − (0.4)(1.176)
=
= 1.176 1 − (0.4)2
a3 (2) − a3 (3)a3 (1) = 0.84
a2 (2) =
1 − K32
0.47 − (−0.06)(1.2) for m=1
= K1 = a1 (1) = 0.84
1 − (0.06)2
= 0.4
3
X
β1 = b1 − βm am (m − 1)
Ladder coefficients are
m=2
B(z) = 1 + z −1 + z −2 M=1
b0 = 1, b1 = 1, b2 = 1 = β2 = b1 − β2 a2 (1)
= 1 − 1.176 = −0.176
M
X
βi = bi − βm am (m − i) i =0
m=i+1
1
X
β2 = b2 = 1 β0 = b0 − βm am (m)
m=1
= b0 − β1 a1 (1) − β2 a2 (2)
= 1 + .84(0.176) − 0.4 = 0.748
fN(n)=x(n) fN-1(n) f2(n) f1(n) f0(n)
+ + +
- K3=-0.06 - K2=-0.4 - K1=-0.84
K1=-0.84
K3 =0.06 K2=-0.4
gN(n) gN-1(n) g2(n) g1(n) g0(n)
+ Z-1 + Z-1 + Z-1
β2 = 1 β1 = −0.176 β 0 = 0.748
y ( n)
+ +
x ( n) b0 y ( n) 2 Sink Node
+ + x ( n) 1 b0 3 y ( n)
Source
Z-1 Node − a1 Z −1 b1
−a1 b1
+ + 4
b2
− a2
Z-1 Z −1
− a2 b2
5
Z-1
− a1 Z −1 b1
− a1 b1
4 +
b2
− a2
Z-1
Z −1
− a2 b2
5 +
Figure 82: Transposed Structure SFG Figure 83: Direct form-II realization
Figure 80 shows the direct form II structure while Figure 81 shows its signal flow graph
Figure 82 shows the Transposed Structure while Figure 83 shows its realization.
Source 1
−
1 −1 −
Node
8
Z 2 y ( n)
x ( n)
1
4
+
1
5 Z −1
4
1
− 5
6
Z-1
1 1
− −
Figure 84: Signal flow graph 8 2
+
Z-1
2
y ( n) 1 3 x ( n)
1 1
Source 1
1 − 5 4
Node −
8
Z −1
4
2 +
1
1 1
5 Z −1
4
−
1
6
− 5 Z-1
6
For the flow graph write difference equations and system function
x ( n) y ( n)
1 Z −1 1
Z −1
5 4
5
Z −1 −
24
Z −1 1
−
12
Solution:
1 5 1 1
y (n) = y (n − 1) − y (n − 2) − y (n − 3) + x(n) + x(n − 1)
4 24 12 5
1 + 15 z −1
H(z) = 1 −1 5 −2 1 −3
1− 4
z + 24
z + 12
z
For the flow graph write difference equations and system function
x ( n) w( n ) y ( n)
Z −1 3 Z −1
1
Y (z) Y (z) W (z)
Z −1
H(z) = =
Z −1 X (z) W (z) X (z)
1 2
1
=
Figure 88: Direct Form II Cascade (1 − z −1 − 2z −2 )(1 − 3z −1 − z −2 )
1
=
1 − 4z −1 + 7z −3 + 2z −4
Solution:
w (n) = x(n) + 3w (n − 1) + w (n − 2)
Y (z)[1 − 4z −1 + 7z −3 + 2z −4 ] = X (z)
W (z) 1
= Y (z) = X (z)+4z −1 Y (z)−7z −3 Y (z)−2z −4 Y (z)
X (z) 1 − 3z −1 − z −2
Y (z) 1
=
W (z) 1 − z −1 − 2z −2
(9.1)
(9.2)
(9.3)
(9.4)
adder
multiplier
unit delay
adder
multiplier
unit delay
(9.5)
(9.6)
(9.7)
(9.8)
(9.9)
(9.10)
and
(9.11)
(9.12)
and
(9.13)
Substituting (9.13) into (9.12) yields:
(9.14)
(9.15)
H. C. So Page 16 Semester B 2011-2012
To save the computational complexity, we express (9.9) as:
(9.16)
where , and ,
. That is, all are normalized to 1.
Example 9.2
Draw the signal flow graph using the cascade form for the
LTI system whose transfer function is:
(9.17)
(9.18)
and
(9.19)
(9.20)
where
H. C. So Page 22 Semester B 2011-2012
(9.21)
and
(9.22)
(9.23)
and
(9.24)
2. Canonic Form
On the other hand, we can first pass through the filter
to produce an intermediate signal . The is then
passed through the system to give :
(9.25)
and
(9.26)
(9.27)
and
(9.28)
According to (9.18)-(9.19):
Based on (9.27)-(9.28):
(9.29)
(9.30)
(9.31)
where , and ,
.
(9.32)
and
and