You are on page 1of 70

DISCRETE-TIME LINEAR SYSTEM

Pham Van Tuan


Electronic & Telecommunication Engineering Danang University of Technology

Goals
n

To provide students with the fundamental concepts of digital signal processing. To study discrete-time signal and system analysis using time-domain, Fourier and Z-transform techniques. To build proficiency in signal analysis with Matlab. Textbooks: C. Phillips, J. Parr and E. Riskin, Signals, Systems and Transforms, Prentice Hall, 2003. A. Oppenheim, A. Willsky and S. Hamid Nawab, Signals and Systems, Prentice Hall, 1996. Grading: HW 20%; Midterm 20%; Lab 30%; Final exam 30%

Learning Objectives
At the end of this course, students will be able to:
n

n n n

n n

Describe discrete-time signals in different domains (time, frequency, and Z) and map characteristics in one domain to those in another (e.g. distinguish between high and low frequency components of time signals). Understand the implications of different system properties and how to test for them. Perform convolutions for arbitrary and closed-form discrete-time signals. Analyze LTI systems given different system representations (including input-output equations, impulse response, frequency response and transfer function), and translate between these different representations. Solve linear difference equations associated with linear digital filters by classical techniques and the Z-Transform method. Use and understand standard EE terminology associated with digital filtering and LTI systems (e.g. LPF, HPF, impulse response, step response, etc.) Implement filters, analyze frequency content of signals and responses of systems, design filters and synthesize signals using Matlab tools.

CHAPTER 1: INTRODUCTION
Lesson #1: A big picture about Digital Signal Processing Lesson #2: Analog-to-Digital and Digital-to-Analog conversion Lesson #3: The concept of frequency in CT & DT signals

A Big Picture About Digital Signal Processing


n

Outline: 1. Signals 2. Digital Signal Processing (DSP) 3. Why DSP?

******* Learning Digital Signal Processing is not something you accomplish; its a journey you take. R.G. Lyons, Understanding Digital Signal Processing

Signals ?
n

Given a continuous-time (CT) signal x(t), we can sample it to generate the discrete-time (DT) signal x(n)

x(n) = x(nT ), where T is the sampling period


n n n n n

1-D signals: speech, audio, biosensor, ECG, etc. 2-D signals: image (optical, X-ray, MRI), remote sensing data, etc. 2.5-D signals: video, ultrasound images (2-D + time) 3-D signals: graphics and animation Multi-D signals: multi-spectral data, sonar array etc.

1-D Signals
EEG ECG

Speech signal Color image

1-D Signals

2-D Image Signals

Binary image???

Grey image (indexed image)

Color image

2-D Image Signals (MRI)


ECA ICA

Imaging location CCA

Plaque

CCA

Bifurcation

ICA

2.5-D Video Signals

3-D Animated Signals

Why Need Signal Processing ?


n

Signal processing is an operation designed for extracting, enhancing, storing and transmitting expected (useful) information. Which are expected (useful) and unwanted (noisy) information ? Very much depend on subjective and objective of application. Teamwork and give examples How to process signals? In practice, mostly deal with analog signals. They are processed by analog devices (active and passive elements ?): Analog Signal Processing Draw scheme ?

What is DSP ?
n n

Process signals based on digital hardware containing: adders, multipliers, logic elements Can be general-purpose computer or specific-purpose microp. or digital hardware Equivalent analog signal processor Analog PrF ADC DSP DAC PoF Analog

n n n

PrF: Pre-filter or antialiasing Filter ADC/DAC: Analog-to-digital and Digital-to-Analog converters PoF: Post-filter to smooth out staircase waveform

Why DSP ?
n n

It seems that ASP is simpler looking than DSP. Advantages of DSP over ASP:
Relatively

develop, test on general purpose computer Extremely stable processing capability Easily and flexibly be modified in real time Normally with higher precision Can be cost-effective (DSPs, VLSI, FPGA, ASIC)
n

Disadvantages ?
q A/D and D/A needed aliasing error and quantization error q Not suitable to high-frequency signal q Require high technology

Radar

Biomedical
Analysis of biomedical signals, diagnosis, patient monitoring, preventive health care

Image Processing
Image enhancement: processing an image to be more suitable than the original image for a specific application

It makes all the difference whether one sees darkness through the light or brightness through the shadows David Lindsay

Image Compression
Image compression: reducing the redundancy in the image data

UW Campus (bmp) 180 kb

UW Campus (jpg) 13 kb

Music
Recording, encoding, storing

Playback Manipulation/mixing

Communication

Digital telephony: transmission of information in digital form via telephone lines, modern technology, mobile phone

Speech Compression

Speech Recognition

Fingerprint Recognition

Image Restoration

Image restoration: reconstruct a degraded image using a priori knowledge of the degradation phenomenon

Noise Removal

Information Technologies Are Driving Fast


n

n n n

Image Sensors: Digital Still Camera (DSC), PC Camera (CCD and CMOS), Digital Camcorder, portable scanners, etc. Powerful Computers: faster and multi-core CPU, low power embedded CPU, USB2 ports, CD/DVD RW, flash memory & mini disk, etc. Data Compression: audio/image/video coding (data compression) standards. HDTV and digital radio. 2D/3D graphics/video cards: faster display and better quality. Communication: Internet, ATM, ADSL, wireless LAN, WiMAX, WDM in optics, transceiver/modem, etc.

Digital Signal Processing Implementation


Performed by:
n

Special-purpose (custom) chips: application-specific integrated circuits (ASIC) Field-programmable gate arrays (FPGA) General-purpose microprocessors or microcontrollers (P/C) General-purpose digital signal processors (DSP processors) DSP processors with application-specific hardware (HW) accelerators

n n n n

Digital Signal Processing Implementation

Two Main Categories of DSP

APPLICATIONS Spectrum analysis Feature extraction Signal detection Signal estimation Signal verification Signal recognition Signal modeling

Analyze

Filter

APPLICATIONS Noise removal Interference separation Signal compression Signal coding Signal synthesis Spectrum shaping

Measures

Processed

Analog-to-Digital and Digital-to-Analog Conversion


n

Outline: 1. A/D conversion 2. D/A conversion

Analog-to-Digital Conversion

Sampling

Continuous-time signal discrete-time signal

Analog world

Sampling

Digital world

Sampling Case Study


n

Taking samples at intervals and dont know what happens in between cant distinguish higher and lower frequencies: aliasing How to avoid aliasing?

Nyquist Sampling Theory


n

To guarantee that an analog signal can be perfectly recovered from its sample value Theory: a signal with maximum of frequency of W Hz must be sampled at least 2W times per second to make it possible to reconstruct the original signal from the samples Nyquist sampling rate: minimum sampling frequency Nyquist frequency: half the sampling rate Nyquist range: 0 to Nyquist frequency range To remove all signal elements above the Nyquist frequency antialiasing filter

n n n n

Anti-aliasing Filter
magnitude
Anti-aliasing filter response Analog signal spectrum

frequency 0 W 2W =fs 3W 4W

magnitude

Filtered analog signal spectrum frequency 0 W 2W =fs 3W 4W

Some Examples of Sampling Frequency


n

Speech coding/compression ITU G.711, G.729, G.723.1: fs = 8 kHz T = 1/8000 s = 125s

Broadband system ITU-T G.722: fs = 16 kHz T = 1/16 000 s = 62.5s

Audio CDs: fs = 44.1 kHz T = 1/44100 s = 22.676s

Audio hi-fi, e.g., MPEG-2 (moving picture experts group), AAC (advanced audio coding), MP3 (MPEG layer 3): fs = 48 kHz T = 1/48 000 s = 20.833s

Sampling and Hold


n n

Sampling interval Ts (sampling period): time between samples Sampling frequency fs (sampling rate): # samples per second

Analog signal

Sample-and-hold signal

Quantization Errors & Coding


n

Quantized sample N-bit code word

1.5V 1.0V 0.5V 0.0V 0.82V

1.1V

1.25V

Example of Quantization & Coding


Analog pressures are recorded, using a pressure transducer, as voltages between 0 and 3V. The signal must be quantized using a 3-bit digital code. Indicate how the analog voltages will be converted to digital values.
Quantization Digital code Level (V) Range of analog inputs (V)

000 001 010 011 100 101 110 111

0.0 0.375 0.75 1.125 1.5 1.875 2.25 2.625

0.0-0.1875 0.1875-0.5625 0.5625-0.9375 0.9375-1.3125 1.3125-1.6875 1.6875-2.0625 2.0625-2.4375 2.4375-3.0

Example of Quantization & Coding


An analog voltage between -5V and 5V must be quantized using 3 bits. Quantize each of the following samples, and record the quantization error for each: -3.4V; 0V; .625V
Digital code Quantization Level (V) Range of analog inputs (V)

100 101 110 111 000 001 010 011

-5.0 -3.75 -2.5 -1.25 0.0 1.25 2.5 3.75

-5.0 -4.375 -4.375-3.125 -3.125-1.875 -1.875-0.625 -0.6250.625 0.6251.875 1.8753.125 3.1255.0

Quantization Parameters
n n n n n

Number of bits: N Full scale analog range: R Resolution: the gap between levels Q = R/2N Quantization error = quantized value actual value Dynamic range: number of levels, in decibel Dynamic range = 20log(R/Q) = 20log(2N) = 6.02N dB

Signal-to-noise ratio SNR = 10log(signal power/noise power) Or SNR = 10log(signal amplitude/noise amplitude)

Bit rate: the rate at which bits are generated Bit rate = N.fs

Noise Removal by Quantization


Error

Noise
Q Q/2

Quantized signal + noise

After re-quantization

Non-uniform Quantization
n

Quantization with variable quantization step Q value is variable


Output

Q value is directly proportional to signal amplitude SNR is constant Most used in speech

Nonuniform

Uniform Input

A-law Compression Curve


A s ( t ) 1 , 1 + ln A s 2 ( t ) = 1 + ln(A s1 ( t ) ) , 1 + ln A 0 s1 ( t ) 1 A

1 < s1 ( t ) 1 A

s2(t)
1.0

A=87.6 A=5 - 1.0 0 A=1 1.0

s1(t)

- 1.0

ITU G.711 A-law curve


Code-word format:
1.0 7/8 6/8 5/8 4/8 3/8 2/8 1/8 0 5 6 7 8 1/16 1/8 1/4 1/2 1.0 4 3 2 1 Sign bit 0/1 Part 1 (3bits) 000 111 Part 2 (16bits) 0000 1111

Example of G.711 code word


n

A quantized-samples value is +121

Sign bit: 0 Part 1: 010 Part 2: 1110 Code word: 00101110 Decoding value: +122
n

A quantized-samples value is -121

Code word: 10101110

Digital-to-Analog and Digital-to-Analog Conversion

Outline: 1. A/D conversion 2. D/A conversion

DAC

Anti-imaging Filter
magnitude

Anti-imaging filter

Images

2W =fs

4W = 2fs frequency

Original two-sided analog signal spectrum

HW

Prob.1. An analog signal is converted to digital and then back to analog signal again, without intermediate DSP. In what ways will the analog signal at the output differ from the one at the input?

HW
Prob.2. An analog signal is sampled at its Nyquist rate 1/ Ts, and quantized using L quantization levels. The derived signal is then transmitted on some channels. (a) Show that the time duration, T, of one bit of the transmitted binary encoded signal must satisfy

T Ts /(log 2 L)
(b) When is the equality sign valid?

HW
n 0 1 2 3 4 5 6 7 8 Sample(V) 0.5715 4.9575 0.6250 3.6125 4.0500 0.9555 2.8755 1.5625 2.7500

Prob.3. A set of analog samples, listed in table 1, is digitized using the quantization table 2. Determine the digital codes, the quantized level, and the quantization error for each sample.

Quantization Digital code 000 001 010 011 100 101 110 111 Level (V) 0.0 0.625 1.250 1.875 2.500 3.125 3.750 4.375

Range of analog inputs (V) 0.0 0.3125 0.31250.9375 0.93751.5625 1.56252.1875 2.18752.8125 2.81253.4375 3.43754.0625 4.06255.0

HW
Prob.4. Consider that you desire an A/D conversion system, such that the quantization distortion does not exceed 2% of the full scale range of analog signal. (a) If the analog signals maximum frequency is 4000 Hz, and sampling takes place at the Nyquist rate, what value of sampling frequency is required? (b) How many quantization levels of the analog signal are needed? (c) How many bits per sample are needed for the number of levels found in part (b)? (d) What is the data rate in bits/s?

HW

Prob.5. An analog voice signal with voltage between -5V and 5V must be quantized using ITU G.711 standard. Encode each of the following samples; and record the quantization error for each: (a) -3.45198 V (b) 1.01119 V

HW

Prob.6. A 3-bit D/A converter produces a 0 V output for the code 000 and a 5 V output for the code 111, with other codes distributed evenly between 0 and 5 V. Draw the zero order hold output from the converter for the input below: 111 101 011 101 000 001 011 010 100 110

Frequency Concepts of CT & DT Signals

Outline: 1. CT sinusoidal signals 2. DT sinusoidal signals 3. Relations among frequency variables

Mathematical Description of CT Sinusoidal Signals


n

Functions:

x a ( t ) = A cos( t + ), < t < + = A cos(2f t + ), < t < +


n

Plot:

Tp = 1/f

xa(t) Acos

Properties of CT Sinusoidal Signals

1. For every fixed value of the frequency f, xa(t) is periodic: xa(t+Tp) = xa(t) Tp = 1/f: fundamental period 2. CT sinusoidal signals with different frequencies are themselves different 3. Increasing the frequency f results in an increase in the rate of oscillation of the signal (more periods in a given time interval)

Properties of CT Sinusoidal Signals

For f = 0 Tp = For f = Tp = 0 Physical frequency: positive Mathematical frequency: positive and negative

A j ( t + ) A j ( t + ) xa (t ) = A cos(t + ) = e + e 2 2
The frequency range for CT signal: - < f < +

Mathematical Description of DT Sinusoidal Signals


n

Functions:

x (n ) = A cos( n + ), < n < + = A cos( 2Fn + ), < n < +


2 1.5 1 0.5

Plot:
Amplitude

0 -0.5 -1 -1.5 -2

10

15

20 Time index n

25

30

35

40

Properties of DT Sinusoidal Signals

1. A DT sinusoidal signal x(n) is periodic only if its frequency F is a rational number

x(n + N) = x(n) n
A cos[2F0 (n + N) + )] = A cos(2F0 n + ) n

2F0 N = 2k
k F0 = N

Properties of DT Sinusoidal Signals

2. DT sinusoidal signals whose frequencies are separated by an integer multiple of 2 are identical

x(n) = cos[(0 + 2)n + ] = cos(0 n + 2n + ) = cos(0 n + )


All

xk (n) = A cos( k n + ), k = 0, 1, 2, ... k = 0 + k 2 , 0 +

are identical

Properties of DT Sinusoidal Signals

3. The highest rate of oscillation in a DT sinusoidal signal is obtained when:

= (or = )
or, equivalently,

1 1 F= (or F = ) 2 2

Illustration for property 3


1 0.5

x(n) = cos( 2 F0 n)
F = 3/24 0

F = 1/8
1 0.5

F = 1/4 F= 3/12 0

-0.5

-0.5

-1

10

15

20

25

30

-1

10

15

20

25

30

F = 3/6 1

F0 = 1/2
1 0.5

F = 3/4 03/4 F=

0.5

-0.5

-0.5

-1

10

15

20

25

30

-1

10

15

20

25

30

- or -1/2 F 1/2: fundamental range

Sampling of CT Sinusoidal Signals

CT signal

Sampling

DT signal

xa(t)

xa(nT)

A cos( 2f nT + )

A cos( 2f t + )

f F= fs

2f n = A cos + f S
Normalized frequency

Relations among Frequency Variables

CT signals

DT signals

= 2f
< < + < f < +
/ T + / T f s / 2 f +f s / 2

= 2F

f F= fs
1 T= fs

+ 1 / 2 F +1 / 2

HW
Consider the analog signal

x(t ) = 3 cos100 t , t[ s]
a) Determine the minimum sampling rate required to avoid aliasing b) Suppose that the signal is sampled at the rate fs = 200 Hz. What is the DT signal obtained after sampling? c) Suppose that the signal is sampled at the rate fs = 75 Hz. What is the DT signal obtained after sampling? d) What is the frequency 0 < f < fs/2 of a sinusoidal signal that yields samples identical to those obtained in part (c)?

HW

Prob.7. Consider the analog signal

x a (t) = 3cos2000t+5sin6000t+10cos12000t
a) Determine the minimum sampling rate required to avoid aliasing b) Suppose that the signal is sampled at the rate fs = 5000 samples/ sec. What is the DT signal obtained after sampling? c) What is the analog signal we can reconstruct from the samples if we use ideal interpolation?

HW

Prob.8. Consider the analog signal

x(t ) = 3 sin 100 t , t[ s]


a) Sketch the signal for t from 0 to 30 ms b) The signal is sampled at the rate fs = 300 samples/s. Determine the frequency of the DT signal x(n) and show that it is periodic. c) Compute the sample values in one period of x(n). Sketch x(n) on the same diagram with x(t). What is the periodic of x(n) in ms? d) Can you find a sampling rate so that x(n) reaches its peak value?

You might also like