Digital Filters. What have we seen so far?  So far we have seen… Box filterBox filter  Moving average filter  Example of a lowpass passes low frequenciespasses.

Slides:



Advertisements
Similar presentations
ECE 8443 – Pattern Recognition EE 3512 – Signals: Continuous and Discrete Objectives: Response to a Sinusoidal Input Frequency Analysis of an RC Circuit.
Advertisements

HILBERT TRANSFORM Fourier, Laplace, and z-transforms change from the time-domain representation of a signal to the frequency-domain representation of the.
4.3 Connecting f’ and f’’ with the Graph of f
Spatial Filtering (Chapter 3)
EE313 Linear Systems and Signals Fall 2010 Initial conversion of content to PowerPoint by Dr. Wade C. Schwartzkopf Prof. Brian L. Evans Dept. of Electrical.
Nonrecursive Digital Filters
Concavity & the second derivative test (3.4) December 4th, 2012.
Objectives: 1.Be able to determine where a function is concave upward or concave downward with the use of calculus. 2.Be able to apply the second derivative.
Miss Battaglia AP Calculus AB/BC.  Let f be differentiable on an open interval I. The graph of f is concave upward on I if f’ is increasing on the interval.
Digital Filters. A/DComputerD/A x(t)x[n]y[n]y(t) Example:
Leo Lam © Signals and Systems EE235. Transformers Leo Lam ©
Filtering Filtering is one of the most widely used complex signal processing operations The system implementing this operation is called a filter A filter.
Review of Frequency Domain
Reminder Fourier Basis: t  [0,1] nZnZ Fourier Series: Fourier Coefficient:
Chapter 4 Image Enhancement in the Frequency Domain.
General Functions A non-periodic function can be represented as a sum of sin’s and cos’s of (possibly) all frequencies: F(  ) is the spectrum of the function.
Digital Image Processing Chapter 4: Image Enhancement in the Frequency Domain.
1 Image Filtering Readings: Ch 5: 5.4, 5.5, 5.6,5.7.3, 5.8 (This lecture does not follow the book.) Images by Pawan SinhaPawan Sinha formal terminology.
CSCE 641 Computer Graphics: Fourier Transform Jinxiang Chai.
1 Image filtering
CPSC 641 Computer Graphics: Fourier Transform Jinxiang Chai.
Computational Photography: Fourier Transform Jinxiang Chai.
Chapter 4 Image Enhancement in the Frequency Domain.
Transforms: Basis to Basis Normal Basis Hadamard Basis Basis functions Method to find coefficients (“Transform”) Inverse Transform.
1 Chapter 4 Applications of Derivatives Extreme Values of Functions.
Discrete-Time Convolution Linear Systems and Signals Lecture 8 Spring 2008.
EE313 Linear Systems and Signals Fall 2010 Initial conversion of content to PowerPoint by Dr. Wade C. Schwartzkopf Prof. Brian L. Evans Dept. of Electrical.
Lecture 29 Review: Frequency response Frequency response examples Frequency response plots & signal spectra Filters Related educational materials: –Chapter.
02/12/02 (c) 2002 University of Wisconsin, CS 559 Filters A filter is something that attenuates or enhances particular frequencies Easiest to visualize.
Leo Lam © Signals and Systems EE235. Leo Lam © Fourier Transform Q: What did the Fourier transform of the arbitrary signal say to.
Finite Impuse Response Filters. Filters A filter is a system that processes a signal in some desired fashion. –A continuous-time signal or continuous.
Discrete-Time Fourier Series
EE513 Audio Signals and Systems Digital Signal Processing (Systems) Kevin D. Donohue Electrical and Computer Engineering University of Kentucky.
Chapter 5 Frequency Domain Analysis of Systems. Consider the following CT LTI system: absolutely integrable,Assumption: the impulse response h(t) is absolutely.
Presentation Image Filters
Digital Filters. What have we seen so far?  So far we have seen… Box filterBox filter  Moving average filter  Example of a lowpass passes low frequenciespasses.
The mileage of a certain car can be approximated by: At what speed should you drive the car to obtain the best gas mileage? Of course, this problem isn’t.
The Shape of the Graph 3.3. Definition: Increasing Functions, Decreasing Functions Let f be a function defined on an interval I. Then, 1.f increases on.
Chapter 5 Frequency Domain Analysis of Systems. Consider the following CT LTI system: absolutely integrable,Assumption: the impulse response h(t) is absolutely.
Filtering. What Is Filtering? n Filtering is spectral shaping. n A filter changes the spectrum of a signal by emphasizing or de-emphasizing certain frequency.
Copyright © 2011 by Denny Lin1 Computer Music Synthesis Chapter 6 Based on “Excerpt from Designing Sound” by Andy Farnell Slides by Denny Lin.
Filtering and Enhancing Images. Major operations 1. Matching an image neighborhood with a pattern or mask 2. Convolution (FIR filtering)
09/19/2002 (C) University of Wisconsin 2002, CS 559 Last Time Color Quantization Dithering.
Fourier Analysis of Discrete-Time Systems
In the past, one of the important uses of derivatives was as an aid in curve sketching. We usually use a calculator of computer to draw complicated graphs,
1 Conditions for Distortionless Transmission Transmission is said to be distortion less if the input and output have identical wave shapes within a multiplicative.
5.3:Higher Order Derivatives, Concavity and the 2 nd Derivative Test Objectives: To find Higher Order Derivatives To use the second derivative to test.
1 Prof. Nizamettin AYDIN Digital Signal Processing.
Linear Constant-Coefficient Difference Equations
What is filter ? A filter is a circuit that passes certain frequencies and rejects all others. The passband is the range of frequencies allowed through.
Finite Impulse Response Filtering EMU-E&E Engineering Erhan A. Ince Dec 2015.
If f(x) is a continuous function on a closed interval x ∈ [a,b], then f(x) will have both an Absolute Maximum value and an Absolute Minimum value in the.
Spatial Filtering (Chapter 3) CS474/674 - Prof. Bebis.
Image Pre-Processing in the Spatial and Frequent Domain
Digital Signal Processing Lecture 4 DTFT
3.3 Increasing and Decreasing Functions and the First Derivative Test
Recap: Chapters 1-7: Signals and Systems
Review Problems Sections 3-1 to 3-4
Concavity.
CS-565 Computer Vision Nazar Khan Lecture 4.
EE Audio Signals and Systems
Outline Linear Shift-invariant system Linear filters
The mileage of a certain car can be approximated by:
CSCE 643 Computer Vision: Thinking in Frequency
Second Derivative Test
Concave Upward, Concave Downward
Digital Image Processing Week IV
Image Filtering Readings: Ch 5: 5. 4, 5. 5, 5. 6, , 5
Lecture 4 Image Enhancement in Frequency Domain
Concavity & the second derivative test (3.4)
Presentation transcript:

Digital Filters

What have we seen so far?  So far we have seen… Box filterBox filter  Moving average filter  Example of a lowpass passes low frequenciespasses low frequencies  small, gradual changes in the signal are passed  higher frequencies are attenuated (reduced/removed/suppressed)

Applied by cross correlation (sum of products) of image f and mask h If mask is centered about origin, (x,y) in image: If origin, (x,y), in image is aligned with (0,0) in mask:

But how do we know what the application of an arbitrary mask actually does to the image?

For simplicity, let us just consider 1D signals (e.g., mono audio)

Our moving average (box) filter Example of a lowpass filter (passes low frequencies, attenuates high frequencies) y[n] = 1/3 x[n-1] + 1/3 x[n] + 1/3 x[n+1] More generally y[n] = h[-1] x[n-1] + h[0] x[n] + h[1] x[n+1]

But what exactly do we mean by “frequency?”

amplitude (loudness)

phase (time/space shift)

frequency (speed)

Lowpass filters Input: (before) x(t) = 0.5*sin(t) + sin(3*t+pi/3) + sin(5*t+pi/8) x(t) = 0.5*sin(t) + sin(3*t+pi/3) + sin(5*t+pi/8) Output: (after) y(t) = 0.5*sin(t) + sin(3*t+pi/3) y(t) = 0.5*sin(t) + sin(3*t+pi/3)

So how can we determine how our moving average filter behaves?  11 point and 51 point moving average filters (on the previous slide) obviously produce different outputs even when given the same input!  Answer: By determining how a particular filter responds to an impulse (their impulse response function).

So given …,h[-1],h[0],h[1],… how can we plot the impulse reponse. 1. Perform the z-transform (the discrete version of the Laplace transform) of h resulting H. 2. Plot H on the unit circle. The magnitude of H (abs(H) or |H|) is amplitude and the angle of H (arg(H)) is the phase.  Say we have a 3 point box filter: h[- 1]=h[0]=h[1]=1/3.

So given …,h[-1],h[0],h[1],… how can we plot the impulse response.  Say we have an 11 point box filter: h[-5]=h[-4]=h[-3] =h[-3] =h[-2] =h[-1] =h[0] =h[1] =h[2] =h[3] =h[4] =h[5]=1/11.

Frequency response of 3 and 11 point box filters

Frequency response in dB of 3 and 11 point box filters

Frequency response (dB) and phase of 3 and 11 point box filters.

3 point box filter vs. 3 point gaussian

Frequency response (dB) and phase of 3 point gaussian

How can we make these other filters?

Spectral inversion: How to make a highpass filter the easy way. 1. Change the sign of each sample in the filter kernel. 2. Add 1 to the sample at the center of symmetry. highpass  lowpass highpass  lowpass lowpass  highpass lowpass  highpass bandpass  bandreject (stopband) bandpass  bandreject (stopband) bandreject  bandpass bandreject  bandpass

Lowpass to highpass

Lowpass followed by highpass = bandpass

Bandreject (stopband) = lowpass + highpass (lowpass or highpass)

Application of filters Edge detection

Recall the first derivative test from calculus: Let the function f be continuous on some interval (c-,c+) containing the critical point c. 1.If f’(x)>0 for x in (c-,c) and f’(x) 0 for x in (c-,c) and f’(x)<0 for x in (c,c+), then f has a local maximum at c. 2.If f’(x) 0 for x in (c,c+), then f has a local minimum at c.

Can we calculate the first derivative of an image? Let h 1 =[-1, 1]. Then f’(x) = g(x) = f(x)h 1 (x) where  is cross correlation. So we can then search f’(x) for extrema where: 0 occurs0 occurs -a,+b occurs-a,+b occurs +a,-b occurs+a,-b occurs

Recall the following from calculus regarding the second derivative: Let f be continuous on [a,b] and at least twice differentiable on (a,b). If f’’(x)>0 on (a,b), then f is concave up on [a,b], while if f’’(x) 0 on (a,b), then f is concave up on [a,b], while if f’’(x)<0 on (a,b), then f is concave down on [a,b].

Recall the second derivative test from calculus: Let the function f be defined on an open interval containing the critical point c where f’(c)=0, and let f’’ be continuous on this interval. 1.If f’’(c)<0, then c is a local maximum point. 2.If f’’(c)>0, then c is a local minimum point. 3.If f’’(c)=0, then no conclusion is possible without further investigation.

Also recall: A point c is called an inflection point of f if: 1.f is continuous at c; 2.the graph of f has a tangent line (possibly vertical) at [c,f(c)]; 3.f is concave up on one side of c and concave down on the other side.

We can consider the inflection point to be the location of an edge!

Can we calculate the second derivative of an image? Let h 1 =[-1, 1]. Then f’(x) = f(x)h 1 (x) Then f’’(x) = f’(x)h 1 (x)  where  is cross correlation. So we can then search f’’(x) for edges where: 0 occurs0 occurs -a,+b occurs-a,+b occurs +a,-b occurs+a,-b occurs

Can we calculate the second derivative of an image? A better way … let h 2 =[1, -2, 1]. Then f’’(x) = f(x)h 2 (x) Much more computationally efficient. Where does h 2 come from? From [-1, 1]  [1, -1] which is h 1 * h 1 where * is convolution.

Applying masks to images Convolution: Discrete form:

Frequency response (dB) and phase of first derivative filter.

Frequency response (dB) of first and second derivative filters.