LTI System: Digital Signal Processing

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 40

Digital Signal Processing

Lecture
LTI System

Dr. Irum Nosheen


LTI System
Discrete 3 × 3 Box Filter

in out

×1/9 × 1/9 × 1/9

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

× 1/9 × 1/9 × 1/9


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

1/9 1/9 1/9


8 9 9 11 11 11
8 3 9 3 9 11 1/9 1/9 1/9
2 8 3 5 5 9 1/9 1/9 1/9
8 6 8 6 8 11
2 2 4 4 6 9
6 9 11 4 4 6
(3 + 5 + 5 + 8 + 6 + 8 + 4 + 4 + 6) / 9 = 5.44
or
Round(3 + 5 + 5 + 8 + 6 + 8 + 4 + 4 + 6) / 9 = 5
5 × 5 Box Filter

in out

Boundaries blurred,
detail lost
Gaussian Filter

2 2
1D: g(x)= 1/(2) × e -x /2

2 2 2
2D: g(x,y)= 1/(2) × e - (x +y ) /2

4

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
scanline
out[x,y] = in[x+1,y] - in[x,y]

g[x,y] =  0 0 0
 0 -1 1 
df(x)  0 0 0
dx
(must remap result to range 0-1)
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 0  1 2
2  1
 0  2     1 0  1
1
1 0  1 
Sobel Edge Detector

threshold 64
9
6
128
Convolutions- Smoothing
Convolutions- Edge Detection
CNN
Convolution Neural Network

Example Architecture: ConvNet for CIFAR-10 classification could have the


architecture [INPUT - CONV - RELU - POOL - FC].
INPUT [32x32x3] will hold the raw pixel values of the image, R,G,B.
•CONV layer compute the output of neurons that are connected to local
regions in the input, result in volume such as [32x32x12] if we decided to
use 12 filters.
•RELU layer will apply an elementwise activation function, such as
the max(0,x) thresholding at zero. This leaves the size of the volume
unchanged ([32x32x12]).
•POOL layer will perform a down-sampling operation along the spatial
dimensions (width, height), resulting in volume such as [16x16x12].
•FC (i.e. fully-connected) layer will compute the class scores, resulting in
volume of size [1x1x10], where each of the 10 numbers correspond to a
class score, such as among the 10 categories of CIFAR-10.
CNN
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.

 For a fixed n, Form x[k]h[n-k] for -∞<k<+∞


 Sum over all k to produce y[n]

Convolution in the time domain:


y[n]   x[k ] h[n  k ]
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

You might also like