File

advertisement
Digital Signal Processing
Lecture 3 – 4
By
Dileep kumar
dk_2kes21@yahoo.com
1
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 discretevalue (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.
2
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.
0101...
x(t)
Sampler
Quantizer
Coder
A/D Converter
3
Sampling of Analog Signals
Uniform Sampling:
1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
0
sampled signal
analog signal
1
0.8
0.6
0.4
0.2
0
-0.2
-0.4
-0.6
-0.8
-1
0
2
t
4
6
2
n
4
6
4
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
n
t  nT
(1) 5
Fs
• 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(2Ft + )
which, when sampled periodically at a rate Fs = 1/T samples
per second, yields
 2n F

x[n T]  A cos2Fn T     A cos
  
 Fs

(2)
But a discrete sinusoid is generally represented as
x[n]  A cos2fn  
(3)
Comparing (2) and (3) we get
F
f 
Fs
(4)
6
Since the highest frequency in a discrete time signal is f = ½.
Therefore, from (4) we have
Fmax 
Fs
1

2
2T
(5)
or
Fs = 2 Fmax
(6)
Sampling Theorem:
If x(t) is bandlimited with no components of frequencies greater
than Fmax Hz, then it is completely specified by samples taken at
the uniform rate Fs > 2Fmax Hz.
The minimum sampling rate or minimum sampling frequency,
Fs = 2Fmax, is referred to as the Nyquist Rate or Nyquist
Frequency. The corresponding time interval is called the Nyquist
7
Interval.
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)t
Solution:


(i) x[n]  cos 2 10
n  cos n
40
2

(ii)



5

 50 
x[n]  cos 2 n  cos n  cos n
2
2
 40 
Note: The frequency F2 = 50 Hz is an alias of F1 = 10 Hz. All of the
8
Example 2
Consider the analog signal
x(t) = 3cos100t
(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.
100 

n  3 cos n
(b) x[n]  3 cos
200
2
9
Example 3
Consider the analog signal
x(t) = 3cos50t + 10sin300t - cos100t
What 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
10sin300t, sampled at 300 Hz results in the samples
10sinn, which are identically zero, hence we miss the signal
component completely.
What should we do to avoid this situation????
10
Tutorial 3
Q1: Find the minimum sampling rate that can be used to obtain samples that
completely specify the signals:
(a) x(t) = 10cos(20t) – 5cos(100t) + 20cos(400t)
(b) y(t) = 2cos(20t) + 4sin(20t - /4) + 5cos(8t)
Q2: Consider the analog signal
x(t) = 3cos2000t + 5sin6000t + 10cos12000t
(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?
11
Some Elementary Discrete Time signals
• Unit Impulse or unit sample sequence:
It is defined as
1,
n  
0
n0
n0
In words, the unit sample sequence is a signal that is zero
everywhere, except at t = 0.
1
0.8
0.6
0.4
0.2
0
-3
-2
-1
0
1
Unit impulse function
2
3
12
Some Elementary Discrete Time signals
• Unit step signal
It is defined as
1,
u[n]  
0
2
1.8
1.6
1.4
1.2
1
0.8
0.6
0.4
0.2
00
n0
n0
1
2
3
4
5
6
7
13
Some Elementary Discrete Time signals
• Unit Ramp signal
It is defined as
n, n  0
r[n]  
0 n  0
6
5
4
3
2
1
00
1
2
3
4
5
6
14
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.
0<a<1
-1<a<0
a>1
a<-1
15
Some Elementary Discrete Time signals
• Exponential Signal (cont)
when the parameter a is complex valued, it can be expressed
as
a  re
j
where r and  are now the parameters. Hence we may
express x[n] as
x[n]  rne j  rn cosn  j sinn
Since x[n] is now complex valued, it can be represented
graphically by plotting the real part
xR [n]  r cosn
n
as a function of n, and separately plotting the imaginary part
xI [n]  rn sinn
as a function of n. (see plots on the next slide)
16
1
xR[n] = (0.9)ncos(n/10)
0.5
0
-0.5
0
10
20
30
40
50
60
50
60
1
xI[n] = (0.9)nsin(n/10)
0.5
0
-0.5
0
10
20
30
40
17
Exponential Signal (cont.)
|x[n]|
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.
2
04
0
-2-
0
5
10
0
5
10
n
18
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].
x[n]
Discrete Time System
H
y[n]
19
Example 4
•
Determine the response of the following
systems to the input signal:
| n |,  3  n  3
x[n]  
othe rwi se
 0,
(a)
(b)
(c)
(d)
(e)
(f)
y[n] = x[n]
y[n] = x[n-1]
y[n] = x[n+1]
y[n] = (1/3)[x[n+1] + x[n] + x[n-1]]
y[n] = max[x[n+1],x[n],x[n-1]]
y[n] 
n
 x[k ]
k  
20
•
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, …]
21
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]
22
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.
y[n]
Solution: y[n] = x[n] – x[n-1]
x[n]
+
Now if the input is delayed by k units
in time and applied to the system, the
-1
Z
Output is
y[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 obtain
y[n-k] = x[n-k] – x[n-k-1]
(2)
23
(1) and (2) show that the system is time invariant.
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]cosw0n
Solution:
(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 obtain
y[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.
24
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]
25
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.
a1
x1[n]
y1[n]
+
H
a2
x2[n]
a1
x1[n]
x2[n]
H
H
a2
If y1[n] = y2[n], then H is linear.
+
y2[n]
26
Examples
Determine 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.
27
(b) y[n] = Ax[n] + B
Solution:
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.
28
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) y[n]   x[k ]
(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  
29
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.
30
Download