Sie sind auf Seite 1von 63

Digital Signal Processing

Dr. Shoab Khan

Time Domain Analysis

Linear Time-Invariant Systems

Linear

linearity

Linear Time-Invariant System Linear Time-Invariant Systems

Linear Time-Invariant System

Input: sum of weighted shifted impulses

Using Linearity and Time-Invariance for the impulses

Sum of wt. Shifted impulses sum of wt. Shifted impulse responses

LTI System

Convolution in the time domain:

y[n] =

k =

x[k ] h[n k ]

y[n] = 2 3 3 3 6 0 1 0 0

Example-Convolution of Two Rectangles

convex1

Example..(Continued)

Example-Convolution Of Two Sequences

DTC-FLIP & SLIDE method(Finite Length Signals)

Convolution

Convolution

Two ways
As the representation of the output as a sum of delayed and scaled impulse responses. As a computational formula for computing y[n] (y at time n) from the entire sequences x and h.
Form x[k]h[n-k] for -<k<+ for a fixed n Sum over all k to produce y[n]

Stability

Causality

Causality & Stability- Example

2D Discrete Convolution

Convolution in the time domain:

y[n] =

k =

x[k ] h[n k ]

y[n] = 2 3 3 3 6 0 1 0 0

Discrete 3 3 Box Filter

in 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 1/9 out[x,y]

out

Moving Window Concept

Projection of 3x3 Kernel The Moving Window (kernel) scans the 3x3 neighborhood of every pixel in the classified image.

Classified Image

Moving Window Concept

A value is computed, depending on the type of kernel, from the 9 values in the input file and placed in the corresponding cell of the output file.
Output File

Moving Window Concept

Output File

Moving Window Concept

Output File

Moving Window Concept

Output File

Moving Window Concept

Output File

Moving Window Concept

Output File

Moving Window Concept

Output File

Moving Window Concept

Output File

Moving Window Concept

Output File

Example: Mean Kernel Calculation


8 8 2 8 2 6 9 3 8 6 2 9 9 11 11 11 9 3 9 11 3 5 5 9 8 6 8 11 4 4 6 9 11 4 4 6
or

1/9 1/9 1/9

1/9 1/9 1/9

1/9 1/9 1/9

(3 + 5 + 5 + 8 + 6 + 8 + 4 + 4 + 6) / 9 = 5.44 Round(3 + 5 + 5 + 8 + 6 + 8 + 4 + 4 + 6) / 9 =

5 5 Box Filter

in

out

Boundaries blurred, detail lost

Gaussian Filter
1D: g(x)= 1/(2) 2D: g(x,y)= 1/(2)
4
2/22 -x e

2+y2) /22 (x e

Discrete 5x5 gaussian: (=1.4)

Gaussian Filter

in

5x5 box filter

5x5 gaussian (edges sharper)

Edge Detection
edge f(x) df(x) f(x+h) - f(x) dx h out[x,y] = in[x+1,y] - in[x,y] g[x,y] = 0 0 0 0 -1 1 0 0 0 (must remap result to range 0-1)

scanline

df(x) dx

Derivative
sharp edges brighter scanline in: values 0-10 10 11 10 9 10 -1 5 1 darker 6 5 brighter 10 11

g[x]= scanline out: 5 5 4 4

= {in[x] - in[x-1]}/2 + 5 5 4 7 5

5 2

dark pixel

bright pixel

Better Edge Detection


Use neighboring scanlines
avoid single-pixel edges g[x,y] = -1 0 1 -1 0 1 (vertical edges) -1 0 1 g[x,y] = 1 1 1 0 0 0 (horizontal edges) -1 -1 -1

Sobel Edge Detection


Neighboring scanlines have less weight
g[x,y] = -1 0 1 -2 0 2 (vertical edges) -1 0 1 g[x,y] = 1 2 1 0 0 0 (horizontal edges) -1 -2 -1

endpoints of edges less blurred

Horizontal Derivative

in

simple df dx

Sobel df dx

Oriented Edges

in

|P| , Sobel (all edges)

simple df dx (vertical edges only)

Gradient + Blur

in

|P| , Sobel features lost

gaussian blur, then |P| Sobel less noise

Edge Enhancement
AKA Sharpening
Find edges, amplify them, add them back

out[x,y] = out[x,y] - edge[x,y]


g[x,y] = 0 - 0 - 1+4 - | (laplacian) 0 - 0

Edge Enhancement

in

out

Gaussian low-pass filter

low-pass filter

Differentiation

1 2 1

0 0 0

1 2 1 2 = [1 0 1 1

1]

Sobel Edge Detector


64

threshold

96 128

Convolutions- Smoothing

Convolutions- Edge Detection

Difference Equation
For all computationally realizable LTI systems, the input and output satisfy a difference equation of the form

This leads to the recurrence formula

which can be used to compute the present output from the present and M past values of the input and N past values of the output

Linear Constant-Coefficient Difference(LCCD) Equations

Linear Constant-Coefficient Difference (LCCD) Equations( Continued)

Linear Constant-Coefficient Difference (LCCD) Equations.( Continued)

First-Order Example
Consider the difference equation We can represent this system by the following block diagram:
y[n] =ay[n1] +x[n]

Recursive Computation of Output

Exponential Impulse Response


With initial rest conditions, the difference Equation has impulse response
y[n] =ay[n1] +x[n] h[n] =anu[n]

Linear Constant-Coefficient Difference (LCCD) Equations.( Continued)

Das könnte Ihnen auch gefallen