Upload
arron-small
View
230
Download
2
Tags:
Embed Size (px)
Citation preview
Chapter 11 Filter Design
11.1 Introduction11.2 Lowpass Filters A filter that can reduce the amplitude of
high-frequency components is named a lowpass filter. A lowpass filter can eliminate the effects of high-frequency noise.
Simple Lowpass Filters
The box filter Filters that make convolution
operation using a rectangular pulse with the signal; In the frequency domain, the effect of a box filter is multiplying the spectrum of signal with function .
Also called a moving-average filter. The outputs signal may cause black-for-white reversals of the polarity.
sin( ) /( )s s
Image reversals caused by the box filter
Simple Lowpass Filters
The Triangular Filter The triangular pulse is used as the im
pulse response of the lowpass filter, also called weighted-average filter.
In the frequency domain, the spectrum is multiplied with the function .
)(xΛ
2 2sin ( ) /( )s s
High Frequency Cutoff Filter Filtering by setting the high frequency po
rtion of the amplitude spectrum of a signal (image) to zero. This is equivalent to convolve with .
May cause ringing effects
The Gaussian Lowpass Filter
sin( ) /x x
Bandpass and Bandstop Filters
The ideal bandpass filter The transfer function of the ideal bandpa
ss filter is given by
A ideal bandpass filter allows the frequency components between f1 and f2 unchanged and makes the frequency components outside zero.
elsewhere 0
|| 1)( 21 fsf
sG
Bandpass filters Ideal bandpass transfer function
where and .
)]()([)()( 00 sssss
sΠsG
2/)( 210 ffs 12 ffs
1f 2f0s1f2f
)(sGs s
The ideal bandpass filter
The impulse response is
)2cos()sin(
2)( 0tsst
ststg
The ideal bandstop filter A bandstop filter is a filter that passes en
ergy at all frequencies except for a band between f1 and f2. Its transfer function is given by
or where and .
)]()([)(1)( 00 sssss
sΠsG
2/)( 210 ffs 12 ffs
elsewhere 0
|| 1)( 21 fsf
sG
The ideal bandstop filter The impulse response of the ideal bandst
op filter is
1f 2f0s1f2f
)(sGs s
)2cos()sin(
2)()( 0tsst
ststtg
The impulse response of the ideal bandstop filter
The general bandpass filter
The transfer function of a general bandpass filters is given by convolving a nonnegative unimodal function with an even impulse pair at frequency :
and the impulse response is thus
)(sK
0s
)]()([)()( 00 sssssKsG
)2cos()(2)( 0tstktg
The general bandpass filter
An example of the general bandpass filter is the Gaussian bandpass filter
The impulse response is
where
)]()([)( 002/ 22
ssssAesG s
)2cos(2
2)( 0
2/
2
22
tseA
tg t
)2/(1
The general bandpass filter
Gaussian bandpass filter
High frequency enhancement filters
Also called highpass filters. With transfer function that is unity at zero frequency and increases with increasing frequency.When the transfer function fall back to zero at higher frequency, the filter is catually a type of bandpass filter with unit gain at zero frequencyLaplacian filter Highpass filter with a transfer function that pass
through the origin
The difference-of-Gaussians filter Transfer function
212/2/ , ,)(
22
221
2
BABeAesG ss
The difference-of-Gaussians filter
The transfer function of difference-of-Gaussians filter
The difference-of-Gaussians filter
The impulse response is
where
22
221
2 2/
22
2/
21 22
)(
tt e
Be
Atg
1/(2 )i i
The difference-of-Gaussians filter
The impulse response function
The Gaussian highpass filter
In the difference-of-Gaussian filter, if , the transfer function becomes fla
tter and the central pulse in the impulse response becomes narrower, and ultimately, becomes a impulse at zero.
1
The Gaussian highpass filter
Transfer function
Impulse response
11.5 Optimal linear filter design
Random variables A random signal is a signal for which we have so
me general knowledge about it, but lack specific details.
We may think of a random variable as an ensemble of infinitely many member functions. When we make our recording, one of those member functions emerge to contaminate our record, but we have no way of knowing which one.
Ergodic random variables A random variable is ergodic if and only if (1) the ti
me averages of all member functions are equal, (2) the ensemble average is constant with time, and (3) the time average and the ensemble average are numerically equal.
The time average of a random variable is the average by integrating a particular member function over all time.
The ensemble average of a random variable is to average together the values of all member functions evaluated at some particular point in time
For a ergodic random variable, the expectation
We say that a random variable is ergodic means that it is a unknown function that has a known autocorrelation function and power spectrum.
dttxtx )()}({
)(tn
11.5.2 The Wiener Estimator (Filter)
The Wiener filter is a classic linear noise reduction filter. Suppose we have an observed signal , composed of a desired signal contaminated by an additive noise function . The filter is designed to reduce the contaminative noise as much as possible
)(tx
)(ts)(tn
The Wiener EstimatorModel for the Wiener estimator
Assumption in design Wiener filters Both and are ergodic random variables and
thus know their autocorrelation and power spectrum.
)(th)(ts
)(tn
)(ty)(tx
)(ts
)(tn
The Wiener Estimator
Optimality Criterion Define the error signal at the output of th
e filter as
The mean square error is given by )()()( tytste
dttete )()}({MSE 22
The Wiener Estimator
Given the power spectra of and , we wish to determine the impulse response that minimizes the mean square error.The mean square error can be expressed as function of the impulse response , and known autocorrelation and cross-correlation functions of the two input signal components.
)(ts )(tn)(th
)(th
The Wiener EstimatorThe mean square error can be written as
11.5.2.3 Minimizing MSE Denote by the particular impulse response f
unction that minimizes MSE. An arbitrary impulse response can be written as
duduRuhhdRhR
tytytsts
tytste
xxss
)()()()()(2)0(
)}({)}()({2)}({
})]()({[)}({MSE22
22
)(0 th
)(th
)()()( 0 tgthth
The Wiener EstimatorMinimizing MSE The MSE can be rewritten as
Where MSE0 is the mean square error under optimal
conditions and T5 is independent of and cannot be negative.
540
0
000
000
MSE
)()()(
)()()()(2
)()()()()(2)0(
)()]()()][()([)()]()([2)0(MSE
TT
duduRgug
duuRduRhug
duduRuhhdRhR
duduRuguhghdRghR
x
xsx
xxss
xxss
)(0 th
The Wiener EstimatorIt can prove that the necessary and sufficient condition to optimize the filter is T4=0, this means that
This is the condition that the impulse response of a Wiener estimator must satisfy.For any linear system, the cross-correlation between input and output is given by
duuRuhR xxs )()()( 0
)()()( uRuhR xxy
The Wiener Estimator
Thus
This means that the Wiener filter makes the input/output cross-correlation function equal to the signal/signal-plus-noise cross-correlation funtion.
Taking the Fourier transform of both sides
Which implies that
)()()()( 0 xyxxs RuRuhR
)()()()( 0 sPsPsHsP xyxxs
)(
)()(0 sP
sPsH
x
xy
Wiener filter design
Digitize a sample of the input signal and auto-correlate the input sample to produce an estimate of . Compute the Fourier transform of to produce .
Obtain and digitize a sample of the signal in the absence of noise and cross-correlate the signal sample with the input sample to estimate . Compute the Fourier transform of to produce .
( )x t
)(xR)(xR
)(sPx
)(xsR
)(xsR)(sPxs
Wiener filter design
Compute the transfer function of the optimal Wiener filter by .
Compute the impulse response of the optimal filter by computing the inverse Fourier transform of .
)(/)()(0 sPsPsH xxy
)(0 sH
)(0 th
Examples of the Wiener filter
11.5.3.1 Uncorrelated signal ad noise If the noise is uncorrelated with the signa
l, this means that
It can be derived that
If ignoring zero frequency,
)}({)}({)}()({ tntstnts
)()0()0(2)()(
)()0()0()()(0 sSNsPsP
sSNsPsH
ns
s
0 ,)()(
)()(0
s
sPsP
sPsH
ns
s
Examples of the Wiener filter
11.5.3.2 Filter performance Combining the MSE expression and the W
iener filter design condition, we have
With uncorrelated zero mean noise,
dRhR xss )()()0(MSE 00
) ( ) ( s xsR R
dssHsPdssPsP
sPsP
dssHsPdssP
dsPhR
nns
ns
ss
ss
)()()()(
)()(
)()()(
)}({)()0(MSE
0
0
00 1F
The Wiener filter transfer function
Wiener filter in the uncorrelated case
Ps(s) Pn(s)
H0(s)
MSE(s)
The Wiener filter transfer function
The signal and the noise are separable
Ps(s)Pn(s)
H0(s)
MSE(s)
The Wiener filter transfer function
A bandlimited signal is imbedded in white noise
Ps(s)
Pn(s)
H0(s)
MSE(s)
Wiener Deconvolution
Suppose the desired signal s(t) is first degraded by a linear system, the output of the filter is then corrupted by an additive noise to form the observed signalThe Wiener deconvolution filter is a concatenation of a deconvolution filter and a Wiener filter.
The transfer function G(s) of the optimal Wiener deconvolution filter can be derived as
( )w t
)(tn
)(ty)(tx( )F s 0 ( )H s
( )z t)(ty1/ ( )F s
( )G s
02
( ) ( ) ( ) ( )1( )
( ) ( ) ( ) ( ) | ( ) | ( ) ( )s s
s k s n
H s P s F s P sG s
F s F s P s P s F s P s P s
An example of Wiener deconvolution filter
Ps(s)
Pn(s)
F(s)
G(s)
s s
s
11.5.5 The Matched detector
The Wiener filter is designed to recover an unknown signal from noise, and the matched detector is designed to detect a known signal from noise.Model for the matched detector
)(tx )(tk )(ty
The matched detector
A equivalent model for the matched detector
)()()()()()()()]()([)( tvtutktntktmtktntmty
)(tk
)(tk
)(tm
)(tn
)(tu
)(tv)(ty
The matched detectorOptimality criterion Use the average signal-to-noise power ratio at t
he output evaluated at time zero as the optimality criterion
The matched filter is designed to maximize this criterion. If is large, the amplitude of the output
will be highly dependent on the presence or absence of .
)}0({
)}0({2
2
v
u
)(ty
)(tm
The matched detector
We can rewrite as
where is the noise power spectrum.
dssPsK
dssMsK
tktn
sKsM
tktn
tktm
tv
u
n )(|)(|
)()(
})]()({[
)}]()({[
})]()({[
)]()([
)}({
)0(
2
2
2
2
2
2
2
2
1F
)(sPn
The matched detector
We wish to maximize by properly choosing . Applying the well-known Schwartz Inequality
We have
)(sK
dttgdttfdttgtf )()()()( 22
2
dssPsK
dssPsM
dssPsK
dssPsK
dssMsK
n
nn
n )(|)(|
)(|)(|
)(|)(|
)(|)(|
)()(
2
22
2
2
The matched detector
And thus
The maximum of is
On the other hand, when assume a particular transfer function
ds
sP
sM
n )(
|)(| 2
ds
sP
sM
n )(
|)(| 2
max
)(
)()(0 sP
sMCsK
n
The matched detector
The optimality criterion achieves its maximum
max
2
2
2
0
)(
|)(|
)(|)(|
)()(
ds
sP
sM
dssPsK
dssMsK
nn
Examples of the matched detector
White noise Noise with flat power spectrum is called
white noise. If the noise is white, its power spectru
m is , the transfer function of the matched detector can be chosen as
)(tn20)( NsPn
)()(0 sMsK
Examples of the matched detector
The impulse response is
The output of the matched detector is
This means that the matched filter is merely a cross-correlator, cross-correlating the incoming signal plus noise with the known form of the desired signal.
)()(
)()}({)(
))((2
200
tmdsesM
dsesMsKtk
tsj
stj
1F
)()()()()()()()()( 00 tRtRtktntktmtvtuty mnm
Examples of the matched detector
If the correlation between the signal and noise is small, then is small for all values of , and the noise component at the output is small. Furthermore, the autocorrelation function has a peak at . So,
is large at , or wherever the signal occurs, as desired.
)(mnR
)(mR0
)}({
)(2
2
tv
tu
0t
Examples of the matched detector
The rectangular pulse detector The matched filter is designed to detect a
rectangular pulse in white noise. Suppose that the input signal is , where . The output of the filter is
where recall that
)()( tΠtm
)()()( tntstx
)()( TtΠts
)()()()()()( tRtΛtRtRtRty mnmnsmxm
)()()()( ΛtΠtΠRx
Examples of the matched detector
The input and the output
Comparison of the Wiener estimator and the matched detector
The transfer function of the Wiener estimator for uncorrelated signal and noise is
And the mean square error is
0 ,)()(
)()(0
s
sPsP
sPsH
ns
s
dssHsPds
sPsP
sPsPn
ns
ns )()()()(
)()(MSE 00
ComparisonThe matched filter transfer function is
And the signal-to-noise power ratio is
is real and even (and hence contains no phase information), is Hermite and contain phase information. is bounded between 0 and 1, while
has no bound.
)(
)()(0 sP
sSsK
n
ds
sP
sP
n
s
)(
)(max
)(0 sH)(0 sK
)(0 sH)(0 sK
Comparison
Let us define the signal-to-noise power ratio as
Then )(
)(
|)(|
|)(|)(
2
2
sP
sP
sN
sSsR
n
s
|)(|
)(
|)(|
)()(0 sN
sR
sS
sRsK
dssR )(max
)(1
)()(0 sR
sRsH
ds
sRa
sPsR n
)(
)()(MSE0
Practical consideration
Estimation is a more difficult task than detection because first estimation is to recover the signal at all points in time while detection only to determine when the signal occurs; second, we have more a priori information in a detection problem in that we know the form of the signal exactly, instead of having only its power spectrum. Thus detector may perform better under the same conditions.
11.6 Order-statistic filters
Order-statistic filter is a class of nonlinear filters that are based on statistics derived from ordering (ranking) the elements of a set rather than computer means. The Median Filter The pixels in the neighborhood of a particular pi
xel are ranked in the order of their gray level values, and the midvalue of the group is chosen as the gray level value of the output pixel.
Order-statistic filter
The median filter has an ability to reduce random noise without blurring edges as much as a comparable linear lowpass filterThe noise-reducing ability of a median filter depends on two factors: 1. The size of neighborhood (mask); 2. The number of pixels involved in the median computation.
The median filter
Sparsely populated mask may be used in median computation.
Other order-statistic filters
A comparison of the median filter and the mean filter
11.7 Summary of important points
A high-frequency enhancement filter impulse response can be designed as a narrow positive pulse minus a broad negative pulse.
The transfer function of a high frequency enhancement filter approaches a maximum value that is equal to the area under the narrow positive pulse.
The transfer function of a high frequency enhancement filter has a zero frequency response equal to the difference of the area under the two component pulses.
11.7 Summary and important points
The zero frequency response of a filter determines how the contrast of large feature is affected.
Filters designed for ease of computation rather than for optimal performance are likely to introduce artifacts into image.
An ergodic random process is a signal whose known power spectrum and autocorrelation function represent all the available knowledge about the signal.
The Wiener estimator is optimal, in the mean square error sense, for recovering a signal of known power spectrum from additive noise of known power spectrum.
11.7 Summary of important points
The Wiener filter transfer function takes on values near unity in frequency bands of high signal-to-noise ratio and near zero in bands dominated by noise.
The matched detector is optimal for detecting the occurrence of a known signal in a background of additive noise.
In the case of white noise, the matched filter correlates the input with the known form of the signal.
11.7 Summary of important points
The wiener transfer function is real, even, and bounded by zero and unity.
The matched filter transfer function is, in general, complex, Hermite, and unbounded.
Order-statistic filters are nonlinear and work by ranking the pixels in a neighborhood.
A median filter essentially eliminates objects less than half its size, while preserving larger objects. It is useful for noise reduction where edges must be preserved.
A sparsely populated mask can reduce computation time on spatial large median filters.