DSP_class Notes
Short Description
Download DSP_class Notes...
Description
DSP2008.doc
1
Introduction to DSP: Text Books : (P) = Proakis , (M) = Mitra (I) = Iffeachor. (previous reference continues to apply unless change is indicated)
Signals: (p) speech, biomedical, music, video, radar, DSP concerned with digital representation of signals, and use of digital processors to analyse, modify, and extract information. Signal converted to digital and then processed then reconverted.
Advantages:
• • • • • • •
Guaranteed accuracy: no. of bits Perfect reproducibility: no equipment dependence, tolerances etc. No drift in performance with age, temp, With CMOS, reliability, small size, low cost, low power and high speed Flexibility: a given system can be reprogrammed, with same hardware Superior, near ideal performance: i.e. linearity, adaptive filtering etc Storage: digital storage media can be used
Applications:
• • • • • •
Image processing: pattern recognition, enhancement, Control and Instrumentation: spectral analysis, noise reduction, and data compression Speech: recognition and synthesis, text to speech, equalisation Military: secure communication, radar and sonar, guidance systems. Communications: echo suppression, adaptive equalisation, spread spectrum, Bio-medical: EEG-ECG analysis, scanners, X-ray storage, and enhancement
Classification of Signals: (P,M) Multichannel and Multidimensional Signal is a function of one or more variables. It can be real valued, complex valued or a vector • A sin 3π t is real valued • Ae j3π t is complex valued Vector signals are generated by multiple sources. E.g. 3 lead ECG, RGB, and are multichannel signals. The variable may be 1-dimensional e.g. t
DSP2008.doc
2
A picture signal (B&W) is 2-dimensional as it is a function of x and y Colour TV is 3 channel 3 dimensional e.g. (x,y,t),
Continuous Time and Discrete Time Signals: (P,M)
• •
Continuous time signals are defined for all value of time i.e. speech Discrete time signals defined at specific instances of time x[n]
Continuous time signals may be • analog if all values are allowed, or • Quantized Boxcar signals if specific values are allowed. Discrete time signals may be • digital (specific values) or • sampled (any value)
Deterministic and Random Signals: (P,M)
• •
If an expression or a table can define a signal model then it is deterministic. The past present and future values can be known without uncertainty. If the signal cannot be described to any reasonable degree of accuracy by an expression, then it is random.
Concept of Frequency in Continuous and Discrete Time Signals: (P) Periodic Analog signal: A periodic analog signal satisfies x a (t ) = x a (t + T ) where T is the repetition period e.g. x a (t ) = A cos( 2Ωt + θ ), Ω = 2π F uses Ω as frequency in radians /sec, F is frequency in Hz. Here F can be increased without limit, and can also be 0, and all resulting signals are distinct. Increasing F results in increase in the rate of oscillation.
Periodic Discrete Time signal: The corresponding Discrete Time sinusoid would be x (n) = A cos(ω n + θ ) where n is an integer called sample number. ω is the freq. in radians /sample, ω = 2π f and f has dimensions of cycles/sample. It is periodic with a period N if and only if x(n + N ) = x(n) for all n . Smallest value of N is the Fundamental period. For a periodic discrete time sinusoid cos(2π f 0 n) = cos( 2π f 0 (n + N )) Thus
DSP2008.doc
3
2π f 0 N = 2k π , where k is an integer, or f 0
=
k N
and must be a rational number.
Aliasing of Discrete Time Signals: Discrete time sinusoids whose frequencies are separated by integer multiples of 2π are identical. For example, If ω k = ω 0 + 2π then cos( w0 n) and cos(ω k n) are indistinguishable. However sinusoids in range − π ≤ ω ≤ π or −
1 2
≤ f ≤
1 2
are always distinct.
Signals with ω > π are called aliases of some corresponding sinusoid with ω < π
Fundamental Frequency Range: The highest rate of oscillation is when ω = π or − π or f =
1 2 1
or −
1 2 1
The frequency range 0 ≤ ω ≤ 2π or − π ≤ w ≤ π 0 ≤ f ≤ 1, − ≤ f ≤ is the called 2 2 the fundamental range.
Representation as Complex Exponentials: Continuous time exponential components can be used to represent a given periodic signal, i.e. Fourier series. xa (t ) =
+∞
c e = −∞
jk Ω 0t
k
k
The discrete time complex exponential is periodic if its relative frequency is a rational number. We may choose f 0 = s k ( n) = e
j 2π f 0 n
1 N
and define
, with k = 0, ± 1, ± 2 etc.
In this case however s k + N (n) = e j 2π n ( k + N ) = e j 2π N s k (n) = s k (n) and there are only N distinct complex exponentials in the set. N −1
Hence x(n) = c k e j 2π k n / N
is a periodic signal with fundamental period N
k = 0
Sampling: (P) Consider uniform sampling of an analogue signal x(n) = x a (nT ) where T is sampling period, and F s = Since t = nT =
n F s
1 T
the sampling frequency.
the analogue sinusoid can be written as
x a (t ) = A cos( 2π Ft + θ )
F thus x a (nT ) = x(n) = A cos(2π FnT + θ ) = A cos 2π n + θ F s Comparing with the discrete time sinusoid expression
DSP2008.doc
4
x(n) = A cos(2π fn + θ )
we find f = 1
Since −
2
F F s
≤ f ≤
or ω = ΩT . 1 2
and − π ≤ ω ≤ π , the frequency of the continuous time sinusoid
when sampled at F s =
−
1
−
π
2
T =
T
−
F s
2
≤ F ≤
F s
2
≤
= −π F s ≤ Ω ≤ π F s =
1
must fall in range
T 1 T 2 ,
π T
Thus a fundamental difference is in the range of values. Periodic sampling of a continuous time signal involves a mapping of the infinite frequency range for F or Ω into a finite range for f or ω . The highest freq. in a discrete time signal is ω = π or f = the corresponding highest values of F and Ω are
F s
2
=
1 2T
1 2
,
, and π F s =
π T
respectively.
Thus sampling produces an ambiguity with the highest frequency that can be uniquely distinguished being
F s
2
.
This can be seen from the following: If x(n) = A cos( 2π f 0 n) is the sampled signal derived from an analog signal x a (t ) = A cos(2π F 0 t ) with frequency F 0 , Then for F k = F 0 + kF s , the sinusoid x a (t ) = A cos(2π F k t ) gives a sampled signal
x( n) = x a (nT ) = A cos 2π
F 0
+ kF s
n = A cos 2π
F 0 n F s
F s which is the same as the first signal. Thus the process of sampling introduces an ambiguity (Aliasing).
If the signal has a highest freq. F max = B then it follows that to avoid aliasing, F max
<
F s
2
or F s > 2 F max
Recovery of Analog Signals : The sampling theorem states that for F s > 2 B , x a (t ) can be exactly recovered using the interpolation function G (t ) = Thus x a (t ) =
∞
x = −∞
n
a
n n g t − F s F s
sin(2π Bt ) 2π Bt
DSP2008.doc
5
At the minimum sampling rate F s = 2 B x a (t ) =
sin 2π B t −
∞
x = −∞
n
a
n 2 B
n 2 B 2π B t − n 2 B
Discrete-Time Signals: Sequences of numbers (samples) represented by x[n] where n is integer with range −∞ < n < ∞. The signal is the set { x[n ]}. x[n ] may be periodic samples of a continuous waveform x a (t ) . x[n ] = x a (nT ) where T = sampling period, 1 = F T Hz. T x[n ] may be complex and { x[n ]} = { x re [n ]} + j{ xim [n]} .
Types of Sequences: (M) Finite: A sequence is finite if N 1 ≤ n ≤ N2, N2 > N1 , -∞ < N1 , N2 < ∞ Length is defined as N = N 1 + N2 -1 (N point sequence) Such a sequence can be made infinite by assigning zero values outside defined range. h[n] = [3.5, -9.4, 0.05, 67.0, 205, 0.8]
↑
Above sequence is defined from –2 ≤ n ≤ 3. It can be made infinite by defining h[n] = 0 for n < -2, n > 3 Infinite: Right Sided. Zero values for n < N1, N1 negative or positive. x[n] = 0 n N2. If N2 ≤ 0 then ANTI CAUSAL. CAUSAL. x[n] = -(1/n) n ≤ -5 =0 n > -5 Two Sided: Has -∞ ≤ n ≤ + ∞. 2 x[n] = 1/n
DSP2008.doc
6
Even / Odd: * Conjugate symmetric x[n] = x [-n] If all x[n] real then EVEN Conjugate asymmetric x[n] = -x * [-n], If all x[n] real then ODD Periodic: x[n] = x[n + kN] for all n, N is a positive integer, and is the PERIOD of sequence Nf = fundamental period is the period with smallest N Bounded: |x[n]| ≤ Bx < ∞ x[n] = 0 n≤0 = 1/n n > 0 Absolutely Summable: |x[n]| < ∞ Square Summable: 2 E = |x[n]| < ∞, E is the energy
Basic Sequences: (M) Unit Sample: δ[n] = 1 n = 0 n≠0
=0
Unit Step: µ[n] = 1 n ≥ 0 =0 n 1 then Interpolation If R < 1 then Decimation
Sampling Process: ( M) samples at nT = n F = 2π n Ω T T where ΩT = sampling angular frequency = 2 π FT If analog signal sampled is x a (t ) = A cos(2π f 0 t + Φ ) = A cos(Ω 0 t + Φ )
We get discrete time signal
x[n] = A cos( Ω 0 nT + Φ ) = A cos((2π Ω 0 / Ω T )n + Φ ) = A cos(ω 0 n + Φ )
DSP2008.doc
8
with ω 0 = (2π Ω 0 ) / Ω T = Ω 0T called the normalised digital angular frequency (in radians/sample) In the general case, a family of sinusoids x a ,k (t ) = A cos((Ω 0 + k Ω T )t + Φ k = 0, ± 1, ± 2, ± 3,…. gives sampled signal x a ,k (nT ) = A cos((Ω 0
+ k ΩT )nT + Φ)
= A cos 2π Ω 0 + k ΩT ) n Ω + Φ = A cos 2π Ω 0 n Ω + Φ T = A cos(ω 0 n + Φ )
T
= x[n] If Ω T > 2Ω 0 , then − π < ω 0 < π implies no aliasing, otherwise aliasing is observed. Example: v(t) = 6 cos (60 π t) + 3 sin (300 π t) + 2 Cos (340 π t) + 4 cos (500 π t) + 10 sin (660 π t) is sampled at T =1/200 sec. Giving v[n] = 6 cos (0.3πn) + 3 sin (1.5πn) +2 cos (1.7πn) + 4 cos (2.5πn) + 10 sin (3.3πn) = 6 cos (0.3πn) + 3 sin ((2π - 0.5π)n) + 2 cos ((2π - 0.3π)n)+4 cos((2π + 0.5π)n) - 10 sin ((4π - 0.7π)n) = 8 cos (0.3πn) + 5 cos (0.5πn + 0.6435) - 10 sin (0.7πn) Same results are obtained if w(t) = 8 cos (60πt) + 5 cos (100πt + 0.6435) -10 sin (140πt) are sampled at the same rate.
Linear Systems: (M, P) Input x[n] = α x1[n] + β x2[n] gives an output y[n] = α y1[n] + β y2[n] for all α, β, x1, and x2 example: y[n] = nx[n] is linear y1[n[ = nx1[n], y2[n] = nx2[n] thus y3[n] = n([a1x1[n] + a2x2[n]) also a1y1[n] +a2y2[n] = a1nx1[n] + a2nx2[n] . 2
y[n] = x[n ] is linear 2 2 2 2 y1[n] = x1[n ] and y2[n] = x2[n ] hence y3[n] = a1 x1[n ] + a2 x2[n ] 2 2 linear combination of outputs is a1y1[n] +a2y2[n] = a1 x1[n ] + a2 x2[n ]
DSP2008.doc
9
2
y[n] = x [n] is non-linear 2 2 2 y1[n] = x1 [n] and y2[n] = x2 [n] hence y3[n] = (a1 x1[n] + a2 x2[n]) 2 2 linear combination of outputs is a1y1[n] +a2y2[n] = a1 x1 [n] + a2 x2 [n] y[n] = Ax[n] + B is linear only if B = 0 y1[n] = Ax1[n] + B and y2[n] = Ax2[n] + B hence y3[n] = A(a1 x1[n] + a2 x2[n]) + B linear combination of outputs is a1y1[n] +a2y2[n] = Aa1x1[n] + a1B + Aa2x2[n] + a2B Accumulator y[n] = x[n] y[n] = (α x1[k] + β x2[k]) = α x1[k] + β x2[k] = α y1[n] + β y2[n] is linear Accumulator with an initial condition (Causal accumulator) has y1 [ n] = y1 [ −1] +
n
= x [k ] 1
n
and y 2 [n] = y 2 [−1] + x 2 [k ] k = 0
k 0
Hence for input y1[n] = y1[−1] +
α x1[n] + β x2[n]
n
= α x [k ] + β x [k ] = 1
2
n
= x [k ] + β = x [k ]
y[−1] + α
l 0
n
1
k 0
2
k 0
but n
n
k = 0
k = 0
α y1[n] + β y 2 [n] = α y1 [−1] + α x1[k ] + β y 2 [−1] + β x 2 [k ]
which can equal y[n] only if y[-1] = α y1[-1] + β y2[-1] for all α, β, y[-1], y1[-1] and y2[-1]. This is possible if and only if system starts from rest with initial condition zero. Otherwise it is Nonlinear
Shift Invariance: (Time Invariance) (M,P) If x[n] → y[n] then x[n-n0] → y[n-n0] Y[n] = x[n] – x[n-1] is time invariant If input is delayed and applied y(n,k) = x(n-k) – x(n-k-1) If output is delayed y(n-k) = x(n-k) – x(n-k-1) Y[n] = nx[n] is time variant Response to x(n-k) is y(n,k) = nx(n-k) However if output is delayed, y(n-k) = (n-k)x(n-k) Y[n] = x[-n] is time variant Response to x(n-k) is y(n,k) = x(-n-k) However if output is delayed, y(n-k) = (-n+k) Y[n] = x[n]cos(wn) is time variant
Linear Time Invariant (LTI): A system having both Linear and Time-invariance properties.
DSP2008.doc
10
Causality: y[n0] depends only on x[n] where n ≤ n0
Stability: Bounded input gives bounded output (BIBO Stability) if |x[n]| < Bx then |y[n]| < By
Impulse Response And Step Response: Impulse Response: denoted by {h[n]} is the response to a unit sample sequence {δ[n]}
Step Response: {S[n]}
→ response to {µ [n]}
Response To Signal x[n]: (M,P) Expressing x[n] sequence as x[n] =
k = +∞
x[k ]δ (n − k )
the response of LTI system to
k = −∞
x[k]δ(n-k) will be x[k]h[n-k] Thus y[n] = x[k]h[n-k] or by a change of variables y[n] = x[n-k]h[k] which is a convolution y[n] = x[n] * h[n] example: a = [ -2 0 1 –1 3], b = [1 2 0 –1] a*b = [-2 –4 1 3 1 5 1 –3] Because of the summation both x[n] and y[n] cannot be infinite. Convolution of sequence of lengths M and N gives a sequence of length M+N-1 Convolution is commutative, associative and distributive.
Stability Condition For LTI System: (P) S = |h[n]| < ∞
Causality Condition: (P) h[n] = 0 for n < 0 y[n] =
n
n
k 0
k 0
= h[k ] x[n − k ] = = x[k ]h[n − k ]
For a Causal sequence input into a causal LTI system i.e. y[n] = 0 for n < 0 and is thus also causal
DSP2008.doc
11
Classes Of LTI Systems: (P) FIR: Finite Impulse Response if h[n] is of finite length h[n] = 0 for n < N1 and n > N2 with N1 < N2 Impulse response is zero outside a finite time interval. Causal FIR system has h[n] = 0 n < 0 and n ≥ M. The convolution equation for causal FIR is y[n] =
M −1
= h[k ] x[n − k ] k 0
Output is the weighted linear combination of the past M input samples. Has a memory of M samples. It can be realised by adders, multipliers and finite memory.
IIR: infinite impulse response IIR if h[n] is of infinite length. In a causal IIR summation in the convolution is from k = 0 to ∞ It involves all the past input samples, and requires infinite memory. So realisation by convolution form is impractical. A more practical way is by the difference equation form. Example: cumulative average of x[n] in 0 ≤ k ≤ n y[n] =
1
n
x[k ]
n + 1 k = 0
n = 0,1
Knowledge of all input samples required, and therefore an increasing memory requirement with time. However rewriting the above expression as: (n + 1) y[n] =
n −1
x[k ] + x[n] = ny[n − 1] + x[n] 0
∴ y[n] =
n n +1
y[n − 1] +
1 n +1
x[n]
The expression is recursive, and calculation requires 2 multiplication, 1 addition and 1 memory location (y[n-1]). Recursive System: Systems whose output depends on past output values. In the previous example y[n0] = (n0 / n0+1)y[n0-1] + (1/ n0+1)x[n0], y[n0-1] is the initial condition at n = n 0. Computation of the output of a recursive system at a time say n 0 requires computation of the previous values of y[k] in correct order. Non-Recursive System: Such systems depend only on the present and past inputs inputs..
DSP2008.doc
12
Causal FIR systems are non-recursive. Their computation can be in any order Simple Recursive System: Let y[n] = ay[n-1]+x[n] & let initial condition be y[-1] y[0] = ay[-1] +x[0] 2 y[1] = ay[0] +x[1] = a y[-1] +ax[0] +x[1] 3 2 y[2] = ay[1]+x[2] = a y[-1] + a x[0]+ax[1]+x[2] n+1 n n-1 y[n] = a y[-1] + a x[0] + a x[1] + …..+ax[n-1]+x[n] or +
y[n] = a n 1 y[−1] +
n
= a x[n − k ] k
n≥0
k 0
For an initially relaxed system y[-1] = 0, and the output is the zero-state response or response. the Forced response. For a non-relaxed system, with x[n] = 0 for all n output is called zero input response or Natural or Free response.
Finite Dimensional LTI System: (M) A sub-class of LTI system characterised by a linear constant coefficient difference equation: N
=
d k y[n − k ] =
k 0
M
= p x[n − k ] k
k 0
where dk and pk are constants, N ≥ M and N is the order of the equation.
Linearity, Time Invariance and Stability: (P) Constant coefficient linear difference equation implies a time invariant system.
BIBO: Bounded Input Bounded Output Stable if and only if for every bounded input, and every bounded initial condition the total system response is bounded. Example: y[n] = ay[n-1] +x[n] Assume x[n] is bounded i.e. |x[n]| ≤ Mx ≤ ∞ for all n ≥ 0. Then
|y[n]| ≤ | a
n
n+1
y[-1] | +
= a x[n − k ] k
k 0
≤ |a|
n+1
|y[-1]| + Mx
n
= a
k
1− a
n +1
k 0
≤ |a|
n+1
|y[-1]| + Mx
1− a
= M y
DSP2008.doc
13
If n is finite My is finite irrespective of a, but as n Thus system is stable only if |a| < 1.
→ ∞, My is finite only if |a| < 1.
Z-Transform and Transfer Functions: Direct z-transform: (P) x[n] has a z-transform X(z) given by
X ( z ) =
∞
x[n] z −
n
n = −∞
where z is complex. The infinite series converges for a set of values of z (Region of Convergence – ROC) examples: 1. x[n] = [1,2,5,7,0,1] -1 -2 -3 -5 x(z) = 1 + 2z + 5 z + 7z + z ; ROC entire z-plane except z = 0 2. x[n] = [1,2,5,7,0,1] 2 -1 -3 x(z) = 1z + 2z + 5 + 7z + z ; ROC entire z-plane except z = 0,
∞
3. x[n] = [0,0,1,2,5,7,0,1] -2 -3 -4 -5 -7 x(z) = z + 2z + 5z + 7z + z ; ROC entire z-plane except z = 0 4. x[n] = δ [n] X(z) = 1; ROC entire z-plane 5. x[n] = δ [n - k], k > 0 X(z) = z – k ; ROC entire z-plane except z = 0 6. x[n] = δ [n + k], k > 0 k X(z) = z ; ROC entire z-plane except z =
∞
x[n] having infinite duration can be described by a closed form expression in z (infinite geometric series) example: n x[n] = α u[n] i.e. α n when n ≥ 0 and 0 when n < 0 has X ( z ) =
∞
α z n
0
−n
∞
= (α z −1 ) n 0
in closed form this is expressed as 1/(1- α z ), ROC | z | > | α | however if -1
DSP2008.doc
14
x[n] = -α u[-n-1] i.e. = 0 when n ≥ 0 and -α when n ≤ -1 -1 in closed form this is expressed as 1/(1-α z ), ROC | z | < | α | Thus the z-transform is the same for both series, only the region of convergence differs. Therefore it needs to be stated to uniquely identify the sequence. n n x[n] = α u[n] + b u[-n-1] has n
X ( z ) =
∞
n
α n z −n 0
−1
+ b n z −n −∞
The first converges for | z | > | α |, the second for | z | < | b | If | b | | α | ROCs do overlap giving a ring in the z-plane where both terms converge. Hence X(z) exists, with ROC |α| < |z| < |b|. This is the general case with two-sided infinite duration signals
POLES and ZEROS of Z-transform: (P) If X(z) is rational then X ( z ) =
N ( z ) D( z )
+ b1 z −1 + .... + b M z − M = − − a0 + a1 z 1 + .... + a N z N b0
Which can be expressed as M
X ( z ) = Gz
N − M
∏ ( z − z ) ∏ ( z − p ) k
1 N
k
1
where G = b0 /a0, then there are M finite zeros, N finite poles and N - M zeros (if N > M) or poles (if N < M) at the origin. Zeros and poles may also exist at The ROC of the z-transform does not contain poles, and is bounded by them.
∞
single pole - real signal: pole also must be real. –ve pole causes signal to alternate in sign. n double real poles in expression of type x[n] = na u[n]. unbounded increase even on unit circle.
DSP2008.doc
15
complex conjugates → exponentially weighted sinusoid, envelope varies as r , frequency depends on angle. double complex → even on unit circle increasing envelope Poles inside unit circle give bounded output, faster decay as pole is nearer to origin. poles outside unit circle give unbounded output and hence unstable n
Transfer Function: Let system have a linear coefficient difference equation y[n] = −
N
a k y[n − k ] +
1
M
b x[n − k ] k
0
taking z- transform with time shifting Y ( z ) = −
N
a k Y ( z ) z
− k
M
+ bk X ( z ) z −k
1
0
hence in above equation if ak =0 then for 1 ≤ k ≤ n H ( z ) =
M
b z k
0
M − k
=
1 z M
M
b z k
0
The multiple M poles at 0 are trivial, and there are M nontrivial zeros. This is an AllZero system, It has a finite duration Impulse response (FIR). If bk = 0 for 1 ≤ k ≤ n the system is an All-Poles system. Its impulse response is infinite duration (IIR). In the general case both poles and zeros exist. Because of the poles the system will be IIR.
Frequency response: (M) The frequency response is the complex DTFT of the LTI system. H (e jw ) =
+∞
− h[n]e −∞
jwn
Its magnitude is the magnitude response and its angle is the phase response. jw G(w) = 20 log10| H(e ) | dB is the GAIN function and – G(w) is called Attenuation or LOSS function. For a real impulse response h[n] magnitude response is even and phase response is odd. The negative of derivative of the angle θ(w) w.r.t. w is called the GROUP DELAY. DELAY.
DSP2008.doc
16
jw
jw
jw
For the LTI system Y(e ) = H(e ).X(e ) If the system is characterised by a constant coefficient difference equation N
=
d k y[n − k ] =
k 0
M
= p x[n − k ] k
k 0
then M
H (e jw ) =
= p e −
jwk
k
k 0 N
= d e −
jwk
k
k 0
The transfer function is a generalisation of the frequency response. -1 It is the z-transform of h[n], has real coefficients and is a rational polynomial in z . H ( z ) =
N 2
h[n] z −
n
N 1
jw
The frequency response is the transfer function evaluated at z = e . For a FIR filter, we have. Then for a causal FIR filter N1= 0 and N2 > 0, all poles are at the origin, and ROC is the entire z-plane except z = 0. For a finite dimensional IIR characterised by a difference equation the transfer function is a rational expression
+ p1 z −1 + p 2 z −2 + + p M z − M H ( z ) = −1 −2 − d 0 + d 1 z + d 2 z + + d N z N p0
which can be written as M
H ( z ) =
p0 d 0
z
N − M
∏ ( z − ξ ) ∏ ( z − λ ) k
1 N
k
1
where ξ1, ξ2, are the finite zeros and λ1, λ2 etc are the finite poles. There are additional N-M zeros or poles at origin. • FIR transfer function is always stable, For IIR all poles must be within the unit circle for stability. • Poles and zeros determine the filter behaviour, and may be placed to obtain a particular frequency response. • Poles near the points (but inside unit circle) emphasise the frequency corresponding to the point on the circle. • Zeros may be placed near frequency to be de-emphasised, and need not be within the unit circle.
DSP2008.doc
•
17
Complex zeros and poles must occur in conjugate pairs to make filter coefficients real
Geometric evaluation of the Frequency Response: (P) The z-transform of the LTI system may be expressed in terms of its poles and zeros N
∏ K ( z − z ) H ( z ) = ∏ ( z − p ) i
1 N
i
1
for N = M for simplicity
jwt
Frequency response is by substituting z =e with w from 0 to ws /2. jwt Thus H(e ) = K (U1∠θ1 U2∠θ2 ) / ( V1∠ϕ 1 V2∠ϕ 2). jwt Where U’s are the distances from the zeros to the point z = e , and V’s the distances from poles. Frequency response is obtained as one moves from z = 0 to z = -1. When p moves closer to a pole V decreases and thus magnitude response increases. Near zero opposite happens.
Examples of Frequency Response:
DSP2008.doc
18
LTI systems as Filters: (P) Ideal magnitude response characteristics of basic filter types are as under:
The gain in the pass band is unity and in stop band is 0 Ideal filters have linear phase response If a signal x[n] with frequency components in range w1 < w < w2 is passed through a filter with frequency response
DSP2008.doc
19
− jwn
H(w) = Ce o w1 < w < w 2 =0 otherwise − jwn the output has spectrum Y(w) = C.X(w)e o, and from the properties of Fourier transform y(n) = C.x(n - n0) the output is a delayed and scaled input, without distortion. Ideal Filters have linear phase characteristic in the pass-band. Θ(w) = −wn0 Derivative of the phase with respect to frequency has units of delay called Group Delay or Envelope delay. Ideal filters are not physically realisable but are mathematical idealisations. e.g. the ideal LPF has a impulse response hlp(n) = sin wc π n / π n with –∞ < n < ∞ , and is neither causal, nor absolutely summable.
LOW PASS: (P,M) To be lowpass, we must have poles near the unit circle near w = 0 and zeros near or on unit circle at w = π . Single pole filter 1− a H ( z ) = 1 − az −1 Constant factor is (1-a),to make the amplitude gain unity at w = 0 and the gain is small at high frequency. Addition of a zero at –1 attenuates response at high frequency further. H ( z ) =
1 − a 1 + z −1 2 1 − az −1
with a < 1 for stability jw
H (e ) jw 2
-1
2
=
(1 − a) 2 (1 + cos w) 2(1 + a 2 − 2a cos w)
jw
Here | H(e )| = H(z)H(z )| z = e is given by This is monotonically decreasing, it is maximum at w = 0 and is 0 at w =
π
DSP2008.doc
20
The 3 dB cut-off frequency is obtained from
(1 − a 2 (1 + cos wc )
2(1 + a 2
− 2a cos wc )
=
1 2
or 2
2
(1-a ) (1+ cos wc) = 1+a -2a cos wc 2
which gives cos wc = 2 a /(1+a ). Solving for a and considering the requirement for stability we get a = (1−sin wc)/cos wc Example: the M-point moving average system has
y[n] =
1
M −1
x[n − k ]
M k =0
= (1/M) 0 ≤ n ≤ M-1 =0 otherwise with M = 2 the transfer function is -1 H(z) = ½(1 + z ) Its frequency response is -jw/2 H(jw) = e cos(w/2) h[n]
jw
Thus magnitude response | H(e ) | = cos(w/2) is monotonically decreasing from 2 w = 0 to w = π and the –3 dB frequency is at cos (wc /2) = ½ i.e. at π /2 -1
a cascade of M such sections has w c = 2cos (2
-1/2M
)
for M =3 wc = 0.3 π and thus higher order has a sharper cut-off.
DSP2008.doc
21
A higher order moving average filter will be an even better approximation to ideal LP filter. Example: -1 2 A two pole LP filter is H(z) = b 0 /(1−pz ) 2 Determine b0 and p such that H(0) = 1 and |H(π /4)| = ½ Here when w = 0 j0 2 H(e ) = b0 /(1-p) = 1 at w = 0 2 so b0 = (1-p) At w = π / 4 j π /4 2 -j π /4 2 H(e )= (1-p) / (1-pe ) 2 2 = (1-p) / (1-p Cos(π /4) + j p sin(π /4)) 2 2 = (1-p) / (1-p/ √2 + jp/ √2) 4 2 2 2 Then (1-p) / [(1-p/ √2) + p /2] = ½ √2(1-p)2 = 1 + p2 – √(2p) Or -1 2 Solution is p = 0.32 giving H(z) = 0.46 / (1-0.32z )
High Pass: (P,M) Translating Hlp (w) by π radians (i.e. replacing w by w - π) converts it into a HP filter. i.e. Hhp(w) = Hlp(w - π) The frequency translation of π is equivalent to multiplication of impulse reponse hlp j n by e j n n Thus hhp(n) = (e ) hlp(n) = (−1) hlp(n) This means changing signs of the odd samples in hlp(n) n Conversely, hlp(n) = (−1) hhp(n)
Proof: Let the LPF be described by the difference equation y (n) = −
N
=
ak y (n − k ) +
k 1
M
= b x(n − k ) k
k 0
Its frequency response is M
H lp ( w) =
= b e−
jwk
k
k 0 N
1+
= a e−
jwk
k
k 0
replacing w by w- π gives M
= (−1) b e − k
H hp ( w) =
jwk
k
k 0 N
1+
= (−1)
k
ak e
− jwk
k 1
corresponding to the difference equation y (n) = −
N
= k 1
(−1) k ak y (n − k ) +
M
= (−1) b x(n − k ) k
k
k 0
DSP2008.doc
22
Example: The LPF y(n) = 0.9y(n-1) + 0.1x(n) give HPF y(n) = -0.9y(n-1) + 0.1x(n) –jw with frequency response as Hhp(w) = 0.1/(1− 0.9e ) Thus high pass single pole amplifier H ( z ) =
1 − a 1 − z
−1
2 1 + az −1
has the response
To get a HP FIR filter replace z in the moving average filter with –z to get -1 H(z) = ½ (1-z ). For M = 2, This has jw -jw/2 H(e ) = e sin(w/2) a higher order filter of the form H ( z ) =
1
M −1
− (−1) z M = n
n
n 0
yields a sharper HP response.
Band- Pass Filter and Band- Stop Filter: (M,P) A Band pass filter should contain one or more pairs of complex conjugate poles near the unit circle, near the frequency band that is the pass-band. H ( z )
=
1− a
1 − z
−2
2 1 − β (1 + a) z
−1
+ az − 2
Has centre frequency w0 = cos (β) and 3-dB bandwidth = cos (2a/(1+a )) A band stop filter has zero on the unit circle at the frequency w0, and has a transfer function of the form -1
H ( z ) =
1+ a 2
-1
2
+ z −2 − − 1 − β (1 + a) z 1 + az 2 1 − 2 β z
−1
Its notch frequency is w0 = cos (β) and 3-dB bandwidth is cos (2a/(1+a )) like in the BPF. -1
-1
2
Example: Design a two pole BPF with pass-band centred at w = π /2 zeros at w = 0 and magnitude response is 1/ √2 at w = 4 π / 9 ± j π /2
Let the poles be p1,2 = re
and zeros be at –1 and 1
π and
DSP2008.doc
23
Then H ( z ) = G
( z − 1)( z + 1)
=G
( z − jr )( z + jr )
z 2 − 1 z 2
+ r 2
The frequency response at π /2 is 2 π =1 = G 2 ( ) r − 1 2
H
2
or G = (1-r )/2 Evaluating |H(4 π /9)|2 at w = 4 π /9 2
(1 − r ) 2 − 2 cos(8π / 9) 4π = H = 4 1 + r 4 + 2r 2 cos(8π / 9) 9 which gives 2 2 2 4 1.94(1-r ) = 1 − 1.88 r + r which is having solution 2 r = 0.7, so the system function is -2 −2 H(z) = (0.15)(1−z )/(1+ 0.7z ) 2 2
1 2
Digital Resonator:
This is a two-pole BPF with a pair of complex conjugate poles near the unit circle. Angular position of the poles determines the resonant frequency. For resonance at w = w0 we select poles at ± jw 0
View more...
Comments