1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar [email protected].

30
1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar [email protected]

Transcript of 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar [email protected].

Page 1: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

1

Digital Signal Processing

Lecture 3 – 4By

Dileep [email protected]

Page 2: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

2

Analog to Digital and Digital to Analog Conversion

• A/D conversion can be viewed as a three step process

1. Sampling: This is the conversion of a continuous time signal into a discrete time signal obtained by taking “samples” of the continuous time signal at discrete time instants. Thus, if x(t) is the input to the sampler, the output is x[nT], where T is called the Sampling interval.

2. Quantization: This is the conversion of discrete time continuous valued signal into a discrete-time discrete-value (digital) signal. The value of each signal sample is represented by a value selected from a finite set of possible values. The difference between unquantized sample and the quantized output is called the Quantization error.

Page 3: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

3

Analog to Digital and Digital to Analog Conversion (cont.)

3. Coding: In the coding process, each discrete value is represented by a b-bit binary sequence.

QuantizerSampler Coderx(t) 0101...

A/D Converter

Page 4: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

4

Sampling of Analog Signals

0 2 4 6-1

-0.8

-0.6

-0.4

-0.20

0.2

0.4

0.6

0.8

1

t

anal

og

sig

nal

0 2 4 6-1

-0.8

-0.6

-0.4

-0.20

0.2

0.4

0.6

0.8

1

sam

ple

d s

ign

al

n

Uniform Sampling:

Page 5: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

5

Uniform sampling• Uniform sampling is the most widely used sampling scheme.

This is described by the relation

x[n] = x[nT] - < n < where x(n) is the discrete time signal obtained by taking samples of the analogue signal x(t) every T seconds.

The time interval T between successive symbols is called the Sampling Period or Sampling interval and its reciprocal 1/T = Fs is called the Sampling Rate (samples per second) or the Sampling Frequency (Hertz).

A relationship between the time variables t and n of continuous time and discrete time signals respectively, can be obtained as

sF

nnTt (1)

Page 6: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

6

• A relationship between the analog frequency F and the discrete frequency f may be established as follows.

Consider an analog sinusoidal signal

x(t) = Acos(2Ft + )

which, when sampled periodically at a rate Fs = 1/T samples per second, yields

sF

nF2cosAFnT2cosA]nT[x (2)

But a discrete sinusoid is generally represented as

fn2cosA]n[x (3)

Comparing (2) and (3) we get

sF

Ff (4)

Page 7: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

7

Since the highest frequency in a discrete time signal is f = ½. Therefore, from (4) we have

T2

1

2

FF s

max (5)

or

Fs = 2 Fmax(6)

Sampling Theorem:If x(t) is bandlimited with no components of frequencies greaterthan Fmax Hz, then it is completely specified by samples taken atthe uniform rate Fs > 2Fmax Hz. The minimum sampling rate or minimum sampling frequency, Fs = 2Fmax, is referred to as the Nyquist Rate or NyquistFrequency. The corresponding time interval is called the NyquistInterval.

Page 8: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

8

Sampling Theorem (cont.)

• Signal sampling at a rate less than the Nyquist rate is referred to as undersampling.

• Signal sampling at a rate greater than the Nyquist rate is known as the oversampling.

Example 1:The following analogue signals are sampled at a sampling frequency of 40 Hz. Find the corresponding discrete time Signals.(i) x(t) = cos2(10)t (ii) y(t) = cos2(50)tSolution: (i) n

2cosn

40

102cos]n[x

(ii) n2

cosn2

5cosn

40

502cos]n[x

Note: The frequency F2 = 50 Hz is an alias of F1 = 10 Hz. All of the

Page 9: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

9

Example 2

Consider the analog signal

x(t) = 3cos100t

(a) Determine the minimum required sampling rate 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?

Solution:

(a) The frequency of the analog signal is F = 50 Hz. Hence the minimum sampling rate to avoid aliasing is 100Hz.

(b) n2

cos3n200

100cos3]n[x

Page 10: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

10

Example 3

Consider the analog signalx(t) = 3cos50t + 10sin300t - cos100tWhat is the Nyquist rate for this signal.Solution:The frequencies present in the signal above are

F1 = 25 Hz, F2 = 150 Hz F3 = 50 Hz.

Thus Fmax = 150 Hz. Nyquist rate = 2.Fmax = 300 Hz.Note: It should be observed that the signal component

10sin300t, sampled at 300 Hz results in the samples 10sinn, which are identically zero, hence we miss the signal component completely.

What should we do to avoid this situation????

Page 11: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

11

Tutorial 3Q1: Find the minimum sampling rate that can be used to obtain samples

that completely specify the signals:

(a) x(t) = 10cos(20t) – 5cos(100t) + 20cos(400t)

(b) y(t) = 2cos(20t) + 4sin(20t - /4) + 5cos(8t)

Q2: Consider the analog signal

x(t) = 3cos2000t + 5sin6000t + 10cos12000t

(a) What is the Nyquist rate for this signal?

(b) Assume now that we sample this signal using a sampling rate Fs = 5000 samples/s. What is the discrete time signal obtained after sampling?

Q3: An analog electrocardiogram (ECG) signal contains useful frequencies up to 100 Hz. What is the Nyquist rate for this signal?

Page 12: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

12

Some Elementary Discrete Time signals

• Unit Impulse or unit sample sequence:

It is defined as

In words, the unit sample sequence is a signal that is zero everywhere, except at t = 0.

0n0

0n,1n

Unit impulse function

-3 -2 -1 0 1 2 30

0.2

0.4

0.6

0.8

1

Page 13: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

13

Some Elementary Discrete Time signals

• Unit step signal

It is defined as

0n0

0n,1]n[u

0 1 2 3 4 5 6 700.20.40.60.8

11.21.41.61.8

2

Page 14: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

14

Some Elementary Discrete Time signals

• Unit Ramp signal

It is defined as

0n0

0n,n]n[r

0 1 2 3 4 5 60

1

2

3

4

5

6

Page 15: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

15

Some Elementary Discrete Time signals

• Exponential Signal

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 a real signal. The following figure illustrates x[n] for various values of a.

a>1

-1<a<0 a<-1

0<a<1

Page 16: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

16

Some Elementary Discrete Time signals

• Exponential Signal (cont)when the parameter a is complex valued, it can be expressed as

where r and are now the parameters. Hence we may express x[n] as

Since x[n] is now complex valued, it can be represented graphically by plotting the real part

as a function of n, and separately plotting the imaginary part

as a function of n. (see plots on the next slide)

jrea

nsinjncosrer]n[x njn

ncosr]n[x nR

nsinr]n[x nI

Page 17: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

17

0 10 20 30 40 50 60-0.5

0

0.5

1

0 10 20 30 40 50 60-0.5

0

0.5

1xI[n] = (0.9)nsin(n/10)

xR[n] = (0.9)ncos(n/10)

Page 18: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

18

Exponential Signal (cont.)Alternatively, the signal x[n] may be graphically represented by the amplitude or magnitude function

|x[n]| = rn

and the phase function

[n] = n

The following figure illustrates |x[n| and [n] for r = 0.9 and = /10.

- 0 5 100

2

|x[n

]|

- 0 5 10-20

4

n

[n

]

Page 19: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

19

Discrete Time Systems

• A discrete time system is a device or algorithm that operates on a discrete time signal x[n], called the input or excitation, according to some well defined rule, to produce another discrete time signal y[n] called the output or response of the system.

• We express the general relationship between x[n] and y[n] as

y[n] = H{x[n]}

where the symbol H denotes the transformation (also called an operator), or processing performed by the system on x[n] to produce y[n].

Discrete Time System H

x[n] y[n]

Page 20: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

20

Example 4• Determine the response of the following

systems to the input signal:

(a) y[n] = x[n](b) y[n] = x[n-1](c) y[n] = x[n+1](d) y[n] = (1/3)[x[n+1] + x[n] + x[n-1]](e) y[n] = max[x[n+1],x[n],x[n-1]]

otherwise,0

3n3|,n|]n[x

n

k

]k[x]n[y(f)

Page 21: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

21

• Solution:

(a) In this case the output is exactly the same as the input signal. Such a system is known as the identity System.

(b) y[n] = [……,3, 2, 1, 0, 1, 2, 3,……]

(c) y[n] = […….,3, 2, 1, 0, 1, 2, 3,…….]

(d) y[n] = […., 5/3, 2, 1, 2/3, 1, 2, 5/3, 1, 0,…]

(e) y[n] = [0, 3, 3, 3, 2, 1, 2, 3, 3, 3, 0, ….]

(f) y[n] = […,0, 3, 5, 6, 6, 7, 9, 12, 0, …]

Page 22: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

22

Classification of Discrete Time Systems

• Static versus Dynamic Systems

A discrete time system is called static or memory-less if its output at any instant n depends at most on the input sample at the same time, but not on the past or future samples of the input. In any other case, the system is said to be dynamic or to have memory.

Examples: y[n] = x2[n] is a memory-less system, whereas the following are the dynamic systems:

(a) y[n] = x[n] + x[n-1] + x[n-2]

(b) y[n] = 2x[n] + 3x[n-4]

Page 23: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

23

Time Invariant versus Time Variant Systems• A system is said to be time invariant if a time delay or time

advance of the input signal leads to an identical time shift in the output signal. This implies that a time-invariant system responds identically no matter when the input is applied. Stated in another way, the characteristics of a time invariant system do not change with time. Otherwise the system is said to be time variant.

• Example1: Determine if the system shown in the figure is time invariant or time variant.

Z-1

x[n] y[n]

-

+Solution: y[n] = x[n] – x[n-1]Now if the input is delayed by k unitsin time and applied to the system, the Output isy[n,k] = n[n-k] – x[n-k-1] (1)On the other hand, if we delay y[n] by k units in time, we obtainy[n-k] = x[n-k] – x[n-k-1] (2)(1) and (2) show that the system is time invariant.

Page 24: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

24

Time Invariant versus Time Variant Systems

• Example 2: Determine if the following systems are time invariant or time variant.

(a) y[n] = nx[n] (b) y[n] = x[n]cosw0nSolution:(a) The response to this system to x[n-k] is

y[n,k] = nx[n-k] (3)Now if we delay y[n] by k units in time, we obtainy[n-k] = (n-k)x[n-k]= nx[n-k] – kx[n-k] (4)which is different from (3). This means the system is time-variant.

(b) The response of this system to x[n-k] is

y[n,k] = x[n-k]cosw0n (5)If we delay the output y[n] by k units in time, then

y[n-k] = x[n-k]cosw0[n-k] which is different from that given in (5), hence the system is time variant.

Page 25: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

25

Tutorial 4

Q4: Determine whether the following systems are time invariant or time variant.

(a) y[n] = y[n-1] + 2x[n] – 3x[n-1] + 2x[n-2]

(b) y[n] – (y[n-2])/n = 2x[n]

Page 26: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

26

Linear versus Non-linear Systems

A system H is linear if and only if

H[a1x1[n] + a2x2[n]] = a1H[x1[n]] + a2H[x2[n]]

for any arbitrary input sequences x1[n] and x2[n], and any arbitrary constants a1 and a2.

+ H

H

H

+

x1[n]

x2[n]

a1

a2

x1[n]

x2[n]

a1

a2

y1[n]

y2[n]

If y1[n] = y2[n], then H is linear.

Page 27: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

27

ExamplesDetermine if the following systems are linear or nonlinear.

(a) y[n] = nx[n]Solution:

For two input sequences x1[n] and x2[n], the corresponding outputs are

y1[n] = nx1[n] and y2[n] = nx2[n]A linear combination of the two input sequences results in the output

H[a1x1[n] + a2x2[n]] = n[a1x1[n] + a2x2[n]] = na1x1[n] + na2x2[n] (1)On the other hand, a linear combination of the two outputs results in the

out

a1y1[n] + a2y2[n] = a1nx1[n] + a2nx2[n] (2)Since the right hand sides of (1) and (2) are identical, the system is linear.

Page 28: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

28

(b) y[n] = Ax[n] + BSolution:

Assuming that the system is excited by x1[n] and x2[n] separately, we obtain the corresponding outputs

y1[n] = Ax1[n] + B and y2 = Ax2[n] + B

A linear combination of x1[n] and x2[n] produces the output

y3[n] = H[a1x1[n] + a2x2[n]] = A[a1x1[n] + a2x2[n]] + B

= Aa1x1[n] + Aa2x2[n] + B (3) On the other hand, if the system were linear, its output to the linear

combination of x1[n] and x2[n] would be a linear combination of y1[n] and y2[n], that is,

a1y1[n] + a2y2[n] = a1Ax1[n] + a1B + a2Ax2[n] + a2B (4)Clearly, (3) and (4) are different and hence the system is nonlinear.

Under what conditions would it be linear?

Tutorial 2 Q5: Determine whether the systems of Tutorial 4 Q4 are linear.

Page 29: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

29

Causal versus Noncausal Systems

A system is said to be causal if the output of the system at any time n [i.e. y[n]) depends only on present and past inputs but does not depend on future inputs.

Example: Determine if the systems described by the following input-output equations are causal or noncausal.(a) y[n] = x[n] – x[n-1] (b) y[n] = ax[n] (c) (d) y[n] = x[n] + 3x[n+4] (e) y[n] = x[n2] (f) y[n] = x[-n]

Solution: The systems (a), (b) and (c) are causal, others are non-causal.

n

k

]k[x]n[y

Page 30: 1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar dk_2kes21@yahoo.com.

30

Stable versus Nonstable Systems

A system is said to be bonded input bounded output (BIBO) stable if and only if every bounded input produces a bounded output.