DSP

94
Downloaded from www.jayaram.com.np - By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 1 DIGITAL SIGNAL PROCESSING BEG 433 EC .Year: IV Semester: II Teaching Schedule Hours/Week Examination Scheme Theory Tutorial Practical Internal Assessment Final Theory Practical* Theory Practical** 3 - 3/2 20 25 80 - Total 125 * Continuous ** Duration: 3 hours Course objectives: To provide 1. Discrete signals 5 1.1 Discrete signals – unit impulse, unit step, exponential sequences 1.2 Linearity, shift invariance, causality 1.3 Convolution summation and discrete systems, response to discrete inputs 1.4 Stability sum and convergence of power series 1.5 Sampling continuous signals spectral properties of sampled signals 2. The discrete Fourier transforms 5 2.1 The discrete Fourier transform (DFT) derivation 2.2 Properties of the DFT, DFT of non-periodic data 2.3 Introduction of the fast fourier transform (FFT) 2.4 Power spectral density using DFT/FFT algorithms 3. Z transform 8 3.1 Definition of Z transform one sided and two sided transforms 3.2 Region of convergence relationship to causality 3.3 Inverse Z transform – by long division, by partial fraction expansion. 3.4 Z transform properties – delay advance, convolution, Parseval’s theorem 3.5 Z transforn transfer function H (Z) –transient and steady state sinusoidal response pole zero relationships, stability 3.6 General form of the linear, shift invariant constant coefficient difference equation 3.7 Z transform of difference equation. 4. Frequency response 4 4.1 Steady state sinusoidal frequency response derived directly from the difference equation 4.2 Pole zero diagrams and frequency response 4.3 Design of a notch filter from the pole zero diagram. 5. Discrete filters 6 5.1 Discrete filters structures, second order sections ladder filters frequency response 5.2 Digital filters finite precision implementations of discrete filters 5.3 Scaling and noise in digital filters, finite quantized signals quantization error linear models.

Transcript of DSP

Page 1: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 1

DIGITAL SIGNAL PROCESSING BEG 433 EC

.Year: IV Semester: II Teaching Schedule

Hours/Week Examination Scheme

Theory Tutorial Practical Internal Assessment Final

Theory Practical* Theory Practical** 3 - 3/2 20 25 80 -

Total

125

* Continuous ** Duration: 3 hours Course objectives: To provide 1. Discrete signals 5 1.1 Discrete signals – unit impulse, unit step, exponential sequences 1.2 Linearity, shift invariance, causality 1.3 Convolution summation and discrete systems, response to discrete inputs 1.4 Stability sum and convergence of power series 1.5 Sampling continuous signals spectral properties of sampled signals 2. The discrete Fourier transforms 5 2.1 The discrete Fourier transform (DFT) derivation 2.2 Properties of the DFT, DFT of non-periodic data 2.3 Introduction of the fast fourier transform (FFT) 2.4 Power spectral density using DFT/FFT algorithms 3. Z transform 8 3.1 Definition of Z transform one sided and two sided transforms 3.2 Region of convergence relationship to causality 3.3 Inverse Z transform – by long division, by partial fraction expansion. 3.4 Z transform properties – delay advance, convolution, Parseval’s theorem

3.5 Z transforn transfer function H (Z) –transient and steady state sinusoidal response pole zero relationships, stability

3.6 General form of the linear, shift invariant constant coefficient difference equation

3.7 Z transform of difference equation. 4. Frequency response 4

4.1 Steady state sinusoidal frequency response derived directly from the difference equation

4.2 Pole zero diagrams and frequency response 4.3 Design of a notch filter from the pole zero diagram. 5. Discrete filters 6

5.1 Discrete filters structures, second order sections ladder filters frequency response 5.2 Digital filters finite precision implementations of discrete filters

5.3 Scaling and noise in digital filters, finite quantized signals quantization error linear models.

Page 2: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -2

6. HR Filter Design 7

6.1 Classical filter design using polynomial approximations – Butterworth Chebishev 6.2 HR filter design by transformation matched Z transform impulse, invariant transform and

bilinear transformation 6.3 Application of the bilinear transformation to HR low pass discrete filter design 6.4 Spectral transformations, high pass, band pass and notch filters. 7. FIR Filter Design 3 7.1 FIR filter design by fourier approximation the complex fourier series

7.2 Gibbs phenomena in FIR filter design approximations, applications of window Functions to frequency response smoothing rectangular hanning Hamming and Kaiser windows.

7.3 FIR filter design by the frequency sampling method 7.4 FIR filter design using the Remez exchange algorithm 8. Digital filter Implementation

8.1 Implementations using special purpose DSP processors, the Texas Instruments TMS320. 8.2 Bit serial arithmetic distributed arithmetic implementations, pipelined implementations

Laboratory:

1. Introduction to digital signals sampling properties, aliasing, simple digital notch filter behaviour 2. Response of a recursive (HR) digital filter comparison to ideal unit sample and frequency

response coefficient quantization effects. 3. Scaling dynamic range and noise behaviour of a recursive digital filter, observation of nonlinear

finite precision effects.

Page 3: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 3

Digital Signal processing:- Application:-

1) Speech recognition. 2) Telecommunication.

Digital Signal processing over analog signal processing:

1) Accuracy. 2) Offline processing. 3) Software control. 4) Cheaper than analog counterpart.

Basic element of D.S.P system:-

A/DConverter

Digitalsignal

processing

D/AConverter

Digitalinput signal

Digitaloutput signal

Analogoutput signal

Analoginput signal

Fig: Block diagram of DSP - Most of the signal encountering science and engineering are analog in nature i.e the signals are

function of continuous variable substance in usually take on value in a continuous range. - To perform the signal processing digitally, there is need for interface between the analog signal and

digital processor. This interface is called analog to digital converter. The o/p of A/D converter is digital signal i.e appropriate as an i/p to the digital processor.

- Digital signal processor may be a large programmable digital computer or small microprocessor program to perform the desired operation on i/p signal.

- It may a also be a hardwired digital processor configure to perform a specified set of operation on the i/p signal.

- Programming machine provide the flexibility to change the signal processing operation through a change in software whereas hardwired m/c are difficult to reconfigure.

- In application where the distance o/p from digital signal processor is to be given to the user in analog form, we must provide another interface on the digital domain into analog domain. Such an interface is called D/A converter.

Advantage of Digital over analog signal processing:- 1. A Digital programmable system allows flexibility in reconfiguring the digital signal processing

operation simply by changing the program. Reconfiguration of analog system usually implies redesign of hardware followed by testing and verification to see that if operates properly.

2. Digital system provide much better control of accuracy requirements. 3. Digital system are easily stored on magnetic media without loss of signal ………… beyond that

introduce in A/D conversion. As a consequence, the signals become transportable and can be processed offline in a remote laboratory.

Page 4: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -4

4. Digital signal processing method also allows for the implementation of more sophisticated. 5. In some cases a digital implementation of signal processing system is cheaper than its analog counter

part. * Signal: It is defined as any physical quantity which is a function of one or more independent variable and contains some information. In electrical sense, the signal can be voltage or current. The voltage or current is a function of time as an independent variable. The independent variable in the mathematical representation of a signal may be either continues or discrete. Continues time signals are defined analog continues times. Contineous time signals are often referred to as analog signals. Discrete time signals are defined as certain time instant. Digital signals are those for which both time and amplitude discrete. Discrete- time signals or sequence:- D.T.S are re………. mathematically as a sequence of numbers. A sequence of numbers x in which the nth no in the sequence is denoted by x(n) and written as: x = x(n) - infinity < n < infinity Figure: • unit sample or unit impulse sequence:

It is denoted by δ(n) and defined as:

=≠

=11

00)(

n

nnδ

-1-2 1 2n

* Unit step sequence: It is denoted by U(n) and is defined as: U(n) = 1 , n ≥ 0 = 0, n<0

1 2 30 U(n) = δ(n) + δ(n-1) + δ(n-2)+ …………

Page 5: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 5

= ∑∞

−0

)( knδ

U(n) = ∑∞

−∞=k

k)(δ

i.e the value of unit step sequence at time n is equal to the accumulated sum of value at index n and all prvious value of impulse sequence. Conversely the impulse sequence can be expressed as the first backward difference of unit step sequences. i.e. δ(n) = u(n) – u(n-1) * Unit ramp sequence:- It is denoted by ur(n) and defined as ur(n) = n n ≥ 0 = 0 n < 0

n

12

3

4

* Exponential Sequence:- The exponential signal is a sequence of the form x(n) = an for all n. If the parameter ‘a’ is real, then x(n) is real signal. Fig illustrate x(n) for various values of parameter ‘a’.

0<a<1

n

a>1

n

a<1

Fig: Graphical representation of Exponential signals.

0 < a < 1: Eg a = ½ i.e (1/2)n = 0, ½ , ¼, 1/8 (exponential decreasing) (see figure (i))

Page 6: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -6

a > 1, E.g , a = 2 i.e (2)n = 1,2, 4, 8 (Exponential increasing) (See figure (ii)) -1 < a <0 Eg.: -1/2 i.e (-1/2)n = 1, -1/2, ¼, -1/8 (See fig (iii) ) a <-1 E.g a = -2 (-2)n = 1, -2, 4, -8 (See figure(iv) ) Exponential sequence:- When the parameter ‘a’ is complex values , it can be expressed as: a = rejθ Where r and θ are new parameters. Hence, we can express x(n) as: X(n) = rn ejθ = rn (cos θn + jsin θn) Since, x(n) is now complex values, it can represented graphically by plotting the real part, xe(n) = rncos θn as a function of n and separately plotting the imaginary part. xi(n) = rsinθn as a function of n. Fig. illustrates the graphs fo

Xe(n) and xi (n) .

n

n

Page 7: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 7

We observe that the signals xe(n) and xi(n) are damaged (decaying exponentially, i.e r <r ) cosine function and damped sine function. If r =1 , the damping disappears and xe(n) , xi(n) and x(n) have fixed amplitude which is unity. Alternatively, the signal x(n) can be represented graphically by the amplitude function. |x(n)| = A(n) = rn And phase function

∠x(n) = ø(n) = θn Representation of discrete-time signal: - 1) Functional representation:-

E.g x(n) = 1 , for n = 1,3 = 4, for n = 2 = 0 elsewhere, 2) Tabular representation:

n ----- 2 -1 0 1 2 3 4 x(n) ----- 0 0 0 1 4 1 0

3) Sequence representation: X(n) = ………0 , 0, 1, 4, 1, 0, ………. Infinite duration . X(n) = 0, 1, 4, 1) finite duration (4- point sequence) 4) Graphical representation:- Figure:

Date: 2066/05/23 Linearity: A system is called liner of superposition principal applies to that system. This means that the liner system may be defined as one whose response to the sum of weighted inputs is same as the sum of weighted response. Let us consider a system. If x1(n) is the input and y1(n) is the output. Similarly y2(n) is the response to x2(n) . Then for liner system. )()()()( 22112111 nyanyanxanxa +→+ ………………..(1) For any nonlinear system the principle of superposition doesnot hold true and equation (i) is not satisfied. Numerical: For the following system, determine whether the system is liner or not. (1) y(n) = 2x(n) +3 Solution: y1(n) = 2x1(n)+3 y2(n) = 2x2(n)+3

Page 8: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -8

Applying superposition principle suppose, x(n) = a1x1(n)+a2x2(n) Then, y3(n) = 2[a1x1(n)+a2x2(n)]+3 = 2a1x1(n)+ 2a2x2(n)+3 y4(n) = a1y1(n)+ a2y2(n) = a1 [2x1(n)+3]+ a2[2x2(n)+3] = = 2x1(n)a1 +2a2x2(n)+3a1+3a2 Since, )()( 43 nyny ≠ . The system is nonlinear.

(ii) y(n) = x2(n) Solution: )()( 2

11 nxny =

)()( 222 nxny =

Applying input such that, x(n) = a1x1(n)+a2x2(n) The response will be, y3(n) = [a1x1(n)+a2x2(n)]2 and again, y4(n) = a1y1(n)+a2y2(n) = )()( 2

22211 nyanxa +

)()( 43 nyny ≠∴ The system is nonlinear.

Shift invariance:- A system is shift invariant, if the input output relationship doesnot vary with shift. In other words for a shift invariant system shift in the input signal results in corresponding shift in output. Mathematically, )()( nynx → Which means that y(n) is the response for x(n). If x(n) is shifted by n0, then output y(n) will also be shifted by same shift n0 i.e

)()( 00 nnynnx −→−

Where n0 is an integer. If the system doesnot satisfy above expression, then the system is called shift variant system. The system shifting both linearly and time invariant properties are popularly known as liner time invariant system or simply LTI systems. Numerical: Check whether the system are shift invariant or not. (i) )()( 2 nxny = Solution: Let us shift in input by n0, then the output will be,

Page 9: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 9

)()( 02

1 nnxny −=

)()( 01 nnyny −=∴

Hence the system is shift invariant system. (ii) y(n) = x(mn) Let us shift in input by n0 then, response will be, y1(n) = x(mn – n0) and the shift in output by n0 will yields.

][)( 00 mnmnxnny −=−

∴ The system is shift variant. Causality:- A system is causal of the response does not begin before the input function is applied. This means that of input is applied at n= n0 , then for causal system output will depend on values of input x(n) for 0nn ≤ .

Mathematically, ]),([)( 00 nnnxTny ≤= ……………..(i)

The response of causal system to an input doesnot depend on future values of that input but depends only on present or past values of input. On the other hands, of the response of the system to an input depends on future values of the input, the system is noncausal. A non causal system doesnot satisfy equation (i). Causal system are physically realizable whereas non causal system cannot be implemented practically. There is no system possible practically which can produce its output before input is applied. The equation, )1()( −= nxny describes the causal system and )1()()( +−= nxnxny describe the non causal system. Memory less system:- A system is referred to as memory less if the o/p y(n) at every value of n depends only on the i/p x(n) at the same value of n.

Date: 2066/05/25 * Response of LTI system to Arbitrary input convolution solution:- Consider any arbitrary discrete time signal x[n] as shown in fig:

n1 2 3-1 0

A discrete time sequence signal be represented by a sequence of individual impulses as shown in figure:

Page 10: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -10

-1

0-2

1 2 3

-1 0 1

x(0)δ(n)

20 1

x(1)δ(n-1)

We can write, X(n) = …………+x(-1)δ(n+1) +x(0) δ(n) +x(1) δ(n-1) +x(2) δ(n-2) + ………..

= )(..........)()( iknkxk

−∑∞

−∞=

δ (convolution sum)

Suppose h(n) is the o/p of LTI system when δ(n) is i/p. Therfore, the o/p for i/p x(-1) δ(n+1) is x(-1) h(n+1). Then the o/p y(n) for the i/p x(n) given in equation (i) will be,

)(..........)()()( iiknhkxnyk

−= ∑∞

−∞=

Symbolically, y(n) = x(n)* h(n) ………(iii) y(n) = h(n)*x(n) ……….(iv) Numericals: * The impulse response of invalid time response is: h(n) = 1, 2, 1, -1 x(n) = 1,2,3, Solution: The response of the LTI system is ,

y(n) = )()( knhkxk

−∑∞

−∞=

For n = 0 ,

y(0) = )()( khkxk

−∑∞

−∞=

Page 11: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 11

k

1

2

3

3k

2

3

2

1 320

k3

2

1 1

-1

-2

422

)1()1()0()0(

)()(1

0

=+=−+=

−∑=

hxhx

khkxk

k0 1

2 2

For n = -1

y(-1) = )1()( khkxk

−−∑∞

−∞=

0

2

1 1

-2

-2 -1-3

n(-1-k)

1

x(k)n(-1-k)

For n = -2

Y(-2) = )2()( khkxk

−−∑∞

−∞=

Page 12: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -12

Again testing for +ve side: For n= 1

Y(1) = )1()( khkxk

−∑∞

−∞=

= 1+4+3 = 8

2

1 1

-1

-1

0 1 2k

4

1 3

k

x(k)(1-k)

0

For n = 2

Y(n) = )2()( khkxk

−∑∞

−∞=

= -1+2+6+1 = 8

6

1

-1

3k

0

1 2

2

x(k)h(1-k)

2

3

-1

3k

0

1 2

1

For n = 6 = 0 Y(n) = …….0, 1, 4, 8, 8, 3,-2, -1, 0 …….) Figure: * Determine the o/p y(n) of relaxed linear time invariant system with impulse response: h(n) = an u(n) , |u| < 1 When the i/p is unit step sequence ie; x(n) = u(n) Solution:-

y(n) = ∑∞

−∞=

−k

knhkx )()(

For n = 0 ,

y(0) = ∑∞

−∞=

−k

khkx )()(

Page 13: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 13

3k

1 2

1 1 11

0 3k

1 2

aa2

1

1

0

k

1

a3

a

a2h(-k)

-3 0-2 -1 For n =1:

y(1) = ∑∞

−∞=

−n

khkx )1()( =1+a

k

1

a2

a

a2 h(1-k)

0-1 21k

1

a

x(k)h(1-k)

0 For n = 2:

y(2) = ∑∞

−∞=

−k

nhnx )2()( = 1+a+a2

k

1

a

x(k)h(2-k)

1

a2

0 2 For n < 0 y(n) = 0

y(∞) = lim n ∞→ y(n) = lim n ∞→a

a n

−− +

1

1 1

= a−1

1

S = r

ra n

−−

1

)1(

For n > 0 y(n) = 1+a2 + …….+an

= a

a n

−−

1

1

Page 14: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -14

k1

y(n)

0 2

1 1+a1+a+a2

11-a

* Interconnection of LTI system:-

h1(n) h2(n) y(n)

h1(n)*h2(n) y(n)

When two LTI systems with impulse response h1(n) and h2(n) are in cascade form the overall impulse response for the cascaded 2 impulse system will be, h(n) = h1(n) * h2(n) ………(i) * The parallel combinations of LTI systems and equivalent system is shown below:

h1(n)

h2(n)

y(n)x(n)

h1(n)+h2(n) y(n)

Determine the impulse response for the cascade of two LTI systems having impulse responses. h1(n) = (1/2)n u(n) h2(n) = (1/u)n u(n) Solution:- The overall impulse response is h(u) = h1(n)* h2(n)

= ∑∞

−∞=

−k

knhkh )()( 21

k

1/4

1/21

h1(k)

k

1/6

1/41

h2(k)

Page 15: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 15

k

1/4

1/6

h2(-k)1

k

1/4

1/6

1

n > 0

h(n-k)

= ( )∑=

−n

k

knk

0

4/1)2/1(

= (1/4)n ( )∑=

−n

k

kk

0

4/1)2/1(

= (1/4)n ∑ k)2(

= (1/4)n

−−+

12

12 1n

= (1/4)n (2n+1-1) = (1/2)n [ 2 – (1/2)n] , n ≥ 0 Note:- If we have ‘L’ LTI system is cascade with impulse responses h1(n) and h2(n) ……….hL(n) , the impulse response of equivalent LTI system is h(n) = h1(n) * h2(n)*h3(n) ……..*hL(n) Discrete system response to discrete input:- For a discrete-time system, consider as input sequence x(n) = ejwn, for -∞ <n< ∞ the output of LTI system with impulse response h(n) is,

y(n) = ∑∞

−∞=−

k

knxkh )()(

= ∑∞

−∞=

k

knjwekh )()(

= ∑∞

−∞=

k

jwkjwn ekhe )(

If we define,

H|ejw| = ∑∞

−∞=

k

jwkekh )(

Then, y(n) = H|ejw| ejwn H|ejw| describes the change in complex amplitude of complex exponential as a function of frequency w. H(ejw) is called frequency response of the system. In general H(ejw) is complex and can be expressed in terms of its real and imaginary parts as: H (ejw) = HR (ejw)+j HI (e

jw) Or , In terms of magnitude and phase as,

Page 16: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -16

H(ejw) = |H(ejw)|ej∠

H(ejw) Let, x(n) = Acos(won +ø) = A/2 ejwon.ejø +A/2 e-jwon. e-jø The response to x1(n) = A/2 ejø ejwon is, y1(n) = H(ejw) A/2 ejø ejwon

The response to x2(n) = A/2e-jø e-jwon is , y2(n) = H(e-jw) A/2 e-jø. e- jwon Thus, total response is , y(n) = A/2 [H(ejwo)e-jø. ejwon +H(e-jwo)e-jø . e-jwon] = A |H(e-jwo)| cos(won+ø+θ).

Where, θ = ∠ H(ejwo)

Date: 2066/05/31 Stability : We defined arbitrary relaxed system as BIBO stable. If an only if o/p sequence y(n) is bounded for every bounded i/p x(n). If x(n) is bounded their exist a constant Mx such that, ∞<≤ xMnx )(

Similarly if o/p is bounded their exists a constant My such that ,)( nallforMny y ∞<≤

Now given such a bounded input sequence x(n) to LTI system with convolution formula.

∑∞

−∞=

−=k

knxkhny )()()(

∑∞

−∞=

−≤k

knxkh )()(

∑∞

−∞=

−≤k

knxkh )()(

∑∞

−∞=

≤k

x khM )(

From this expression we observe that the system is bounded if the impulse response of the system satisfied condition,

∑∞

−∞=

∞<=k

n khS )(

That is linear time invariant system is stable if its impulse response is absolutely summable. # Determine the range of value of the parameter a for LTI system with impulse response. h(n) = an u(n) is stable. Solution,

Page 17: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 17

∑∞

−∞=

∞<=k

n khS )(

∑ ∑∞

=

=

==0 0

)(k k

kakh

.............1 32 ++++= aaa

aa −

= 1 Provided that 1<a

Therefore the sytem is stable if 1<a otherwise it is unstable.

# Determien range of value of a,b for which LTI system with impulse response. 0)( ≥= nanh n

0<= nb n is stable.

∑∑∑∞

=

−∞=

−∞=

+==0

1

)(k

kk

kk

n abkhS

The first sum coverage for 1<a . The second sum can be manipulated as,

∑∑∞

=

−∞=

=1

1 1

kk

k

k

bb

..............111

32+++=

bbb

+++= ..........

111

132

bbb

...........1 32 ++++= βββ

)1/1( ββ −= Provided that , 11 >< borβ

Hence the system is stable is both 11 >< bora

Date: 2066/07/23

# Determine whether the given system is BIBO stable or not. y (n) = 1/3 [ x(n) +x(n-1) +x (n-2)] Solution:- Assume that, |x(n)| < Mn < ∞ for all n. Then | y(n)| = 1/3 [ x(n) +x(n-1) +x (n-2)] ≤ 1/3 [ |x(n)| +|x(n-1)| +|x (n-2)|] ≤ 1/3 [ Mx + Mx + Mx ] ≤ Mx

BIBO = Bounded input bounded output.

Page 18: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -18

Since, Mx is finite value , |y(n)| also finite. Hence the system is BIBO stable. # # Determine whether the given system is BIBO stable or not. Y(n) = rnx(n) where r>1. Solution: Assume

)()( nxrny n=

)(nxr n=

With r >1, the multiplying factor rn diverges for increasing n and he=nce o/p not bounded. Hence the system is BIBO unstable. Nyquist Sampling theorem:- A signal whose spectrum is band limited to B Hz (G(w) = 0 for |w| > 2πB ) can be reconstructed exactly form its samples taken uniformly at the rate R > 2BHz (sample/sec) . In other words, minimum sampling frequency fs = 2Bhz. Consider a signal g(t) whose spectrum is band limited to Bhz. Sampling g(t) at the rate of fs hz can be accomplished by multiplying g(t) by impulse δTs (t) consisting of unit impulses repeating periodically every Ts second. Where, Ts = 1/fs Figure; Trigonometric fourier series of impulse train,

[ ]

)()()(

.............3cos22cos2cos11

)(

ttgtg

twtwtwT

t

Ts

ssss

Ts

δ

δ

=

++++= Where, Ws = 2π/Ts

[ ]......3cos)(22cos)(2cos)(2)(1 ++++= twtgtwtgtwtgtg

Ts sss

Using modulation property, 2g(t) coswst ↔ (F.T) G(w-ws)+G(w+ws)

[ ].......)()()(1

)( +++−+= sss

wwGwwGwGT

wG

∑∞

−∞=

−=n

ss

nwwGT

)(1

If we want to reconstruct g(t) from g(t) bar we should be able to recovered G(w) form )(wG . This is

possible if there is no overlap between successive cycle of ( )wG . Figure (e) shows that this requires fs greater then 2B.

Page 19: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 19

From figure we see that g(t) can be recovered form sample )(tg by passing sampled signal through ideal low pass filter with bandwidth B hz.

Date:2066/7/26 Sampling of analog signals: There are many ways to sample analog signal. We limit our discussion to periodic or uniform sampling which is he types of sampling used most often in topic in practice . This is described by the relation. X(n) = xa(nT), - ∞ < n < ∞ Where x(n) is discrete-time signal obtained by talking samples of analog signal xn(t) every T second. T = sampling period or sample interval. Fs = 1/T = damping frequency or sampling rate (sample/sec or Hz) t = nT = n/Fs

In general the smapling of continuous time sinusoidal signal

)2cos()( 0 θπ += tfAtxa

With sampling rate T

f s

1= results discrete time signal.

)2cos()( θπ += ftAnx

Where, sf

ff 0= = Relative frequency of sinusoid.

Q. Consider the analog signal xa(t) = 3cos100πt a) Determine the minimum sapling rate require to avoid aliasing. b) Suppose that the signal is sampled at the rate Fs= 200 hz What is the discrete time signal obtained after sampling. c) Suppose that the signal is sample at the rate Fs= 75 hz what is the discrete time signal obtained after sampling. d) What is the frequency 0< f< Fs/2 of a sinusoids that yields samples identical to those obtained in part c. Solution:- Xk(t) = 3cos100 πt 2 πf0 = 100 π F0 = 50 hz

b) Mininum sampling rate = 100 hz c) Fs= 200 hz d) Fs = 75 hz X(n) = 3cos(100 π n/fs) = 3cos(100 π n/75) = 3cos(4 πn3) = 3cos2 π(2/3)n =3cos2 π(1 -1/3)n = 3cos2 π(1/3)n e) Fs = 75 hz , f= 1/3

f = F0/Fs , F0 = f Fs = 25 hz

Page 20: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -20

y(t) = 3cos50 πt Q. Consider the analog signal at xa(t) = 3cos50 πt + 10sin300 πt-cos100 πt. What is the Nequest rate for this signal. Solution: - Frequency present in the signal, F1 = 25hz, F2 = 150 hz , F3 = 50 hz Fmax = 150 hz Nyquest rate = 2Fmax = 300 hz. Q. Consider the analog signal at xa(t) = 3cos 2000πt+5sin6000 πt+10cos2000 πt. a) What is the Nyquest rate for the signal. b) Assume now that we sample the signal using sampling rate Fs = 5000 samples per second. What is the discrete time signal obtained after sapling. Solution: a) F1 = 1khz F2 = 3khz F3 = 6khz Nyquest rate = 12 khz b) Fs = 5000 hz = 5khz x(n) = 3cos(2000 π n/Fs) + 5sin(6000 π n/Fs)+10cos(12000 π n/Fs) = 3cos(2 πn/5) +5sin(6 πn/5) + 10cos(12 πn/5) = 3cos(2 πn/5)+ 5sin2 π(3/5)n+10cos2 π(6/5)n =3cos(2 πn/5)+ 5sin2 π(1−2/5)n+10cos2 π(1+1/5)n =3cos(2 πn/5)- 5sin2 π(2/5)n+10cos2 π(1/5)n =13cos(2πn/5)-5sin2π(2/5)n

Date: 2066/07/26 Chapter:- 2 Discrete Fourier transform:- Frequency domain sampling: Discrete Fourier transform. (DFT) Let us consider aperiodic discrete-time signal x(n) with Fourier transform

∑∞

−∞=

−=n

jwnenxwX )()( ……….(i)

Suppose that we sample X(w) periodically in frequency at a spacing of δ(w) radian between the successive samples. Since X(w) is periodic with period 2π only samples in the fundamental frequency range are necessary. We take N equidistant sample in the interval 0 <= w <=2π . With sample spacing δw = 2π/N

0 kωδω

2πω

Fig: Freq. domain sampling.

Page 21: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 21

If we evaluate, equation (i) we get, W = 2π/N. K, k = 0 to N-1

∑∞

−∞=

−=

n

NknjenxN

kX /2)(

2 ππ

Summing in equation (2) can be subdivided into infinite number of summations where each sum contains N terms Thus,

.......)()()(......2 13

2

/212

/21

0

/2 ++++=

∑∑∑

=

−−

=

−−

=

−N

Nn

NknjN

Nn

NknjN

n

Nknj enxenxenxN

kX ππππ

= ∑∑−+

=

−∞

−∞=

1

ln

/2)(NlN

n

Nknj

l

enx π

If we change the index in the inner summation form n to n-ln and integrating the order of summation we obtained,

∑ ∑−

=

−−

=

−=

1

0

/21

0

)(2 N

n

NknjN

n

enlnxN

kX ππ

………..(3)

The signal

Xp(n) = ∑∞

−∞=−

l

nlnx )( ……..(4)

Obtained by period representation of x(n) every N samples is clearly period with fundamental period N.

Since xp(n) is period extension of x(n) given by equation (4) it is clear that x(n) can be recovered from xp(n) if there is no alising in the time domain that is x(n) is limited to less than the period N of xp(n)

Ln

1

x(n)

n

xp(n)

L N

N > L

Page 22: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -22

n

N < L

xp(n)

In summary a final duration sequence x(n) of a length L as fourier transform ∑−

=

−=1

0

)()(L

n

jwnenxwX

for 0 <= w <= 2π …………….(5) When we sample X(w) at equal space frequency wk = 2πK/N , k = 0,1, 2 ……N-1 Where, N ≥ L, The resultant sample are,

∑−

=

−=

=1

0

/2)(2

)(N

n

NknjenxN

KXkX ππ

…………. (6)

Where, k = 0, 1, ………N-1 The relation in equation (6) is a formula for transforming sequence x(n) of length L <= N into a sequence of frequency samples X(k) of length L. Since the frequency samples are obtained by evaluating the fourier transform X(w) at a set of N equally spaced discrete frequencies. The relation in equation (6) is called discrete fourier transform (DFT) of x(n).

Date:- 2066/7/27 xp(n) can be written as,

xp(n)= ∑−

=

1

0

/2N

k

Nknjk ea π n = 0, 1, ………N-1 ….(7)

With Fourier coefficient,

ak = 1/N ∑−

=

−1

0

/2)(N

k

Nknjp enx π k = 0, 1, ……..N-1 ……….(8)

Form equation (3) and (8)

ak = 1/N

kπ2 k = 0, 1, …..N-1 …….(9)

Therefore ,

xp(n) = 1/N ∑−

=

1

0

/22N

k

NknjeN

kX ππ

n = 0, 1, ……..N-1 …….(10)

This relation allows us to recover the sequence x(n) from frequency sample.

x(n) = 1/N ∑−

=

1

0

/2)(N

k

NknjekX π n = 0, 1 …….N-1 …….(11)

This is called inverse DFT (IDFT) ( DFT as linear transformation:-

Page 23: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 23

The formula for DFT and IDFT is given by

∑= knNwnxkX )()( , k = 0, 1 …….N-1 ……..(1)

∑−

=

−=1

0

)(1

)(N

k

knNwkX

Nnx n = 0, 1, …….N-1 ……..(2)

Where WN = e-j2π/N ……….(3) Let us define N-point vector xN of signal sequence x(n) , n = 0, 1, ……N-1 and N-point vector Xn of frequency samples and N*n matrix WN as

xN=

−=

− )1(

)1(

)0(

)1(

)1(

)0(

NX

X

X

X

nx

x

x

N WN =

−−−−

)1)(1()1(21

)1(242

121

1

.

1

1111

NNN

NN

NN

NNNN

NNNN

WWW

WWW

WWW

With there definition N-point DFT may be expressed in matrix XN = WN xN ……..(4) Where, WN = matrix of liner transformation.

Equation (4) can be inverted by per multiplying both side by WN-1. Thus we can obtained xN = wN

-1XN

…..(5) Which is expression for IDFT xN = 1/N WN

x XN ……..(6) Where, WN

* = complex conjugate of matrix WN WN

-1 = WN*/N ……..(7)

Q. Compute DFT of 4-point sequence x(n) = 0, 1, 2, 3 Solution:-

∑−

=

−=1

0

/2)()(N

n

NknjenxkX π

∑=

−=3

0

2/)()(n

knjenxkX π

∑=

=+++==3

0

0 6)3()2()1()0()()0(n

xxxxenxX

∑=

−−−− =+++==3

0

2/32/2/ 6)3()2()1()0()()1(n

jjjnj exexexxenxX ππππ

X(2) = -2 X(3) = -2.4 By matrix method,

Page 24: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -24

W4 =

−−−−

−−

jj

jj

11

1111

11

1111

xN =

=

)3(

)2(

)1(

)0(

3

2

1

0

4

X

X

X

X

X

X4 =W4 * x4

=

−−−−

−−

jj

jj

11

1111

11

1111

*

3

2

1

0

=

−−−

+−=

−−+−+−+−−+++

j

j

jj

jj

22

2

22

6

320

3210

320

3210

Q. Compute IDFT for the frequency component X(k) = 60, 0, -4, 0 Solution:- xN =( WN

*/N ) XN x4 =( W4*/4) X4

X4 =

−0

4

0

60

W4 =

−−−−

−−

jj

jj

11

1111

11

1111

x4 =( W4

*/4) X4

= ¼

−−−−

−−

jj

jj

11

1111

11

1111

−0

4

0

60

Page 25: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 25

= ¼

+−+−

460

460

460

460

= ¼

64

56

64

56

=

16

14

16

14

Properties of DFT:- The notation used to denote N-point DFT pair x(n) and X(k) as x(n) DFT X(k) 1) Periodicity:

If x(n) DFT X(k) Where, x(n+N) = x(n) for all n. X(k+N) = X(k) for all k.

Proof:

x(n+N) = 1/N∑ + NNnkjekX /)(2)( π

= 1/N∑−

=

1

0

2/2)(N

K

kjNknj eekX ππ

= x(n)

X(k+N) = ∑−

=

+1

0

/)(2)(N

n

NNkkjekn π

= ∑−

=

1

0

2/2)(N

n

njNknj eekX ππ

=X(k) 2) Linearity: -

If x1(n) DFT X1(k) and x2(n) DFT X2(k) Then, for any real or complex valued constants a1 and a2 x(n) = a1x1(n) +a2x2(n) DFT X(k) = a1X1(k)+a2X2(k)

Proof:-

a1x1(n) +a2x2(n) DFT ∑−

=

−+1

0

/22211 )()(

N

n

Nknjenxanxa π

= ∑ ∑−

=

=

−− +1

0

1

0

/222

/211 )()(

N

n

N

n

NknjNknj enxaenxa ππ

= a1X1(k) +a2X2(k)

Date:2066/08/01 Circular Symmetries of sequence:

Page 26: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -26

N-point DFT of finite duration sequence x(n) of length NL ≤ is equivalent to N-point DFT of periodic sequence )(nx p of period N which is obtained by periodically extending x(n) i.e

∑∞

−∞=

−=l

p lNnxnx )()(

∑∞

−∞=

−−=−=l

p lNknxknxnx )()()(

Finite duration sequence, x(n) = xp(n) 0<= n<=N-1 = 0 otherwise Is related to original sequence by x(n) by circular shift. This relationship is shown graphically as follows. This relationship is shown in figure

n

x(n)

10 2 3

n-3-4 -2 10 2 3-1 54 6 7

n-5-6 -4 -3 -1-2 2 3 54

xp(n-2)

n

x’(n)

10 2 3

31

2

4

Page 27: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 27

x(n)

x(1)=2

x(0)=0x(2)=3

x(3)=4

x(n)

x’(1)=4

x’(0)=3x’(2)=1

x’(3)=2 In general the circular shift of the sequence is represented as index modulo N. i.e x(n) = x((n-k))N For example, K = 2, N = 4 That implies, x’(0) = x((-2))4 x’(1) = x((-1))4 x’(2) = x((0))4

x’(3) = x((1))4 Hence x’(n) is shifted circularly by 2 units in time. where the counter clock wise direction is selected as the +ve direction. Thus we conclude that circular shift of N- point sequence is equivalent to linear shift of its period extension and vise versa. Symmetry properties of DFT:- Let us assume that N-point sequence x(n) and its DFT are both complex valued. Then the sequence can be respresented as x(n) = xR(n)+jxI(n) 0 <= n<=N-1 ………..(1) X’(k) = XR(k)+jX I(k) 0<=k<=N-1 …… …..(2)

X(k) = ∑−

=

−=1

0

/2)(N

n

Nnjenx π k = 0, 1, ………N-1

( )∑−

=

−+=1

0

)/2sin/2(cos)()(N

nIR NknjNknnjxnx ππ

∑∑−

=

=

−−+=1

0

1

0

)/2cos)(/2sin)(()/2sin)(/2cos)((N

nIR

N

nIR NknnxNknnxjNknnxNknnx ππππ

= XR(k)+jX I(k)

XR(k) = ∑−

=

+=1

0

)/2sin)(/2cos)((N

nIR NknnxNknnx ππ ……..(3)

X I(k) =∑−

=

−1

0

)/2cos)(/2sin)((N

nIR NknnxNknnx ππ ………(4)

Similary,

Page 28: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -28

xR(n) = 1/N ∑−

=

−1

0

)/2sin)(/2cos)((N

kIR NknkXNknkX ππ ………(5)

xI(n) = 1/N∑−

=

+1

0

)/2cos)(/2sin)((N

kIR NknkXNknkX ππ ……….(6)

1) Real valued signal:- If x(n) is real, X(N-k) = X*(k) = X(-k) Proof:-

X(N-k) = ∑−

=

−−1

0

/)(2)(N

n

NnkNjenx π

=∑−

=

−−1

0

2/2)(N

n

njNnj eenx ππ

=X(-k) = X*(k) 2) Real and even sequence:- x(n) = x(N-n) Than, XI(0) = , DFT reduces to

X(k) = ∑−

=

1

0

/2cos)(N

n

Nknnx π 0<= k<=N-1

IDFT Reduces to ,

x(n) = 1/N ∑−

=

1

0

/2cos)(N

k

NknkX π 0<=n<=N-1

3) Real and odd sequence:- If x(n) = x(N-n) 0<=n<=N-1 Than, XR(k) = 0, DFT reduces to ,

X(k) = -j∑−

=

1

0

/2sin)(N

n

Nknnx π , 0 <=k<= N-1

IDFT reduces to,

x(n) = j 1/N ∑−

=

1

0

/2sin)(N

k

NknkX π 0 <= n<= N-1

4) Purely Imaginary sequence:- x(n) = jxI(n)

XR(k) = ∑−

=

1

0

/2sin)(N

nI Nknnx π

X I(k) = ∑−

=

1

0

/2cos)(N

nI Nknnx π

If x I(n) is odd, then XI(k) = 0 and hence X(k) is purely real. If xI(n) is even then, XR(k) = 0 and hence X(k) is purely imaginary.

Page 29: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 29

Multiplication of two DFTs and circular convolution :- Support we have two finite duriaotn sequences of length N, x1(n), x2(n). Their respective DFTs are,

X1(k) = ∑−

=

−1

0

/21 )(

N

n

Nknjenx π k = 0, 1, ……N-1 ……..(1)

X2(k) = ∑−

=

−1

0

/22 )(

N

n

Nknjenx π k = 0, 1, …….N-1 …….(2)

If we multiply two DFTs together the result in DFT say X3(k) of a sequence x3(n) of length N. Let us determine the relationship between x3(n) and the sequence x1(n) and x2(n) . We have X3(k) = X1(k)X2(k)

x3(n) = 1/N ∑−

=

1

0

/23 )(

N

k

mknjekX π

x3(n) = 1/N ∑−

=

1

0

/221 )()(

N

k

mknjekXkX π

= 1/N ∑ ∑∑−

=

−−

=

−−

=

1

0

/21

0

/22

1

0

/21 )()(

N

k

NknjN

l

NkljN

n

nknj eelxenx πππ

= 1/N ∑ ∑∑−

=

=

−−−−

=

1

0

1

0

/)(21

021 )()(

N

n

N

k

NlnmkjN

l

elxnx π

Now,

1,1

11

0

≠−

−=

==∑−

=

aaa

a

aNa

N

N

k

k

Where, a = ej2π(m-n-l)/N

otherwise

egerispnmpNnmlNa N

N

k

k

,0

int))((1

0

=

−=+−=−=∑−

=

Hence,

x3(m) = 1/N NnmxnxN

nN∑

=

−1

021 .))(()( m = 0, 1, …..N-1

x3(m) = ∑−

=

−1

021 ))(()(

N

nNnmxnx

Page 30: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -30

The expression has the form of convolution sum. The convolution sum involves index ((m-n))N is called circular convolution. Thus we conclude that multiplication of DFT of two sequences is equivalent to the circular convolution of two sequences in time domain. Q. perform the circular convolution of the following two sequences. x1(n) = 2, 1, 2, 1 x2(n) = 1, 2, 3, 4 Solution,

x3(m) = ∑−

=

−1

021 ))(()(

N

nNnmxnx

N = 4,

x3(m) = ∑=

−3

0421 ))(()(

n

nmxnx

x3(0) = ∑=

−3

0421 ))(()(

n

nxnx = 14

x1(n)

x1(1)=1

x1(0)=2

x1(3)=1

x1(2)=2 x2(n)

x2(1)=2

x2(0)=1

x2(3)=4

x2(-n) 1

2

3

4

2

6

4

2

x1(n)x2((-n))4=14

x3(1) = 16))1(()(3

0421 =−∑

=n

nxnx

x2((1-n))4

1

4

3

2

3

8

1

4

x1(n)x2((1-n))4=16

x3(2) = 14))2(()(3

0421 =−∑

=n

nxnx

Page 31: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 31

x2((2-n))41

2

4

3

4

2

2

6

x1(n)x2((2-n))4=14

x3(3) = 16))3(()(3

0421 =−∑

=n

nxnx

x2((3-n))42

3

1

4

1

4

3

8

x1(n)x2((3-n))4=16

x3(n) = 14, 16, 14, 16 Solution by DFT and IDFT method:

X1 =

−−−−

−−

jj

jj

11

1111

11

1111

*

1

2

1

2

=

0

2

0

6

X2 =

−−−−

−−

jj

jj

11

1111

11

1111

4

3

2

1

=

−−−

−−

j

j

22

2

22

10

X3 =

−0

4

0

60

IDFT: x3 = (W4

*/4 )* X3

Page 32: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -32

= ¼

−−−−

−−

jj

jj

11

1111

11

1111

−0

4

0

60

Parseval’s theorem:- For complex valued sequence x(n) and y(n) x(n) DFT X(k) y(n) DFT Y(k) Then,

∑∑−

=

=

=1

0

1

0

)(*)(1

)(*)(N

k

N

n

kYkXN

nynx

Proof:-

)0()(*)(1

0

xyN

n

rnynx =∑−

=

Circular cross correlation sequence.

∑−

=

=1

0

/2)(1

)(N

k

Nkljxy

xy ekRN

lr π

∑−

=

=1

0

)(*)(1

)0(N

k

xy kYkXN

r

In Special case, y(n) = x(n)

∑ ∑∑−

=

=

=

==1

0

1

0

221

0

)(1

)()(*)(N

n

N

n

N

n

kXN

nxnynx

Which expresses the energy is finite duration sequence x(n) in term of frequency component X(k)

Date: 2066/08/04 Fast Fourier Transform (FFT):-

∑−

=

=1

0

/2)()(N

n

NkjenxkX π

The complex multiplication in direct computation of DFT is N2 and by FFT complex multiplication in N/2 log2

N. When number of points is equal to 4, the complex multiplication in direction computation of DFT is 16 and for FFT its value is 4. Hence the increment factor is 4.

∑−

=

=1

0

/2)(*)(1

)(N

k

Nkljxy ekYkXN

lr π

Page 33: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 33

Radix-2 FFT algorithm:-

If x(n) be the discrete time sequence then its DFT is given by ∑−

=

=1

0

)()(N

n

knNwnxkX k = 0, 1,….N-1

Divide N-point data sequence into two N/2 data sequence f1(n) and f2(n) corresponding to the even number and odd number samples of x(n) respectively. f1(n) = x(2n) f2(n) = x(2n+1) n = 0, 1, ……N/2-1 Thus f1(n) and f1(n) are obtained by decimating x(n) by a factor of 2 and hence the resulting FFT algorithm is called decimation in time algorithm.

∑∑−−

+=11

)()()(N

oddn

knN

N

evenn

knN wnxwnxkX

∑∑−

=

+−

=

− ++=12/

0

)12(12/

0

2 )12()2()(N

m

mkN

N

m

nkN wmxwmxkX

But

( ) 2/)2//(222/22

Nnjnj

N WeeW === −− ππ

∑∑−

=

=

+=12/

02/2

12/

02/1 )()()(

N

m

kmN

kN

N

m

kmN wmfWwmfkX

X(k) = F1(k) + )(2 kFW kn

Where F1(k) and F2(k) are N/2 point DFT of sequences f1(m) and f2(m) respectively.

X(0)

X(1)

X(2)

X(3)

X(4)

X(5)

X(6)

X(7)

x(0)

x(2)

x(4)

x(6)

x(1)

x(3)

x(5)

x(7)

F1(0)

F1(1)

F1(2)

F1(3)

F1(0)

F1(1)

F1(2)

F1(3)

N/2 pointDFT

N/2 pointDFT

Having performed that DIT once, we can repeat the processor for each of sequence f1(n) and f2(n) . Thus f1(n) would result in two N/4 point sequence. v11(n) = f1(2n) v12(n) = f1(2n+1) , n = 0, 1,……N/4-1 And f2(n) would result. v21(n) = f2(2n) v22(n) = f2(2n+1) , n = 0, 1, …….N/4 -1 Then

Page 34: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -34

F1(k) = v11(k)+ )(122/ kvwkN

x(0)

x(1)

x(3)

x(4)

x(5)

x(6)

x(7)

X(0)

X(1)

X(2)

X(3)

X(4)

X(5)

X(6)

X(7)

WN0

WN1

WN2

WN3

WN4

WN5

WN6

WN7

WN0

WN4

WN0

WN2

WN4

WN6

WN0

WN2

WN4

WN6

WN0

WN4

WN0

WN4

WN0

WN4

Fig: 8-point DIT FFT algorithm

Xm+1(p)

Xm+1(q)

Xm(p)

Xm(q)WN

r -1

Xm(p)Xm+1(p)

Xm(q) Xm+1(q)WN

r+N/2

Fig: Basic butterfly computation in DIT FFT algorithm.

Xm+1(p) = Xm(p)+WNr Xm(q)

Xm+1(q) = Xm(p)+WNr+N/2 Xm(q)

= Xm(p) - WNr Xm(q) [WN

N/2 = -1] # Compute 8 point DFT for the sequence x(n) = 1,2, 3, 4,5 ,6 . Using DITFFT algorithm or DIF FFT algorithm.

x(0)

x(1)

x(3)

x(4)

x(5)

x(6)

x(7 )

X(0)

X(1)

X(2)

X(3)

X(4)

X(5)

X(6)

X(7)

WN0

WN2

x(2)

-1

-1

-1

-1

WN0

WN1

WN2

WN3

WN0

WN0

WN0

WN0

WN0

Page 35: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 35

Date:2066/08/11

Q. Compute 4-point DFT for the sequence x(n) = 14, 16,14, 16 using FFT algorithm.

x(0)=14

x(2)=14

x(3)=16

X(0)=60

X(1)=0

X(2)=-4

X(3)=0

x(1)=16

28

0

6

32

28

0

WN1

WN0=1

WN0 =1

Q. Compute 4 point DFT for the sequence x(n) = 14, 16, 14, 16 using FFT algorithm.

x(0)

x(2)

x(3)

X(0)=60

X(1)=0

X(2)=-4

X(3)=0

x(1)

32

28

WN0

WN0

W40 =1

W41

-1

-1

Date: 2066/08/11 Chapter: - 3 Z-transform:- The z-transform of a discrete-time signal x(n) is defined as the power series.

∑∞

−∞=

−=n

nznxzX )()( ………..(1)

When z is complex variable.

Page 36: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -36

The inverse procedure( i.e obtaining x(n) from X(z) ) is called inverse z-transform . z-tranasform of a singal x(n) is denoted by X(z) = Zx(n) …….(2) Where as the relationship between x(n) and X(z) is indicated by x(n) z X(z) ……..(3) ROC (Region of convergence): ROC of X(z) is the set of all values of z for which X(z) attins a finite values. # Determine z-transform of following finite duration signals. x1 (n) = 1,2, 5, 7, 0, 1

∑∞

−∞=

−=n

nznxzX )()(

= 1+2z-1+5z-2+7z-3+z-5 ROC: entire z-plane except z = 0 . (2) x2(n) = 2,4, 5, 7, 0, 1

X2(z) = ∑∞

−∞=

−−− ++++==n

n zzzzznxzX 3122 7542)()(

ROC: Entire z-plane. Except z = 0 and ∞=z (3) x3(n) = δ(n)

X3(n) = ∑∞

−∞=

n

nznx )(3

= [ ] 0)( =−

nnznδ

= 1 ROC: Entire z-plane. (4) x4(n) = δ(n-u) k > 0

X4(z) =

[ ] kz

knn

n

n

zkn

zzznxzX

=−

−∞=

+== ∑

)(

42)()( 4

δ

ROC: Entire z-plane except z = 0 (5) x5(n) = δ(n+k) k>0

X5(n) = ∑∞

−∞=

−=n

nznxzX )()( 5

= [ ] knnzkn =

−− )(δ

= kz − ROC: Entire z plane except z = 0. ROC relationship to casusality:-

Page 37: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 37

Let us express complex z-variable in polar form as. z = rejθ ……..(1) Where r = |z| θ = angle z . Then X(z) can be expressed as,

X(z)|z= rejθ = ∑∞

−∞=

−−=n

njnernxzX θ)()( ……………….(2)

In the ROC of X(z) . ∞<)(zX

But,

∑∞

−∞=

−−=n

njnernxzX θ)()(

∑∞

−∞=

−≤n

nrnx )( ……………..(3)

Hence )(zX is finite of the sequence nrnx −)( is absolutely summable.

The problem of finding ROC for x(z) is equivalent to determining the range of values of r for which the sequence x(n) r-n is absolutely sum able.

∑∑∞

=

−−

−∞=

− +≤0

1

)()()(n

n

n

n rnxrnxzX

∑∑∞

=

=+−≤

01

)()()(

nn

n

n

r

nxrnxzX …………….(4)

If x(z) converges in some region of complex plain both summation in equation (4) must be finite in that region. If the first sum in equation (4) converges their must exists values of r small enough such that the product sequence x(-n) rn , 1 <= n < ∞ is absolutely summable. Therefore ROC for the first sum consists of all points in a circle of some radius r1 where r1 < ∞ as illustrated in the figure.

z-plane

Re(z)

Im(z)

Date: 2066/08/15 Now if the 2nd term in equation (4) converges there must exists values of r large enough such that

product sequence ,)(

nr

nx…….. hence ROC for second sum in equation (4) consists of all points outside a

circle of radius r >r2 as shown in fig.

Page 38: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -38

Re(z)

Im(z)

r

Since the convergence of X(z) requires that both sums in equation (4) be finite it follows that ROC of X(z) is generally specified as the annual region in the z plane r2 <r<r1 which is common region where both sums are finite. Which is shown in figure.

r1r2

Im(z)

Re(z)

If r2 >r1 there is no common region of convergence for the two sums and hence X(z) does not exist.

Re(z)

Im(z)

r2r1

Numerical: # Determine z-transform of the signal. X(n) = αn u(n) = αn , n => 0 = 0 , n < 0 Solution:

Page 39: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 39

X(z) = ∑∞

−∞=

n

nznx )(

=∑∞

−∞=

n

nn zα

= ......)()(1)( 2111 +++= −−∞

−∞=

−−∑ zzzn

n ααα

= 11

1 11

<−

−− zfor

α

ROC: |z| > |α |

Re(z)

Im(z)

r|α|

x(n)

# Determine z-transform of the signal. X(n) = - αn u(-n-1) = -αn , n <= -1 = 0 , n > 0 Solution:-

X(z) = ∑∞

−∞=

n

nznx )(

= ( )∑−

−∞=

−−1

n

nn zα

= ( )∑∞

=

−−1l

ll zα

= ( ) [ ]∑∞

=

−−− ++−=−1

211 .........)()(l

ll zzz ααα

= - 11

11

1

<

−−

zforz

z αα

α

= ||:1

11

αα

<− − zROC

z

Page 40: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -40

z-plane

Re(z)

Im(z)

| r |

x(n)

-3 -2 -1

# Determine z-transform of the signal. X(n) = αn u(n)+ bn u(-n-1) Solution:

X(z) = ∑∞

−∞=

n

nznx )(

= ∑∑∞

=

−−

−∞=

− +0

1

n

nn

n

nn zzb α

= ∑∑∞

=

−∞

=

− +0

1

1

1 )()(n

n

l

l zzb α

The first power series converges if |b-1z| < 1 i.e |z| < |b| and second power series converges if |αz-1| < 1 i,e |z| > |α| Case I: |b| < |α |

z-plane

Re(z)

Im(z)

Case II: |b| > |α |

Page 41: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 41

z-plane

Re(z)

Im(z)

|α|

11 1

1

1

1)( −− −

+−

−=zbz

zXα

=1−−−+

−bzzb

b

ααα

ROC: |α | <|z| < |b|

Date: 2066/08/24 (1) linearity : If , x1(n) z X1(z) , x2(n) z X2(z) Then x(n) = a1x1(n)+ a2x2(n) = a1X1(z)+a1X2(z) Proof:

X(z) = ∑∞

−∞=

n

nznx )(

= ∑∞

−∞=

−+n

nznxanxa ))()(( 2211

= ∑∑∞

−∞=

−∞

−∞=

− +n

n

n

n znxaznxa )()( 2211

= a1X1(z)+a1X2(z) # Determine z-transform and ROC of the signal x[n] = [ 3(2n)-4(3n)] Proof: Let, x1(n) = 2nu(n) x2(n) = 3nu(n) Then, x(n) = 3x1(n) -4x2(n) Accordign to linearity property.

Page 42: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -42

X(z) = 3X1(z)-4X2(z)

X1(z) = Z x1(n) = 121

1−− z

ROC: |z| > 2

X2(z) = Z x2(n) = 131

1−− z

ROC: |z| > 3

The intersection of ROC of X1(z) and X1(z) is |z| > 3. Now

X(z) = 11 31

4

21

3−− −

−− zz

|z| > 3

# Determine z-transform of the signals:

(a) x(n) = (coswon) u(n) (b) x(n) = (sinwon) u(n)

Solution: x(n) = (coswon) u(n) = ( ) )(2/1 00 nuee njwnjw −+

=

+ − )(2

1)(

2

100 nuenue njwnjw

Using linearity property.

X(z) = )(2

1)(

2

100 nueZnueZ njwnjw −+

10

0

1

1)( −−

=ze

nueZnjw

njw = 121

1−− z

ROC: |z| > 1

10

0

1

1)( −−

−=

zenueZ

njw

njw = 121

1−− z

ROC: |z| > 1

X(z) = 11 00 1

1.

2

1

1

1.

2

1−−− −

+− zeze njwnjw

= 2

01

01

cos21

1−−

+−−

zwz

Coswz ROC: |z| > 1

(b) x(n) = )()(2

100 nuee

jnjwnjw −

X(z) = 2

01

01

cos21

1−−

+−−

zwz

Sinwz ROC: |z| > 1

(2) Time Shifting:- If x(n) z X(z) Then , x(n-k) z z-k X(z) Proof:

x(n-k) z ∑∞

−∞=

−−n

nzknx )(

Put n-k = m

Page 43: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 43

= ∑∞

−∞=

+−

m

kmzmx )()(

= ∑∞

−∞=

−−

m

mk zmxz )()(

= z-k X(z) # By applying the time-shifting property determine z-transform of x2(n) and x3(n) form z-transform of x1(n) given as,

x1(n) = 1,2, 5,7, 0, 1 , x2(n) = 1,2, 5

↑ , 7, 0, 1 x3(n) = 0,0,1,2,5,7,0,1 Solution: X2(n) = x1(n+2), x3(n) = x1(n-2) Now, X2(z) = z2X1(n) X1(z) = 1+2z-1+5z-1+7z-3+z-5 X2(z) = z2+2z+5+7z-1 +z-3 ROC: Entire z-plane except z = 0 and z = ∞ X3(z) = z-2X1(z) = z-2+2z-3+5z-4+7z-5+z-7 Roc: entire z-plane except z = 0. # Determine the z-transform of the signal .

−≤≤

=otherwise

Nnnx

0

101)(

Solution:

X(z) = ∑−

=

−1

0

.1N

n

nz

= Nzzzz N =++++ −−−−− )1(321 .........1 if z = 1

= 11

11

≠−−

zifz

z N

Alternative method:- X(n) = u(n) – u(n-N) Using linearity and time shifting property. X(z) = Zu(n) –Zu(n-N)

= 11 11

1−

− −−

− z

z

z

N

= 11

1−

−−

z

z N

ROC: |z| > 1

Next method

Page 44: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -44

u(n-N)

0 NN-1 N0

u(n)

Date:2066/08/25

(3) Scaling in z-domain:- If x(n) z X(z) ROC, r1 <|z| <r2 Then a-1x(n) z X(a-1z) ROC: |a|r1 <|z| <|a|r2 For any real constant a real or complex.

)())(()()]([ 1zaXzanxznxanxaZn

nn

n

nnn −∞

−∞=

−−∞

−∞=

− === ∑∑

ROC : r1<|a-1z| <r2 21 razra <<

# Determine z-transform of the signals. (a) x(n) = an(coswon)u(n) (b) x(n) = an(sinwon)u(n)

Solution: x(n) = an(coswon)u(n) x1(n) = coswon u(n)

X1(z) = 1

01

01

0 cos21

cos1)]([cos −−

+−−

=zwz

wznunwZ ROC: |z| >1

Then, X(n) = anx1(n)

X(z) = 12

01

01

111 cos21

cos1)()]([ −−

−−

+−−

==zawaz

wazzaXnxaZ n ROC: |z| >|a|

(b) x(n) = an(sinwon)u(n)

X(z) = 12

01

01

cos21

sin−−

+−=

zawaz

waz ROC: |z| >|a|

(4) Time reversal: If x(n) z X(z) ROC, r1 <|z| <r2 Then x(-n) z X(z-1) ROC: 1/r2 <|z| <1/r1 Proof:

Page 45: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 45

∑∞

−∞=

−−=−n

nznxnxZ )()]([

Put , l = -n

∑∞

−∞=

=l

lzlx )(

∑∞

−∞=

−−=l

lzlx ))(( 1

= X(z-1) ROC of X(z-1) is r1 <|z| <r2 or, 1/r2 <|z| <1/r1

Note that ROC of x(n) is the inverse of that for x(-n) # Determine the z-transform of the signal. x(n) = u(-n) Solution:

u(n) z 11

1−− z

|z| > 1

Using time reversal property.

u(-n) z z−1

1 |z| < 1

(5) Differentiation in z- transform If x(n) z X(z)

Then n x(n) z -z dz

zdX )(

Proof:-

∑∞

−∞=

−=n

nznxzX )()(

By differentiation,

∑−∞

∞=

−−−=n

nznnxdz

zdX 1))(()(

∑−∞

∞=

−−−=n

nznnxz )(1

)(1 nnxZz −−=

dz

zdXznnxZ

)()( −= Note that both transform have same ROC.

# Determine z-trnasform of the signal. x(n) = nanu(n) Proof: x1(n) = anu(n)

Page 46: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -46

x1(n) = 1

1−− aza

ROC; |z| >|a|

x(n) = n x1(n)

X(z) = Zn x1(n) = dz

zdX )(1

= 221)1(

1 −−−

−− azaz

z

= 21

1

)1( −

− az

az ROC: |z| >|a|

# Determine the signal x(n) whose z-transform is given by X(z) = log(1+az-1), |z| >|a| Solution:

21

.)1(

1)( −− −

+= az

azdz

zdX

.)1(

)(1

1

+=−

az

az

dz

zdXz

=

−− −−

11

)(1

1

zaaz

Taking inverse z-transform. n x(n) = a(-a)n-1 u(n-1) x(n) = (-1)n-1 . an/n u(n-1)

Date: 2066/08/26 If x1(n) z X1(z) x2(n) z X2(z) Then X(n) = x1(n).x2(n) z X(z) = X1(z) X2(z) The ROC of X(z) is at least the intersection of the for X1(z) and X2(z). Proof: The convolution of x1(n) and x2(n) is defined as

∑∞

−∞=−=

k

knxkxnx )()()( 21

z-transform of x(n) as,

∑∞

−∞=

−=n

znxnX 1)()(

Page 47: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 47

∑ ∑∞

−∞=

−∞=

−=n k

nzknxkxnX )()()( 21

∑ ∑∞

−∞=

−∞=

−−=k n

nzknxkxnX )()()( 21

∑∞

−∞=

−=k

n zxzkxnX )()()( 21

∑∞

−∞=

−=k

nzkxzXnX )()()( 12

= X2(z)X1(z) # Compute convolution x(n) of the signals X(n) = 1,-2, 1

≤≤

=otherwise

nnx

0

501)(2

Inverse z-transform.

∑∞

−∞=

−=k

kzkxzX )()( ………….(i)

Multplyign both sides of (i) by zn-1 and integrate both sides over a closed contour within the ROC of X(z) which enclosed the origin . Now,

∫ ∫ ∑∞

−∞=

−−− =C k

knn dzzkxdzzzX )2.........()()( 11

Where C denotes closed counter in the ROC of X(z) . We can interchanged the order of integration and summation on right hand side of (2) .

∫ ∫∑ −−∞

−∞=

− =C

kn

k

n dzzkxdzzzX )3.........()()( 11

From Cauchy integral theorem , Figure:

≠=

=−−

C

kn

nk

nkdzz

j 0

1

2

1 1

π

Then,

∫ =− )(2)( 1 njxdzzzX n π

∫−=

C

n dzzzXj

nx 1)(2

1)(

π……..(4)

7) Multiplication of two sequences:-

Page 48: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -48

If x1(n) z X1(z) x2(n) z X2(z) Then

x(n) z x1(z)x2(z) zX(z) = ∫−

C

dvvv

zXuX

j1

21 )(2

1

π

Where C is sthe closed counter that encloses the origin and lies within the ROC of common to both X1(v) and X2(1/v)

∑∞

−∞=

−=n

nznxzX )()(

∑∞

−∞=

−=n

nznxnxzX )()()( 21

Where,

∫−=

C

n dvvvXj

nx 111 )(

2

1)(

π

∫−

=

C

dvvv

zXvX

jnx 1

**211 )(

2

1)(

π

∫ ∑ −∞

−∞=

=C n

n

dvvv

znxvX

jzX 1

21 )()(2

1)(

π

8) Parseval’s theorem:- If x1(n) and x2(n) are complex valued sequence, then,

∑ ∫∞

−∞=

−=n C

dvvvXvXj

nxnx 1**2121 )/1()(

2

1)(*)(

π

∑ −= nn zczX )(

X(n) = cn for all n. Where X(z) is rational, the expansion can be performed by long division. # Determine inverse z-transform of

21 5.05.01

1)( −− +−

=zz

zX

When (a) ROC: |z| > 1 (b) ROC : |z| <0.5

Page 49: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 49

Solution:

(a) ROC: |z| >1 , x(n) is causal signal. 1-0.5z

-1+0.5z

-2) (1-0.5z

-1-0.25z

-2

1-0.5z-1

+0.5z-2

0.5z-1

-0.5z-2

0.5z-1

-0.25z-2

+0.25z-3

-0.25z-2

-0.5z-3

0.375z-3

+0.125z-4

-0.375z-3

+0.18175z-4

+0.18175z-5

1

-0.25z-2

+0.5z-3

-0.125z-4

-0.0625z-4

+1.8175z-5

X(z) = 1+0.5z-1-0.25z-2-0.375z-3 …….. x(n) = 1, 0.5, -0.25, -3.75, ……..

(b) ROC : |z| <0.5 x(n) is anticausal signal. 0.5z

-2-0.5z

-1+1)

1-z+2z2

z - 2z2

z - z2+ 2z

3

z2- 2z

3

- z2+ z

3- 2z

4

-3z3+ 2z

4

-3z3+ 3z

4- 6z

5

-z4+ 6z

5

(2 z2+ 2z

3- 2z

41

5432 6222)( zzzzzX −−+= ……..

= …………. 002226 2345 ++++− zzzz 0,0,2,2,6........)( −−=∴ nx Initial value theorem: X(0) = lim z → ∞ X(z) Final value theorem:- Lim n→ ∞ x(n) = lim z→1 (z-1) X(z) # The impulse response of relaxed LTI system is h(n) = 1)( <αα nun . Determine the step response

of the system where n tends to infinity. Solution:- y(n) = x(n)*h(n) x(n) = u(n)

h(n) = )(nunα Y(z) = X(z) H(z)

X(z) =

− −− 11 1

1

1

1

zz α

Page 50: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -50

Now, Lim n → ∞ y(n) = lim z →1 (z-1)Y(z)

= lim z tends to 1 (z-1) ))(1(

2

α−− zz

z

= α−1

1

System function (transfer function) of LTI System:- The o/p of LTI system to an input sequence x(n) can be obtained by comparing the convolution of x(n) with unit sample of the system. i.e y(n) = x(n)*h(n) We can express this relationship in z-domain as Y(z) = X(z) H(z) When, Y(z) = z-transform of y(n) X(z) = z-transform of x(n) H(z) = z-transform of h(n)

Now, H(z) = )(

)(

zX

zY

∑∞

−∞=

−=n

nznhzH )()(

H(z) represent the z-domain characteristics of the system where as h(n) is corresponding time domain characteristics of the system. The transform H(z) is called the system function or transfer function. General form of liner constant coefficient difference equation:- The system is described by liner constant coefficient difference form.

∑∑==

−+−−=M

kk

N

kk knxbknyany

01

)()()( ……….(1)

Taking z transform on both sides,

∑∑=

=

− +−=M

k

kk

N

k

kk zXzbzYzazY

01

)()()(

∑∑=

=

− =

+M

k

kk

N

k

kk zXzbzazY

01

)(1)(

=

=

+==

N

k

kk

M

k

kk

za

zb

zX

zYzH

1

0

1)(

)()( ……….(2)

Therefore a LTI system described by constant coefficient difference equation has a rational system function from this general form we obtained two important special forms:

1. if ak = 0 , for 1 <= k<= N . Equation (2) reduces to ∑=

−=M

k

kk zbzH

0

)( (all zero system) such a

system has finite duration impulse response and it is called FIR system or moving average (MA) system.

Page 51: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 51

2. On the other hand if bk = 0 , for 1 <= k<= n the system function reduces to

∑=

−+=

N

k

kk za

bzH

1

0

1)( …….(4) (all pole system) Due the presence of poles the impulse

response of such a system is infinite in duration and hence it is IIR system. # Determine the system function and unit sample response of the system describe by the difference equation y(n) = ½ y(n-1) +2x(n). Solution: Taking z-transform on both sides, )(2)(2/1)( zXzYzY +=

)(2)()2/11( 1 zXzYz =− −

12/11

2

)(

)()( −−

==zzX

zYzH

By inversion, h(n) = 2 (1/2)n u(n)

Date: 2066/09/16 Response of pole zero system with Non-zero initial condition:- The difference equation,

∑∑==

−+−−=M

kk

N

kk knxbknyany

01

)()()( ……………………………(i)

Suppose that the signal x(n) is applied to the pole zero system at n = 0 . Thus the signal x(n) is assume to be a causal. The effects of all previous input signal to the system are reflected in the initial condition y(-1), y(-2) ……..y(-N). Since the input x(n) is causal and since we are interested in terminating the o/p signal y(n) for 0≥n we can use one sided z-transform which allows us to deal with initial condition. Now,

∑∑∑=

+−

=

−+

=

−+ +

−+−=m

k

kk

k

n

nN

kk zXzbznyzYzazY

011

1 )()()()( ………..(2)

Since x(n) is causal, We can set )()( zXzX =+

∑∑

=

=

=

=

=

+

+

−−

+=

N

k

kk

k

n

nN

k

kk

N

k

kk

M

k

kk

za

znyza

zX

za

zb

zY

1

10

1

0

1

)()(.

1)(

)(

)()()(

zA

zNzXzH o+= …………..(3)

Where,

∑∑==

−−=k

n

nN

k

kk znyzazN

110 )()( ………….(4)

Page 52: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -52

From (3) the o/p of the system can be sub divided into two parts. The 1st part is zero state response of the system defined in z-domain as )()()( zXzHzYzs = …….. (5).

The second component corresponding to o/p resulting form initial condition. This o/p is zero input

response of the system which is defined in z-domain as )(

)()( 0

zA

zNzYzi = …………(6)

Since the total response is the sum of the two o/p component which can be expressed in time domain by determining inverse z-transform of )()( zYzY zizs = . Seperately and adding the result.

y(n) = yzs(n) + yzi(n) ………..(7) # Determine the unit step response of the system described by the difference equation y(n) = 0.9y(n-1) – 0.81 y(n-1) + x(n). Under the following initial condition. (a) y(-1) = y(-2) = 0. (b) y(-1) = y(-2) = 1 .

Taking one-side z-trnasfrom. [ ] [ ] )()2()1()(8.0)1()(9.0)( 221 zXzyzyzYzzyzYzzY +−+−+−+ +−+−+−−+= For y(-1) = y(-2) = 0 )()(81.0)(9.0)( 21 zXzYzzYzzY ++−+−+ +−=

21 81.09.01

1

)(

)(−−+

+

−−=

zzzx

zY

)1)(9.0()1)(8.09.0(

)(3/

2

2

2

−−=

−+−=

+

zez

z

zzzz

z

z

zYj

zsπ

1)9.0()9.0()1)(9.0)(9.0(2

3/

*1

3/1

3/3/2

2

−+

−+

−=

−−− −− z

k

ez

k

ez

k

zezez

zjjjj ππππ

ojek 53.5

1 098.1 −= ojek 53.5

* 098.1= , k2 = 1.1

113/

53.5

13/

53.5

1

1.1

)9.01(

098.1

)9.01(

098.1)( −−−−

−+

−+

−+

−=

zze

e

ze

ezY

j

j

j

j

zs ππ

By inversion,

[ ] )(1.1)9.0(098.1)9.0(098.1)( 3/53.53/53.5 nyeeeeny njjnjjzs +++= −− ππ

[ ] )()53.53/cos()9.0(098.11.1 nunn −+= π (b) y(-1) = y(-2) = 1.

)(

)()(

zA

zNzY o

zi =

∑∑=

=

−=k

n

nN

k

kko znyzazN

11

)()(

Page 53: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 53

∑∑=

−− −−=k

n

nkko znyzazN

1

2

1

)()(

= [ ]))2()1(()1( 222

11 zyzyzazyza −+−+− −−

[ ]181.081.019.0)( 10 ×++×−−= −zzN = 0.09 – 0.81z-1

21

1

81.09.01

81.009.0)( −−

+−−=

zz

zzYzi

)()()( zYzYzY zizs +=

13/13/1 9.01

445.0568.0

9.01

445.0568.0

1

099.1−−− −

−+−

++−

=ze

j

ze

j

z jj ππ

[ ] )()383/cos()9.0(44.1099.1)( nunny n ++= π

Date: 2066/09/20 # Determine well known fibanacci sequence of integer numbers is obtained by computing each term as the sum of two previous ones, the first few terms of the sequences are 1, 1, 2, 3, 5, 8 …………….. Determine a close form expression for the nth term of Fibonacci series. Solution:- Let y(n) be the nth term. Then, Y(n) = y(n-1) + y(n-2) ………(i) With initial condition , y(0) = y(-1)+y(-2) = 1 y(1) = y(0)+y(-1) = 1 y(-1) = 1-1 = 0, y(-2) = 1 . Taking one sided z-tranzsform on both sides of (i).

121 )1()()()1()()( −+−+−+ −+++−+= zyzYzYzyzYzzY

1)()()( 21 ++= +−+−+ zYzzYzzY

11

1)(

2

2

21 −−=

−−= −−

+

zz

z

zzzY

−−

−−+

+−

+=−−

=+

2

51

1.

52

51

2

51

1.

52

51

1

)(2

zzzz

z

z

zY

11

2

511

1.

52

51

2

511

1

52

51)(

−−

+

−−

−−

+−+

+=zz

zY

Taking inverse z-transformation.

Page 54: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -54

)(2

51

52

51

2

51

52

51)( nuny

nn

−−

+

+=

# Determine step response of the system y(n) = α y(n-1) + x(n) -1 < α < 1 When initial condition is y(-1) = 1. Solution: Taking one sided z-transform, [ ] )()1()()( 1 zXyzYzzY ++−+ +−+= α

[ ]11

1)()( −

+

−==

znuZzX

Or , 1

1

1

1)()( −

+−+

−++=

zzYzzY αα

Or, 1

1

1

1)1)(( −

−+

−+=−

zzzY αα

)1)(1(

1

1)(

111 −−−+

−−+

−=

zzzzY

ααα

−−

−+

−= −−−

+111 1

1

1

1

1

1

1

1

1)(

zzzzY

ααααα

Taking inversion,

)(1

1)(

1

11).()( nunununy nn α

αααα

−−

−=

−−+−=

++

αααα

1

1)1( 11 nn

)(1

1)(

2

nunyn

−−=

+

αα

# Determine the response of the system y(n) = 5/6. y(n-1) – 1/6 y(n-2) + x(n) to the input signal

)1(3

1)()( −−= nnnx δδ

Solution: Taking z-transform in both sides.

)()(6

1)(

6

5)( 21 zXzYzzYzzY +−= −−

1

3

11)( −−= zzX

−+−= −−− 121

3

11)(

6

1

6

5)( zzYzzzY

−=

+−= −−− 121

3

11)(

6

1

6

51 zzYzz

Page 55: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 55

+−

−=

−−

21

1

6

1

6

51

3

11

)(zz

z

zY

1

2

11

1)(

−−=

zzY

Taking inverse z-transform,

)(2

1)( nuny

n

=

Causality and stability:- A causal LTF system is one where unit sample response u(n) satisfies the condition h(n) = 0, for n < 0. We have also shown that ROC of z-transform of a causal sequence is exterior of a circle.

A necessary and sufficient condition for a LTI system to be BIBO stable is ∑∞

−∞=

∞<n

nh )( . In turn this

condition implies that H(z) must contain the unit circle within it’s ROC. Indeed, Since

∑∞

−∞=

−=n

nznhzH )()(

∑∞

−∞=

−≤n

nznhzH )()(

When evaluating on the unit circle i.e z = 1

∑∞

−∞=

≤n

nhzH )()(

Hence if the system is BIBO, the unit circle is contained in the ROC of H(z). # A LTI system is characterized by the system function.

21

1

5.15.31

43)( −−

+−−=

zz

zzH

Specify the ROC of H(z) and determine h(n) for the following condition. (a) The system is stable. (b) The system is causal. (c) The system is anticausal.

Solution:-

1

1 31

2

2

11

1)( −

− −+

−=

zzzH

The system has poles at z = ½ and z = 3.

Page 56: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -56

(a) Since the system is stable, its ROC must include the unit circle and hence it is ½ < |z| <3. Consequently h(n) is non-causal.

)1()3.(2)(2

1)( −−−

= nununh nn

( The system is unstable).

(b) Since the system is causal , its ROC is |z| >3. In this case )()3(2)(2

1)( nununh n

n

+

= ( The

system is unstable). (c) Since the system is anticausal it’s ROC is |z| <1/2 . In this case,

)1()3.(2)1(2

1)( −−+−−

= nununh nn

. (The system is unstable).

Date: 2066/09/22 Transient and steady state response: # Determine the transient and steady state response of the system characterized by the difference

equation y(n) = 0.5y(n-1) +x(n). When the input signal is x(n) = 10cos )(4

nun

π. The system is

initially at a rest (i.e it is relaxed ). Solution: Taking z-transform,

)()(5.0)( 1 zXzYzzY += −

15.01

1

)(

)(−−

=zzX

zY

21

1

cos21

cos1))((cos −−

+−−

=zwz

wznunwZ

o

oo

( )21

1

21

1

21

2

1110

4cos21

4cos1

10)(−−

−−

+−

−=

+−

−=

zz

z

zz

zzX π

π

( )21

1

1 21

2

11

10.)5.01(

1)(

−−

− +−

−=

zz

z

zzY

)1)(1)(5.01(

)2

11(10

14/14/1

1

−−−−

−−−

−=

zezez

z

jj ππ

14/

7.28

14/

870.2

1 1

78.6

1

78.6

5.01

63−−−

− −+

−+

−=

ze

e

ze

e

z j

j

j

j

ππ

Page 57: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 57

The natural or transient response is )()5.0(3.6)( nuny n

nr = and forced or steady response is

[ ] )(78.678.6)( 4/7.284/7.28 nueeeeny jnjjnjfr

ππ −+=

)(7.284

cos56.13 nun

−= π

Pole-zero diagram:-

321

21

375.04.175.11

21)( −−−

−−

−+−−−=

zzz

zzzH

375.025.175.1

223

23

−+−−−=

zzz

zzz

)5.05.0)(5.05.0)(75.0(

)1)(2(

jzjzz

zzz

+−−−−+−=

-1 1 2

j0.5

-j0.5

Im(z)

Re(z)0.75

Fig: pole-zero diagram

Zeroes at z = 0, 2, -1 Poles at z = 0.75, 5.05.0 j± # A filter is characterized by following poles and zeroes on z-plane.

Zeroes at Poles at Radius Angle Radius Angle 0.4 0.9

π rad 1.0376

0.5 0.892

0 rad 2.5158 rad

Shows z-plane plot and plot magnitude response (not to scale ). Solution:- Zeroes are, 4.04.0 −== πjez 77.045.09.0 0376.1 jez j +== Poles are:

5.05.0 0 == jez

Page 58: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -58

522.0728.0892.0 5158.2 jez +−==

j0.77

Im(z)

Re(z)0.50.45

j0.522

-0.4-0.722

Fig: z-plane plot

)522.077.0)(5.0(

)77.045.0)(4.0()(

jzz

jzzzH

−+−−−+=

Put, jwTez = ,

)522.077.0)(5.0(

)77.045.0)(4.0()(

jee

jeezH

jwTjwT

jwTjwT

−+−−−+=

438.34/30

)()(=== πWT

jwT

WT

jwT eHeH

11.1319.04/)()(

==== ππ WT

jwT

WT

jwT eHeH

π/4 π/2 3π/4 π0 ωΤ

H(ejwt)

0.478

Fig: magnitude response

Notch filter:

Page 59: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 59

It is a filter that contain one or more deep notches or ideally perfect nulls in its frequency response characteristics. Notch filter are useful in many application where specific frequency component must be illuminates for example, instrumentation in recording system requires that power line frequency of 50 Hz and its harmonics be illuminated.

0 ωΤ

H(ejwt)

ω0 ω1(null)

To create a null in frequency response of filter at frequency w0 we simply introduce a pair of complex conjugate zero on the unit circle. ojwez ±=2,1

System function is given by , )1)(1)(1()( 111

0000 −−− −−−= zezezebzH jwjwjw

Date: 2066/09/23 Response to complex exponential signal: Frequency response function:-

The input-output relationship for LTI system is ∑∞

−∞=

−=k

knxkhtu )()()( …………..(i)

To develop a frequency domain characteristics of the system. Let us excite the system with complex exponentials. ∞<<∞−= nAenx jwn)( ………….(2)

Where, A is amplitude and w is orbitrary frequency confined to the frequency interval [ ]ππ ,− Now,

[ ]∑∞

−∞=

−=k

knjwAekhny )()()(

jwn

k

jwk eAekh

= ∑∞

−∞=

−)( ………………..(3)

∑∞

−∞=

−=k

jwkekhwH )()( ……………….(4)

The function H(w) exists if the system is BIBO stable, that is

∑∞

−∞=∞<

n

nh )( ………………….(5)

Page 60: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -60

The response of the system to complex exponential is given by , jwnewAHny )()( = ………….(6) We note that the response is also in the form of complex exponential with the same frequency as the input but altered by multiplicative factor H(w). The multiplicative factor is called eigen value of the system in this case a complex exponential of the form (2) is an eigen function of LTI system and H(w) evaluated at frequency of input signal is corresponding eign value.

# Determine the o/p sequence of the system with impulse response )(2

1)( nunh

n

= When the input is

complex exponential sequence )()( 2/ nuAenx njπ= ∞<<∞− n . Solution:-

1

2

.11

1)(

−−=

zzH

jwe

wH−−

=

2

11

1)(

At 2

π=w ,

6.26

2 5

2

2

11

1

2j

je

e

H −

−=

−=

π

π

And therefore the o/p is

26.26

5

2)(

πjn

j eeAny

= −

∞<<∞−=−

nAenyn

j,

5

2)(

)6.262

# Determine the response of the system with impulse response )(2

1)( nunh

n

= to the input signal

∞<<∞−+−= nnnnx ππcos2

2sin510)(

Solution:-

1

2

11

1)(

−−=

zzH

jwe

zH−−

=

2

11

1)(

The first term in a input signal is a fixed signal component corresponding to w = 0. Thus,

Page 61: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 61

2

2

11

1)0( =

−=H

The second term in x(n) has frequency 2

π. Thus ,

6.26

2 5

2

2

11

1

2j

je

e

H −

−=

−=

π

π

Finally the third term in x(n) has a frequency π=w . Thus 3

2)( =πH .

Hence the response of the system to x(n) is,

∞<<∞−+

−−= nnnny ,cos3

406.26

2sin

5

1020)( ππ

# A LTI system is described by following difference equation )()1()( nbxnayny +−=

10 << a . (a) Determine the magnitude and phase of frequency response H(w) of the system. (b) Choose the parameter ‘b’ so that the maximum value of )(wH and phase of H(w) for a= 0.9.

(c) Determine the o/p of the system to signal for

+−+=4

cos202

sin125)(πππ

nnnx .

Date: 2066/09/25 Chapter:- 5 Discrete filter structure:- Cascade form structure:- )()( 1 zHzH k

kk =Π=

Where k is integer part of (N+1)/2

22

11

12

11

1)( −−

−−

++++

=zaza

zbzbbkH

kk

kkkok

y1(n)

x2(n)

y2(n)

x3(n) xk(n)

y(n)H1(z) H2(z) Hk(z)

Page 62: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -62

+ +

+ +

yk(n)=xk+1(n)

bk1-ak1

-ak2 bk2

xk(n)

z-1

z-1

Parallel form structure:

∑=

−−+=

N

k k

k

zp

AczH

111

)(

++

++

++

H1(z)

H2(z)

Hk(z)

y(n)

x(n)

C

# Determine the cascade parallel realization for the system described by the system function

( )

−−

++

−=

−−−−

−−−

1111

111

2

1

2

11

2

1

2

11

8

11

4

31

213

21

2

1110

)(

zjzjzz

zzz

zH

Cascade form:-

Page 63: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 63

21

1

11

1

1

32

3

8

71

3

21

8

11

4

31

3

21

−−

−−

+−

−=

−=

zz

z

zz

zzH

( )

−−

+−

+

−=

−−

−−

11

11

2

2

1

2

11

2

1

2

11

212

11

)(

zjzj

zz

zH

21

21

2

11

2

31

−−

−−

+−

−+=

zz

zz

)()(10)( 21 zHzHzH = The cascade relationship is

+ + + +

+ + +

z-1

z-1

z-1

z-1

y(n)

x(n)

17/8 -3/2

-3/32 -1/2 -1

1

1

10

-2/3

Parallel form:-

( )

−−

+−

+

−=

2

1

2

1

2

1

2

1

8

1

4

3

23

2

2

110

)(

jzjzzz

zzzz

zH

( )

−−

+−

+

−=

2

1

2

1

2

1

2

1

8

1

4

3

23

2

2

110

)(

jzjzzz

zzz

z

zH

−−+

+−+

−+

−=

2

1

2

1

2

1

2

18

1

4

3

*3321

jz

k

jz

k

z

k

z

k

68.17,93.2 21 −== kk , ,57.1425.123 jk −= 57.1425.12*3 jk +=

Page 64: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -64

1111

2

1

2

11

57.1425.12

2

1

2

11

57.1425.12

8

11

68.17

4

31

93.2)(

−−−−

−−

++

+−

++−

−+−

=zj

j

zj

j

zzzH

+ + + ++

z-1 z-1 z-1 z-1

h(1)h(2) h(m-1)

yk(n)

Cascade form structure:-

)()( 1 zHzH kkk =Π=

kkzbzbbzH kkkok ..........2,1)( 22

11 =++= −−

H1(z) H2(z) Hk(z)

x(n) = x1(n) y(n)

+ +

z-1 z-1

bk1 bk2bk0

xk(n)

yk(n) Lattice form structure: Fir filter with system function 1...........1,0)()( −== mmzAzH mm

∑=

− ≥+=m

k

kmm mzkzA

1

1)(1)( α

1)( =mAo

mkkkhzh mmm ..............2,1),()(,1)( === α

.deg polynomialofreem →

Page 65: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 65

∑=

−+=m

km knxknxny

1

)()()()( α

+ + ++

z-1 z-1 z-1

y(n)

αm(1) αm(2)1

x(n)

Figure: Direct form realization.

For m = 1. )1()1()()( 1 −+= nxnxny α

1st order lattice filter.

+

z-1+

x(n)

fo(n)

go(n)

go(n-1)

f1(n)=y(n)

g1(n)

)()(0 nxnf =

)()(0 nxng =

)1()()( 0101 −+= ngknfnf

)1()()( 1 −+= nxknxny

)1()()( 0011 −+= ngnfkng

( )1)(1 −+= nxnxk

tcoefficienreflectionk =1

)1(11 α=k

+

z-1+

x(n)

fo(n)

go(n)

go(n-1)

f1(n)

g1(n)

+

z-1+

g1(n-1)

f2(n)=y(n)

k1

k1

k2

k2

g2(n)

)2()2()1()1()()( 22 −+−+= nxnxnxny αα

)1()()( 1212 −+= ngknfnf

)1()1()1(( 221 −+−++= nxknxkkmx

)1()1(,)2( 21222 kkk +=== αα

Page 66: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -66

Conversion of lattice coefficient to direct form filter coefficients:- Direct form filter coefficient )( kmα can be obtained form lattice coefficients ik using the relations.

1..............,2,1)()()(

1)()(

111

00

−=+=

==

−−− mmzBzkzAmzA

zBzA

mmm

1.....................,2,1)()( 1 −== −− mmzAzzB mm

m

→)(zBm Reverse polynomial of ).(zAm

# A given 3-stage lattice filter with coefficient 4

11 =k ,

2

12 =k ,

3

13 =k . Determine FIR filter

coefficient for direct form structure. )()()( 0

1101 zBzkzAzA −+=

1

4

11 −+= z

4

1)1(,1)0( 11 == αα , Corresponding to single stage lattice filter.

1111

11 4

1

4

11)()( −−−− +=

+== zzzzAzzβ

)()()( 11

212 zzkzAzA β−+=

= 21

2

1

8

31 −− ++ zz

2

1)2(,

8

3)1(,1)0( 222 === ααα Corresponding to 2nd order lattice form.

212 8

3

2

1)( −− ++= zzzβ

)()()( 21

323 zzkzAzA β−+=

321

3

1

8

5

24

131 −−− +++= zzz

3

1)3(,

8

5)(,

24

13)1(,1)0( 3333 ==== αααα z

Date: 2066/09/27 Conversion of direct form FIR filter coefficient to lattice coefficient:

1,.........11

)()()(

21 −−=++=+ mm

k

zBkzAzA

m

mmmm

)(mk mmm αα ==

Page 67: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 67

# Determine lattice Coefficient Corresponding to FIR filter with system function.

333213 24

13

3

1

8

5

24

131)()( −−−−− +++++== zzzzzzAzH

Solution:

3

1)3(11 == αk , 321

3 24

13

8

5

3

1)( −−− +++= zzzzB

21

23

3332 2

1

8

31

1

)()()( −− ++=

−−= zz

k

zBkZAzA

2

1)2(12 == αK , 21

2 8

3

2

1)( −− ++= zzzB

122

2221 4

11

1

)()()( −+=

−−

= zk

zBKzAzA

4

1)1(11 == αk

Lattice and lattice ladder structure for IIR system:- Let us begin with all-pole system with system function.

)(

1

)(1

10(

1

zmzka

zHN

k

km

∆=

+=

∑=

− ……….. (1)

Difference equation for this system is

∑=

+−=N

km kxknykaky

1

)()()()( ……………. (2)

When N = 1.

+

z-1+

f1(n)

g1(n-1)

x(n)

g1(n)

fO(n)y(n)

go(n)

K

K

-

x(n) = f1(n) fo(n) = f1(n) – k1go(n-1) g1(n) = k1f0(n)+go(n-1) y(n) = fo(n) = f1(n)+k1go(n-1) y(n) = x(n) –k1y(n-1) y1(n) = k1y(1)+y(n-1)

Page 68: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -68

+

z-1+

f2(n)

g1(n-1)

x(n)

g2(n)

fO(n)

g1(n)

-+

z-1+

g0(n-1)

fO(n)

go(n)

-k2

k2

k1

k1

y(n)

Fig: Two stage lattice structure

fo(n) = x(n) f1(n) =f2(n) – k2g1(n-1) g2(n) = k2f1(n)-k1g2(n-1) fo(n) = f1(n) – k1g0(n-1) g1(n) = k1fo(n) +go(n-1) y(n) = fo(n) = go(n) = f2(n) – k2g1(n-1) – k1go(n-1) = - k1 (1+k2) y(n-1) – k2 y(n-2) + x(n)

)(

)(

)(1

)()(

0

0

zA

zC

zka

zkCzH

m

mN

k

kN

m

k

km

=+

=∑

=

=

Ladder Co-efficient, )(mCv mm = m = 0, 1, 2, 3, ………M

)(/)()(1 zBvZczC mmnm −=−

+

z-1+

f2(n)

g1(n-1)

x(n)

g2(n)

fO(n)

g1(n)

-+

z-1+

g0(n-1)

fO(n)

go(n)

-k2

k2

k1

k1

y(n)

+ +

v1v2vo

# Obtain the lattice ladder structure.

321

321

576.064.09.01

331)( −−−

−−−

−+−+++=

zzz

zzzzH

)(

)(

3

3

zA

zC=

Solution: Lattice coefficient:-

Page 69: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 69

3213 576.064.03.01)( −−− −+−= zzzzA

576.0)3(33 −== αk 321

3 9.064.0576.0)( −−− +−+−= zzzzB

2123

3332 1819.0795.01

1

)()()( −− +−=

−−= zz

k

zBkzAzA

1819.0)(22 == zk α

1819.0)(2 =zB

122

2222 6726.01

1

)()()( −−=

−−= z

k

zBkzAzB

6726.0)1(11 −== αk Ladder coefficient:- 321

3 331)( −−− +++= zzzzC

1)3(33 == Cv

)()()( 3332 zBvzCzC −=

21 9.336.2576.1 −− ++= zz )()()( 2221 zBvzCzC −=

146.5866.0 −+= z 46.51 =v

)()()( 1110 zBvzCzC −=

538.4= 538.4)0(00 == Cv

+

+ z-1

k3=-0.576

k3= 0.576

+

+ z-1

+

+ z-1

k2=0.1819

k2=-0.1819k1=-0.6782

k1=0.6782

++ ++ ++

v1=5.46 v0=4.538v2=3.9v3=1

Fig: Lattice ladder structure.

Date: 2066/09/30 Analysis of sensitivity to quantization of filter coefficient:-

Page 70: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -70

Let us consider a general FIR filter with system ,

=

=

+= N

k

kk

m

k

kk

za

zbzH

1

0

1)( ………………….(1)

With quantized coefficient coefficient the system function.

=

=

+= N

k

kk

m

k

kk

za

zbzH

1

0

1)(

Where quantized coefficient kb can be released to the unquatized coefficients ka & kb by the

relation, Nkaaa kkk .................3,2,1, =∆+= ---------(3)

mkbbb kkk .................3,2,1, =∆+= --------- (4)

Where ka∆ represents the quantization errors.

The denominator of H(z) may be expressed to the form ,

)1(1)( 11

1

−=

=

− −Π=+= ∑ zpzazD kNk

N

k

kk ………….(4)

Where, kp are the poles of H(z)

Similarly we can express the denominator of )(zH as,

)1()( 11

−= −Π= zpzD k

Nk …………….(5)

Where, Nkppp kkk .........2,1, =∆+=

And kp∆ is the error or perturtation resulting form the quantization of filter coefficients.

We shall relate the perturtation errors in the ka .

The perturtation error ip∆ can be expressed as,

∑=

=∆N

k k

ii a

pp

1 δδ

…………. (6)

( )ipz

k

k

i

zzD

az

a

p

=

∆=δδδδ

δδ

/)(

/)( ……………. (7)

The total perturtatio error,

∑= ≠=

∆−Π

−=∆N

kk

riN

ill

kNi

i qpp

pp

1 ,1 )( ……………. (8)

The error can be minimized by maximizing the lengths li pp − . This can be accomplished by realizing

the high order filter with either single pole or double pole filter sections.

Page 71: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 71

Limit cycle oscillation in recursive system:- In the realization of digital filter either in digital hardware or software on a digital computer, the quantization inherent in the finite precision arithmetic operation render the system non linear. In recursive system the non linearities due to finite precision arithmetic operation often cause periodic oscillation to occur in o/p even when the input sequence is zero or some non zero constant value. Such oscillation in recursive system are called limit cycle and are directly attributable to round off errors in multiplication and overflow error in addition. Scaling to prevent overflow:- In order to limit the amount of non linear distortion it is important to scale the input signal and unit sample response between the input and any internal summing mode in the system such that overflow becomes a rare event. For fixed point arithmetic let us first consider the extra condition that overflow is not permitted at any node of the system. Let )(nyk denote the response of the system at kth node when input sequence is x(n)

and unit sample response between the node and the input in )(zhk .

∑∑∞

−∞=

−∞=−≤−=

mk

mkk mnxmhmnxmhny )()()()()( …………… (1)

Suppose that x(n) is upper bounded by Ak. Then,

∑∞

−∞=

≤m

kkk mhAny )()( for all n ………………(2)

Now, if the dynamic range of the computer is limited to (-1, 1) the condition, 1)( <nyk …………… (3)

Can be satisfied by requiring that the input x(n) can be such that,

∑∞

−∞=

1<

mk

x

mhA

)( ………………… (4)

For all possible nodes in the system. The condition in (4) is both necessary and sufficient to prevent coefficient. For FIR filter, (4) become,

∑−

=

1< 1

0

)(m

mk

x

mhA …………..(5)

Another approach to scaling is to scale the input so that,

∑∑∞

−∞=

−∞=

=≤n

xn

k ECnxCny 2222

)()( ……….. (6)

From parsavals theorem,

∫∑−

−∞=

1=π

ππ2

2

)()(2

)( wXwHnyn

k

∫≤ 2)(

2

1wHEx π

dw ………….. (7)

Page 72: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -72

From (6) and (7)

∫−

1≤π

ππdwwHEEC xx

22 )(2

∫−

1≤π

ππdwwHC

22 )(2

……………. (8)

Read the following topics your self:-

• Representation of Number. Fixed point representation. Floating point representation.

• Rounding and truncation error.

Chapter: 6

Design of IIR filter form analog filters:- Impulse invariance method:

∑= −

=M

i i

ia ps

AsH

1

)(

Taking inverse laplace transform

∑=

=M

ia

tpia tueAth i

1

)()(

Put t = nT

∑=

=M

ia

nTpia nTueAnTh i

1

)()(

∑∞

=

−=0

)()(n

nznhzH

1

0 1

)( −∞

= =∑ ∑

= znTueAn

M

ia

nTpi

i

( )∑∑=

=

−=M

i na

nTpi nTuzeA i

1 0

1 )(

= ∑=

−−=

M

iTpi

zeA

i1

11

1

Hence,

11

11−−

→− zeps Tp

ii

Page 73: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 73

Q. Convert the analog filter with the system function ( ) 91.0

1.0)(

2 +++=

s

ssH a into a digital IIR by means

of impulse invariance method. Solution:

( ) ( )( )31.031.0

1.0

91.0

1.0)(

2 jsjs

s

s

ssH a −+++

+=++

+=

( ) ( )31.031.0

*11

js

k

js

k

−++

++=

2

11 =k ,

2

1*1 =k

( ) ( )31.02

1

31.02

1

)(jsjs

sH a −++

++=

Then using impulse invariance method,

( ) ( ) 131.0131.0 12

1

12

1

)( −−−−−− −+

+=

zezezH

TjTj

( )

( ) 12.011.0

11.0

3cos1

3cos1−−−−

−−

+−−=

zezTze

zTeTT

T

IIR filter design by bilinear transformation: IIR filter deign using impulse invariance and approximation of derivative method have a sever limitation in that they are approximate only for low pass filter and limited calls of bandpass filter. In this we describe a mapping from s-plane to z-plane called bilinear transformation that overcomes the limitation of other two design method describe previously. Let us consider the analog filter with system function.

as

bsH

+=)( ………….. (1)

as

b

sX

sY

+=

)(

)(

Or, )()()( sbXsaYssY =+ Taking inverse laplace transform, we get,

)()()(

tbxtaydt

tdu =+

Taking integration on both sides.

∫ ∫∫−−

=+nT

TnT

nT

Tm

dttxdttyadtdt

tdu)()(

)(

Using Trapezoidal rule,

[ ])()(2/)( TnTgnTgTdttgnT

TnT

−+=∫−

Then,

Page 74: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -74

[ ])()(2/)()( TnTynTyaTTnTynTy −++−− ( )[ ]))(2/ TnTxnTxbT −+= Taking z-transform on both sides,

[ ] [ ])()(2/)()(2/)()( 11`1 zXzzXbTzYzzYaTzYzzY −−− +=++−

( )( )11

1

12/1

12/

)(

)(−−

++−+=

zaTz

zbT

zX

zY

az

z

T

bzH

+

+−

=

1

1

1

12)(

Hence,

+−= −

1

1

1

12

z

z

Ts

It gives the mapping form s-plane to z-plane. This is called bilinear transformation. To investigate the characteristics of bilinear transformation let, jwrez = Ω+= js σ

Now ,

+−=

1

12

z

z

Ts

=

+−

1

1jw

jw

re

re

=

+++−

1cos2

sin2122

2

wrr

wrjr

T

Comparing with, Ω+= js σ

++−=

1cos2

122

2

wrr

r

++=Ω

1cos2

sin222 wrr

wr

T

If r <1, then 0<σ and if r >1, then, 0>σ consequently, the LHP is S maps into inside a unit circle in z-plane and RHP in s maps into outside a unit circle. When, r = 1, 0=σ ,

+=Ω

w

w

T cos22

sin22

( )2tan2

wT

Ω= −

2tan2 1 T

w

Page 75: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 75

π

π/2

− π/2

− π

2 40 ΩT

ω

ω =2tan-1(ΩT/2)

Fig: mapping between frequency variables w and Ω resulting from bilinear transformation.

# Convert the analog filter with system ( ) 161.0

1.0)(

2 +++=

s

ssH a into digital IIR filter by means of

bilinear transformation the digital is to have resonant frequency of 2/π=rw . Solution: The resonant frequency of analog filter is 4=Ω r . & resonant frequency of digital filter is

2/tan2

rr wT

4

tan2

T=

2

1=∴T

Now ,

+−=

+−= −

1

1

1

1

1

14

1

1/2

z

z

z

zTs

Using bilinear, the system function of digital filter becomes

161.01

14

1.01

14

)(2

1

1

1

1

+

+

+−

+

+−

=

z

z

z

z

zH

11

21

95.00006.01

118.0006.0125.0−−

−−

++−+=

zz

zz

2

21

95.01

118.0006.0125.0)( −

−−

+−+=

z

zzzH

Page 76: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -76

Q. Design a single pole low pass digital filter factor with 3 dB bandwidth of 0.2π using the bilinear

transformation apply to the analog filter c

c

ssH

Ω+Ω

=)( . Where, cΩ is a 3dB bandwidth analog filter.

Solution: π2.0=cw ,

For analog filter.

2/tan2

cc wT

( )( )Ω= 1.0tan2

T

T

65.0=

Analog filter has system function

Ts

TsH

6.0

65.0)(

+=

Now,

+−= −

1

1

1

12

z

z

Ts

Then,

T

T

z

z

T

TzH

65.0

1

12

65.0)(

1

1

+

+−

=

= 1

1

35.165.2

)1(65,0−

−+

z

z

1

1

509.01

)1(245.0)( −

−+=

z

zzH

Matched z-transformation:- Another method for converting analog filter into equivalent digital filter is to map the poles and zeroes of H(s) directly into poles and zero in z-plane. Suppose the transfer function of analog filter is expressed in the factored formed.

)(

)()(

1

1

kNk

kMk

ps

zssH

−Π−Π

==

=

Where, kz and kp are zeroes and poles of the analog filter.

Then system function for digital filter is

)1(

)1()(

11

11

−=

−=

−Π−Π

=ze

zesH

TpNk

TzMk

k

k

Thus each factor of the form (s-a) in H(s) is mapped into the factor )1( 1−− zeaT . This mapping is called matched z-transformation.

Page 77: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 77

# Convert the analog filter with system function 9)1.0(

1.0)(

2 +++=

s

ssH a into digital IIR filter by matched

z-transformation method.

( )22 )3)1.0(

1.0)(

js

ssH a −+

+= = ( )

)31.0)(31.0(

1.0

jsjs

s

−++++

Using matched z-transformation method.

( )( )( )1)31.0(1)31.0(

11.0

11

1)( −+−−−−

−−

−−−=

zeze

zezH

TjTj

T

)1)(1(

)1(131.0131.0

11.0

−−−−−

−−−=

zeezee

zeTjTTjT

T

Date: 2066/10/7 Butter worth filter:

We have, nn jwT

22

2

1

1)(

ωε+=

When 12 =ε

nn jwT

2

2

1

1)(

ω+=

This function is known as Butterworth response. From this equation we observe some interesting properties of Butterworth response,

(1) The Butterworth filter is an all –pole filter. It has zero at infinity ( )∞→ω .

(2) 1)0( =jTn for all n.

(3) 707.02

1)1( ==jTn for all n. corresponding to 3 dB.

(4) For large ω , )( ωjTn exhibits n-pole roll-off.

n=2

n=1

n=3

Tn(jω)

ω

1

Fig: Maximally flat response.

Page 78: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -78

Butterwoth filter:- dBjwT )(log20)( −=ωα

Low pass filter specifications, Passband frequency = pΩ

Stopband frequency = sΩ

Passband attenuation = pα

Stopband attenuation = sα

Order of filter,

( )ps

p

s

nΩΩ

−−

=log2

110

110log 1.0

1.0

α

α

3-dB cutoff frequency,

( ) n

pc

p 2

11.0 110 −

Ω=Ω

α

Chebyshev filter: We have chebyshev magnitude response,

)(1

1)( 22

2

ωε nn C

jwT+

= ……………… (1)

)coscos()( 1ωω −= nCn for 1≤ω

)coshcosh( 1ω−= n for 1>ω ………………… (2)

With equation (2), the transfer function magnitude in (1) is determined for all values of ω . The function is plotted for n = 6.

n odd begin here

n even begin here

0

Fig: Sixth order chebyshev TF magnitude (1) 0)0( =nC for odd and 1)0( =nC for n even.

1)0( =jTn for n odd.

21

1)0(

ε+=jTn for n even.

Page 79: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 79

(2) At 1=ω , 1)1( =nC

21

1)0(

ε+=jTn for all n.

( )ps

p

s

nΩΩ

−−

= −

1

1.0

1.01

cosh110

110cosh α

α

- equal ripple filter. - High attenuation in stop band and steeper roll-off near the cut-off frequency.

* For dBdBand spsp 223.033.3,1 ===Ω=Ω αα Which filter is best.

Solution, For butterworth filter n = 5. for chebyshev filter n = 3. Greater efficiency of chebyshev filter compared with Butterworth filter. Frequency transformation:- If we wish to design a high pass or bandpass or bandstop filter it is a simple method to take a low pass prototype filter (butterwoth , chebyshev) perform a frequency transformation. One possibility is to perform the frequency transformation in analog domain and then to convert analog filter into corresponding digital filter by a mapping of s-plane into z-plane and alternative approach is first to convert the analog low pass filter into digital low pass filter into a desired digital filter by a digital transformation. In general, these two approaches yields different results except for bilinear transformation in which case the resulting filter designs are identical. Frequency transformation in analog domain:-

Type of transformation Transformation Band edge freq. of new filter. Low pass

sSp

p

'ΩΩ

→ 'pΩ

High pass

sS pp 'ΩΩ

→ 'pΩ

Band pass

( )Lu

uLp s

sS

Ω−ΩΩΩ+Ω→

2

uL ΩΩ ,

Band stop ( )uL

Lup s

sS

ΩΩ+Ω−ΩΩ→ 2 uL ΩΩ ,

Q. Transform the single pole low pass butterworth filter with the system function p

p

ssH

Ω+Ω

=)( into

band pass filter with upper and lower band edge frequency uΩ and LΩ respectively.

Solution:

Page 80: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -80

( )Lu

uLp s

sS

Ω−ΩΩΩ+Ω=

2

( ) pLu

uLp

p

s

ssH

Ω+Ω−ΩΩΩ+Ω

Ω= 2)(

( )

( ) uLLu

Lu

ss

s

ΩΩ+Ω−Ω+Ω−Ω= 2

Frequency transformation in digital domain (spectra transform): Conversion of prototype digital low pass filter into either band pass, band stop, high pass, or another low pass digital filter. Need of spectral transformation:- Impulse invariance method and mapping of derivative are inappropriate to use in designing high pass and many band pass filter due to a aliasing problem. Consequently one could not employ an analog frequency transformation followed by conversion of the result into digital domain by use of this two mapping instead it is much better to perform the mapping analog low pass filter into digital low pass filter by either of these mapping and then to perform frequency transformation in digital domain. The problem of aliasing is avoided.

Type of transformation Transformation parameter Low pass

1

11

1 −

−−

−−→

az

azz

filternewoffrequencyedgebandp ='ω

+

=

2sin

2sin

'

'[

pp

pp

aωω

ωω

High pass 1

11

1 −

−−

++−→

az

azz

+

−=

2cos

2cos

'

'[

pp

pp

aωω

ωω

Band pass

111

22

21

12

1

+−+−

−→ −−

−−−

zaza

azazz

frequencyedgebandLowerL =ω

frequencyedgebandUpperu =ω

1

21 +

=k

ka

α

1

12 +

−=k

ka

Page 81: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 81

+

−=

2cos

2cos

'

'

Lu

Lu

aωω

ωω

( )2/tan.2

cot'

pLuk ωωω

+=

Band stop

111

22

21

12

1

+−+−

→ −−

−−−

zaza

azazz

1

21 +

−=k

, k

ka

+−=

1

12

+

=

2cos

2cos

'

'

Lu

Lu

aωω

ωω

( )2/tan.2

tan'

pLuk ωωω

−=

# Design a low pass butterworth filter to meet the following specifications:- Passband gain = 0.89 Passband frequency = 30 hz. Attenuation = 0.20 Stopband edge = 75 Hz. Solution: sec/4.188302 radp =×=Ω π

sec/2.471752 rads =×=Ω π

dBp 01.1)89.0log(20 =−=α

dBs 98,13)20.0log(20 =−=α

( ) 3466.2/log2

110

110log 1.0

1.0

≈=ΩΩ

−−

=sp

p

s

α

3 –dB cut off frequency,

( ) sec/55.23110 1.0 rad

p

pc =

−Ω

=Ω α

From table for N = 3, and cΩ =1, we have

( )1/()11

)(2 +++

=sss

sH

Page 82: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -82

This function is normalized for cΩ =1. However cΩ = 235.55, we need to denormalized H(s) by

cΩ =235.55 rad/sec.

( )( )1//1/1

/)( 22 +Ω+Ω+Ω

=Ω= cccL sssss

sH

Where, cΩ = 235.55 rad/sec.

# Design a low pass FIR filter with specification πω 2.0=p , πω 65.0=s , dBp 4.0=α , dBs 5.1=α . Use

bilinear transformation method. Solution:

( ) ( ))1(649.0)2/2.0tan2

2/tan2 ==== T

TT pp πωα

( ) 263.32/tan2 ==Ω ss T

ω

Order of filter,

( ) 2783.1/log2

110

110log 1.0

1.0

≈=ΩΩ

−−

=sp

p

s

α

3 –dB cut off frequency,

( )164.1

110 2

11.0

=−

Ω=Ω

n

pc

From table for n = 2 and 1=Ωc , we have

14145.1

1)( 2 ++

=s

sH

Now denormalizing with 164.1=Ωc

1/41.1/1

/)( 22 +Ω+Ω

=Ω= cc ssss

sH

22

2

414.1c

c

css Ω+Ω+Ω

=

22 414.1ccss Ω+Ω+

Ω=

Now using bilinear transformation,

( )1,11

2112 =

+−=

+−= T

z

z

z

z

Ts

3548.111

2645.111

2

354.1)( 2

+

+−+

+−

=

z

z

z

zzH

Page 83: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 83

Q. Convert a given 2.0

2.0)(

+=

ssH p of band edge frequency 2.0=Ω p into a high pass filter )(sHn

with pass band edge frequency 5.0' =Ω p

Solution:

sss

S pp 1.05.02.0'

=×=ΩΩ

1.025.0

25.02.0/1.0

2.0)(

'

+=

+=

ΩΩ=

ssHsH pp

pn

5.0

)(+

=s

ssHn

Q. Use bilinear transformation to obtained digital low pass filter to approximate ( )12

12 ++

=ss

sH .

Assume cut off frequency of 100 Hz and sampling frequency of 1 khz. Solution:

( )sc fwithgNormalizin1000

1002 ×= πω

π2.0= rad/sec

( ) ( )165.02/tan2 ===Ω TT cc ω

Now, denormalizing H(s) with 65.0=Ωc we get,

( ) 165.0/265.0

1/

)()( 2

++

=

Ω==

ssss

sHsHc

L

4225.0919.0

4225.02 ++

=ss

Now we substitute, ( )111

2112 =

+−=

+−= T

z

z

z

z

Ts

4225.011

2919.011

2

4225.0)( 2

+

+−+

+−

=

z

z

z

zsH

Q. Using bilinear transformation design a butterwoth filter which satisfy the following condition.

1)(8.0 ≤≤ jweH 25.00 ≤≤ ω

2.0)( ≤jweH πω ≤≤6.0

Solution:

Page 84: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -84

Tn(jω)

ω

1Transition band

Pass band0.8

0.2

ωs = 0.2π ωs = 0.6π

Stop band

dBp 93.0)8.0log(20 =−=α

dBs 97.13)2.0log(20 =−=α

πω 2.0=p , πω 6.0=s

( ) 65.02/tan2 == pp T

ωα

( ) 75.02/tan2 == ss T

ωα

( )sp

p

s

nΩΩ

−−

=/log2

110

110log 1.0

1.0

α

α

( ) 75.0110

121.0

=−

Ω=Ω

np

pc α

From table, for n = 2 and 1=Ωc

1414.1

1)( 2 ++

=ss

sH

Now, denormalizing with 75.0=Ωc

( ) 1)75.0/(414.175.0/

1/

)( 2 ++=

Ω= sssssH

c

56.0065.1

56.02 ++

=s

Using bilinear transformation,

( ))1112 =

+−= r

z

z

Ts

56.011

206.111

2

56.0)( 2

+

+−+

+−

=

z

z

z

zsH

Page 85: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 85

Q. Convert low pass butterworth filter with system function 1

1

509.01)1(245.0

)( −

−+=

z

zsH into bandpass filter

with upper and lower cut off frequency uω and cω respectively. The low pass filter has 3 dB bandwidth

.2.0 πω =p ( )5/2,5/3 πωπω == Lu

Solution:

)2/tan(2

cot pLuk ωωω

−=

= 1

0

2cos

2cos

=

+

=Lu

Lu

ωω

ωω

α

01

21 =

+−=k

a kα

011

2 =+−=

k

ka

Now, 21 −− −→ zz TF becomes,

2

2

509.01)1(245.0

)( −

+−=

z

zzH

Date: 2066/10/9

Chapter: 7 FIR filter design:- FIR filter:- The digital filters can be classified either as finite duration unit impulse response (FIR) filters or infinite duration unit impulse response (IIR) filters depending upon the form of unit impulse response of the system. In FIR system the impulse response sequence is of finite duration. For example the system with impulse response,

=otherwise

systemFIRisnforzh

0

2)(

FIR filters are generally implemented using structures with no feedback (i.e non recursive structure). An FIR filters of length ‘N’ can be describe by the following difference equation. )1(........)1()()( 110 +−+−+= − mnxbnxbnxbny n

∑−

=

−=1

0

)()(,M

kk knxbnyor Where, bk is filter coefficient.

Symmetric and antisymmetric FIR filters: The unit sample response of FIR filter is symmetric if it satisfies the following condition. )1()( nMhnh −−= , n = 0, 1, 2, ……… M-1.

Page 86: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -86

As in example let us consider the unit sample response given in figure for M = 6 sample.

0 1 2 3 4 5

2

44

2

6 6

n

h(n)

h(n) = h (5-n) h(0) = h(5) =2 h(1) = h(4) = 4 h(2) = h(3) = 6 This is symmetric FIR filter. The unit sample response of FIR filter is antisymmetic if it satisfies the following condition. h(n) = -h (m-1-n) , n = 0, 1,……M-1 As an example let us consider the unit sample response shown in figure for M = 6 samples.

0 1 2 3 4 5

2

4

-4

-2

6

n

h(n)

-6 h(n) = -h(5-n) h(0)=-h(5) =2 h(1)=-h(4)=4 h(2)=-h(3)=6 This is antisymmetric FIR filter. Note: The condition for linearity phase FIR filters is h(n) )1( nMh −−±=

The phase of linear phase filter is

−−2

1Mj

# Show that the digital FIR filter with impulse response h(n). 2,4,6,6,4,2)( =nh is liner phase system. Is this antisymmetric?

Page 87: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 87

Solution: )1()( nMhnh −−±= Here, M = 6. )5()( nhnh −±= Where, h(0) = 2, h(1) = 4, h(2) = 6, h(3) = 6 h (4) = 4, h(5) = 2, h(0) = h(5) = 2 h(1) = h(4) = 4 h(2) = h(3) = 6 Hence the system has linear phase and h(n) is not antisymmetric since h(n) = h(M-1-n) # A digital filter has impulse response given by h(n) = 1, 0, 0, 0, 0, 0, -1. What is its system function. Which class of linear phase filter does this system belong to ? Justify. Solution: System function,

∑=

−=6

0

)()(n

nznhzH

61 −−= z Linear phase FIR filter satisfies the conditions, )1()( nMhnh −−±= Here, M= 7, h(n) = ± h(6-n) h(0) = -h(6) = 1 h(1) = - h(5) = 0 h(2) = -h(4) = 0 h(3) = -h(3) = 0 Hence, this system belong to antisymmetric. # A linear phase filter has a phase function e-j2w. What is the order of the filter. Solution: The phase of linear phase filter is given by,

−−= 2

1Mj

Comparing with wje 2

522

1 =⇒=−M

M

Design of FIR filter using fourier series method:- The frequency response Hd (e

jw) of a system is periodic in π2 .We know that , periodic function can be expressed as linear combination of complex exponentials. Therefore the desire frequency response of FIR filter may be represented by fourier series.

∑∞

−∞=

−=n

jd

jd

nenheH ωω )()( ……………. (1)

Where, the fourier coefficients hd(n) are the impulse response sequence of the filter given by,

∫−=π

πωω ωdeeHnh njj

dd )()( …………… (2)

Also, z-transform of the sequence is given by,

Page 88: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -88

H(z) = ∑∞

−∞=

n

nd znh )( …………… (3)

Equation (3) represents a non-causal digital filter of infinite duration to get an FIR filter transfer function the series can be truncated by assigning.

−≤=

otherwise

Nnfornh

nh d

02

1)(

)( …………… (4)

Then we have,

−−=

−=2

1

2

1

1)()(

N

Nn

znhzH ……………..(5)

( )2112

1

21

......)0(.........)1(2

1 −−

−−

−−++++

−= NN

zN

hhzhzN

h

[ ]∑

=

− −++=2

1

1

)()()0()(

N

n

nn znhznhhzH ………… (6)

For symmetrical impulse response symmetrical at n = 0. h(-n) = h(n) ………… (7) Therefore equation (6) becomes,

[ ]∑

=

−++=2

1

1

)()0()(

N

n

nn zznhhzH ………….. (8)

This TF is not physically realizable. Realizability can be brought by multiplying the equation (8) by

−2

1N

z .

Where, 2

1−N is delay in samples.

We have,

)(

2

1' )(

zHN

zzH

−−=

[ ]

++= ∑

=

−− 2

1

1

2

1

)()0(

N

n

nnN

zznhhz ………….. (9)

# Design ideal lowpass filter with following frequency response.

≤≤≤≤−

=πωπ

πωπω

2/0

2/2/1)(

for

foreH j

d

Determine the values of h(n) for N = 11. Find frequency response. Solution:

∫−=π

πωω ω

πdeeHnh njnj

dd )(21

)(

Page 89: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 89

∫−=2/

2/.1

21 π

πω ω

πde nj

0

Ηd(ejω)

−π/2 π/2

π

π

n

n2

sin= , ∞<<∞− n

Now truncating hd(w) to 11 samples, we get,

≤=

otherwose

nforn

nnh

0

52sin

)( π

π

h(0) = ½ h(1) = h(-1) = 0.3183 h(2) = h(-2) = 0 h(3) = h(-3) = -0.106 h(4) = h(-4) = 0 h(5) = h(-5) = 0.06366

TF, H(z) = h(0) + [ ]∑

=

−+2

1

1

)(

N

n

nn zznh

[ ]∑=

−++=5

1

)(5.0n

nn zznh

)(106.0)(3183.05.0 3311 −− +−++= zzzz + ( )5506366.0 −+ zz TF, of realizable filter will be,

)()()( 52

1' zHzzHzzH

N−

+−==

= 1086542 06366.0106.0318.05.0318.0106.006366.0 −−−−−− +−+++− zzzzzz From above, the filter coefficients of causal filer are given as, h(0) = h(10) = 0.06366 h(1) = h(9) = 0 h(2) = h(8) = -0.106 h(3) = h(7) = 0 h(4) = h(6) = 0.013183 h(5) = 0.5 Window techniques for designing FIR filters: In this method we begin with the design frequency response specification Hd(w) and determine the corresponding unit sample Hd(n) indeed Hd(n) is related to Hd(w) by the fourier transform relation.

Page 90: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -90

∑∞

=

−=0

)()(n

njdd enhH ωω ………… (1)

Where,

∫−=π

πω ωω

πdeHnh nj

dd )(21

)( ………….. (2)

In general unit sample response )(nHd obtained form equation (2) is infinite in duration and must be truncked at

some point say at n = M-1, to yield FIR filter of length ‘L’. Truncation of )(nHd to a length M-1 is equivalent to

multiplying )(nHd rectangular window defined as,

−=

=otherwise

Mnw

0

1..........2,1,01)(ω …………… (3)

This unit sample response of FIR filter becomes ,

h(n) = −=

=otherwise

Mnhnnh d

d 0

1........1,0)()( ω ………. (4)

It is instructive to consider the effect of window function on the desire frequency response )(ωdH . The

multiplication of the window function )(wω with )(nhd is equivalent to convolution of )(ωdH with )(ωW .

Where )(ωW is the frequency domain representation of window function.

∑−

=

−=1

0

)()(M

n

njenWW ωω …….. (5)

Thus the combination of Hd(ω ) with )(ωW yields the frequency response of FIR filter.

∫− −=π

πω

πω dvvWvHH d )()(

21

)(

Fourier transform of rectangular window is ,

∑−

=

−=1

0

)(M

n

njeW ωω

ω

ω

j

Mj

e

e−

−−=

11

( ) ( )( )2sin

2sin2/1

ωωω M

e Mj −−=

The window function has a magnitude response,

( )2sin

2sin()(

ωω

ωM

W = πωπ ≤≤−

And a piece wise linaer phase .

−=Θ2

1)(

Mωω When, 0)2/sin( ≥Mω

πω +

−−=2

1M When, ( )2sin Mω <0

Date: 2066/10/11

Page 91: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 91

Name of window Time domain sequence 10),( −≤≤ nnω

Rectangular 1 Hamming

0.54-0.46cos1

2−M

Hanning

−−

12

cos121

M

Kaiser

−−−

21

21

21

0

22

0

MI

Mn

MI

α

α

Where Io is zero order Bessel function.

Rectangular

HammingHanning

nM-10

1

0 M-1

kaiser

Name of window Window function.

−≤2

1),(

Mnnω

Hamming 0.54-0.46cos

12

−M

Hanning

−+

12

cos121

M

Gibbs phenomenon in FIR filter design:

0 frequency

Magnitude

M=61

M=31

Fig: frequency response of filter.

Page 92: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -92

We observe that relatively large oscillation or ripple occur near the band edge of filter the oscillation increases in the frequency as N increases but they do not diminish in amplitude. Large oscillation are direct result of large side lobes existing in frequency characteristics of )(ωW of rectangular window. Fourier series representation of

( )ωdH , multiplication of )(ωdh with rectangular window is identical to trunked in fourier series representation

of desire filter characteristic )(ωdH . The truncation of fourier series is known to introduce in frequency response

characteristic )(ωH due to non uniform convergence of fourier series at discontinuity. The oscillatory behavior near the band edge of the filer is called Gibbs phenomenon. To alleviate the presence of large oscillation in both the pass band and stop band we should use a window function that contains a taper and decay towards zero gradually instead of abruptly. Design of FIR filter by Frequency sampling method:- In the frequency sampling method of IIR filter design we specified the desire frequency response )(ωdH at a

set of equally spaced frequency.

Namely )(2 απω += kMk ………. (1)

Where, k = 0, 1, …….. 2

1−M for M odd.

K = 0, 1 ………. 12

−M for M even.

21

,0 or=α

And solve the unit sample respose n/w of the FIR filter from these equally spaced frequency specification. Now the desire frequency response is

H(w) = ∑−

=

−1

0

)(M

n

njenh ω

Suppose that we specify the frequency response of the filter at the frequency given by equation (i).

+=+ )(2

)( απα kM

HkH

( ) ( )∑ +−=+ MnkjenhkH /2)( απα ……………… (2)

Where, k = 0, 1, ……. M-1 It is simple matter to invert (2) and express )(ωh in terms of )( α+kH

∑−

=

++=1

/)(2)(1

)(M

ok

MnkjekHM

nh απα ……………. (3)

Where, n = 0, 1 …… M-1 This relationship in (3) allows us to compute the values of unit sample response h(n) from the specification of frequency sample )( α+kH , k = 0, 1, …..M-1. Note that when 0=α (2) reduces to discrete fourier transform (DFT) of the sequence h(n) and the expression (3) reduces to IDFT. # Design a low pass FIR filter with 11 coefficient for the following specification. Passband frequency = 0.25 khz Sampling frequency = 1 khz. Use rectangular window, Hamming window and hanning window. Solution:

Page 93: DSP

Downloaded from www.jayaram.com.np

- By Er. Manoj Basnet (Ass. Lecturer Eastern College of Engineering, Biratnagar)/ - 93

khzfc 25.0= 21

5.02 ππω =×=c

0

Η(ω)

−π/2 π/2

1

−π π

∫−=2/

2/.1

21

)(π

πω ω

πdenh nj

d

( )

)2/(2/sin

21

ππ

n

n=

hd(0) = ½ hd(1) = hd(-1) = 0.3148 hd(2) = hd(-2) = 0 hd(3) = hd(-3) = -0.0162 hd(4) = hd(-4) = 0 hd(5) = hd(-5) = 0.06369 Rectangular window:-

1)( =nw 55 ≤≤− n h(n) = hd(n) w(n) h(0) = hd(0) w(n) = 0.5 h(1) = hd(-1) = 0.3184 h(2) = hd(-2) = 0 h(3) = hd(-3) = -0.1062 h(4) = hd(-4) = 0 h(5) = hd(-5) = 0.06369 Hamming window:

Wham(n) = 0.54+0.46 cos

−12

M

−≤≤

−−2

12

1 Mn

M

= 0.54+0.46cos

102 nπ

55 ≤≤− π

)()()( nWnhnh hamd=

1)0( =hamW

9121.0)1()1( =−= hamham WW

6828.0)2()2( =−= hamham WW

3970.0)3()3( =−= hamham WW

1679.0)4()4( =−= hamham WW

08.0)5()5( =−= hamham WW

Page 94: DSP

Downloaded from www.jayaram.com.np

Downloaded from www.jayaram.com.np/ -94

5.0)0()0()0( == hamd Whh

2904.0)1()1( =−= hh

0)2()2( =−= hh

04225.0)3()3( −=−= hh

0)4()4( =−= hh

005095.0)5()5( =−= hh H(z) ………….. Similarly Hanning window………… Q. A low pass filter is required to be design with design frequency response which is expressed as follows, as we

≤≤

≤≤−=

πωππωπω

ω

4/0

4/2/)(

2

for

eeH

j

jd

Obtain the filter coefficient )(nhd if the window function is defined as,

≤≤

=otherwise

nnW

0

401)(

Q. Design a low pass filter having desire frequency response given as,

≤≤≤≤

=−

πωππωω

ω

/0

2/0)(

3jj

d

eeH

Obtain filter coefficient h(n) for M = 7 using frequency sampling method. Solution:

( )απ += kM

Wk

2

0=α

7/26

0

7/32

71

)( knj

k

kj eenh ππ∑=

−= n = 0, 1, ……. 6.

== ∑=

−6

0

7/6

71

)0(k

kjeh π

# Remez exchange algorithm (prokish book बाट आफ पन)

Reference for chapter (8)

- TMS 320 Texas instrument (Sanjaya sharma) - Bit serial arithmetic (Digital logic book) - Serial adder. - Distributed arithmetic and pipelined implementation.