In signal processing, the output of the matched filter is given by correlating a known delayed signal, or template, with an unknown signal to detect the presence of the template in the unknown signal. This is equivalent to convolving the unknown signal with a conjugated time-reversed version of the template. The matched filter is the optimal linear filter for maximizing the signal-to-noise ratio (SNR) in the presence of additive stochastic noise. Matched filters are commonly used in radar, in which a known signal is sent out, and the reflected signal is examined for common elements of the out-going signal. Pulse compression is an example of matched filtering. It is so called because the impulse response is matched to input pulse signals. Two-dimensional matched filters are commonly used in image processing, e.g., to improve the SNR of X-ray observations. Additional applications of note are in seismology and gravitational-wave astronomy. Matched filtering is a demodulation technique with LTI (linear time invariant) filters to maximize SNR. It was originally also known as a North filter.
Derivation
Derivation via matrix algebra The following section derives the matched filter for a discrete-time system. The derivation for a continuous-time system is similar, with summations replaced with integrals. The matched filter is the linear filter, h {\displaystyle h} , that maximizes the output signal-to-noise ratio.
y [ n ] = ∑ k = − ∞ ∞ h [ n − k ] x [ k ] , {\displaystyle \ y[n]=\sum _{k=-\infty }^{\infty }h[n-k]x[k],}
where x [ k ] {\displaystyle x[k]} is the input as a function of the independent variable k {\displaystyle k} , and y [ n ] {\displaystyle y[n]} is the filtered output. Though we most often express filters as the impulse response of convolution systems, as above (see LTI system theory), it is easiest to think of the matched filter in the context of the inner product, which we will see shortly. We can derive the linear filter that maximizes output signal-to-noise ratio by invoking a geometric argument. The intuition behind the matched filter relies on correlating the received signal (a vector) with a filter (another vector) that is parallel with the signal, maximizing the inner product. This enhances the signal. When we consider the additive stochastic noise, we have the additional challenge of minimizing the output due to noise by choosing a filter that is orthogonal to the noise. Let us formally define the problem. We seek a filter, h {\displaystyle h} , such that we maximize the output signal-to-noise ratio, where the output is the inner product of the filter and the observed signal x {\displaystyle x} . Our observed signal consists of the desirable signal s {\displaystyle s} and additive noise v {\displaystyle v} :
x = s + v . {\displaystyle \ x=s+v.\,}
Let us define the auto-correlation matrix of the noise, reminding ourselves that this matrix has Hermitian symmetry, a property that will become useful in the derivation:
R v = E { v v H } {\displaystyle \ R_{v}=E\{vv^{\mathrm {H} }\}\,}
where v H {\displaystyle v^{\mathrm {H} }} denotes the conjugate transpose of v {\displaystyle v} , and E {\displaystyle E} denotes expectation (note that in case the noise v {\displaystyle v} has zero-mean, its auto-correlation matrix R v {\displaystyle R_{v}} is equal to its covariance matrix). Let us call our output, y {\displaystyle y} , the inner product of our filter and the observed signal such that
y = ∑ k = − ∞ ∞ h ∗ [ k ] x [ k ] = h H x = h H s + h H v = y s + y v . {\displaystyle \ y=\sum _{k=-\infty }^{\infty }h^{*}[k]x[k]=h^{\mathrm {H} }x=h^{\mathrm {H} }s+h^{\mathrm {H} }v=y_{s}+y_{v}.}
We now define the signal-to-noise ratio, which is our objective function, to be the ratio of the power of the output due to the desired signal to the power of the output due to the noise:
S N R = | y s | 2 E { | y v | 2 } . {\displaystyle \mathrm {SNR} ={\frac {|y_{s}|^{2}}{E\{|y_{v}|^{2}\}}}.}
We rewrite the above:
S N R = | h H s | 2 E { | h H v | 2 } . {\displaystyle \mathrm {SNR} ={\frac {|h^{\mathrm {H} }s|^{2}}{E\{|h^{\mathrm {H} }v|^{2}\}}}.}
We wish to maximize this quantity by choosing h {\displaystyle h} . Expanding the denominator of our objective function, we have
E { | h H v | 2 } = E { ( h H v ) ( h H v ) H } = h H E { v v H } h = h H R v h . {\displaystyle \ E\{|h^{\mathrm {H} }v|^{2}\}=E\{(h^{\mathrm {H} }v){(h^{\mathrm {H} }v)}^{\mathrm {H} }\}=h^{\mathrm {H} }E\{vv^{\mathrm {H} }\}h=h^{\mathrm {H} }R_{v}h.\,}
Now, our S N R {\displaystyle \mathrm {SNR} } becomes
S N R = | h H s | 2 h H R v h . {\displaystyle \mathrm {SNR} ={\frac {|h^{\mathrm {H} }s|^{2}}{h^{\mathrm {H} }R_{v}h}}.}
We will rewrite this expression with some matrix manipulation. The reason for this seemingly counterproductive measure will become evident shortly. Exploiting the Hermitian symmetry of the auto-correlation matrix R v {\displaystyle R_{v}} , we can write
S N R = | ( R v 1 / 2 h ) H ( R v − 1 / 2 s ) | 2 ( R v 1 / 2 h ) H ( R v 1 / 2 h ) , {\displaystyle \mathrm {SNR} ={\frac {|{(R_{v}^{1/2}h)}^{\mathrm {H} }(R_{v}^{-1/2}s)|^{2}}{{(R_{v}^{1/2}h)}^{\mathrm {H} }(R_{v}^{1/2}h)}},}
We would like to find an upper bound on this expression. To do so, we first recognize a form of the Cauchy–Schwarz inequality:
| a H b | 2 ≤ ( a H a ) ( b H b ) , {\displaystyle \ |a^{\mathrm {H} }b|^{2}\leq (a^{\mathrm {H} }a)(b^{\mathrm {H} }b),\,}
which is to say that the square of the inner product of two vectors can only be as large as the product of the individual inner products of the vectors. This concept returns to the intuition behind the matched filter: this upper bound is achieved when the two vectors a {\displaystyle a} and b {\displaystyle b} are parallel. We resume our derivation by expressing the upper bound on our S N R {\displaystyle \mathrm {SNR} } in light of the geometric inequality above:
S N R = | ( R v 1 / 2 h ) H ( R v − 1 / 2 s ) | 2 ( R v 1 / 2 h ) H ( R v 1 / 2 h ) ≤ [ ( R v 1 / 2 h ) H ( R v 1 / 2 h ) ] [ ( R v − 1 / 2 s ) H ( R v − 1 / 2 s ) ] ( R v 1 / 2 h ) H ( R v 1 / 2 h ) . {\displaystyle \mathrm {SNR} ={\frac {|{(R_{v}^{1/2}h)}^{\mathrm {H} }(R_{v}^{-1/2}s)|^{2}}{{(R_{v}^{1/2}h)}^{\mathrm {H} }(R_{v}^{1/2}h)}}\leq {\frac {\left[{(R_{v}^{1/2}h)}^{\mathrm {H} }(R_{v}^{1/2}h)\right]\left[{(R_{v}^{-1/2}s)}^{\mathrm {H} }(R_{v}^{-1/2}s)\right]}{{(R_{v}^{1/2}h)}^{\mathrm {H} }(R_{v}^{1/2}h)}}.}
Our valiant matrix manipulation has now paid off. We see that the expression for our upper bound can be greatly simplified:
S N R = | ( R v 1 / 2 h ) H ( R v − 1 / 2 s ) | 2 ( R v 1 / 2 h ) H ( R v 1 / 2 h ) ≤ s H R v − 1 s . {\displaystyle \mathrm {SNR} ={\frac {|{(R_{v}^{1/2}h)}^{\mathrm {H} }(R_{v}^{-1/2}s)|^{2}}{{(R_{v}^{1/2}h)}^{\mathrm {H} }(R_{v}^{1/2}h)}}\leq s^{\mathrm {H} }R_{v}^{-1}s.}
We can achieve this upper bound if we choose,
R v 1 / 2 h = α R v − 1 / 2 s {\displaystyle \ R_{v}^{1/2}h=\alpha R_{v}^{-1/2}s}
where α {\displaystyle \alpha } is an arbitrary real number. To verify this, we plug into our expression for the output S N R {\displaystyle \mathrm {SNR} } :
S N R = | ( R v 1 / 2 h ) H ( R v − 1 / 2 s ) | 2 ( R v 1 / 2 h ) H ( R v 1 / 2 h ) = α 2 | ( R v − 1 / 2 s ) H ( R v − 1 / 2 s ) | 2 α 2 ( R v − 1 / 2 s ) H ( R v − 1 / 2 s ) = | s H R v − 1 s | 2 s H R v − 1 s = s H R v − 1 s . {\displaystyle \mathrm {SNR} ={\frac {|{(R_{v}^{1/2}h)}^{\mathrm {H} }(R_{v}^{-1/2}s)|^{2}}{{(R_{v}^{1/2}h)}^{\mathrm {H} }(R_{v}^{1/2}h)}}={\frac {\alpha ^{2}|{(R_{v}^{-1/2}s)}^{\mathrm {H} }(R_{v}^{-1/2}s)|^{2}}{\alpha ^{2}{(R_{v}^{-1/2}s)}^{\mathrm {H} }(R_{v}^{-1/2}s)}}={\frac {|s^{\mathrm {H} }R_{v}^{-1}s|^{2}}{s^{\mathrm {H} }R_{v}^{-1}s}}=s^{\mathrm {H} }R_{v}^{-1}s.}
Thus, our optimal matched filter is
h = α R v − 1 s . {\displaystyle \ h=\alpha R_{v}^{-1}s.}
We often choose to normalize the expected value of the power of the filter output due to the noise to unity. That is, we constrain
E { | y v | 2 } = 1. {\displaystyle \ E\{|y_{v}|^{2}\}=1.\,}
This constraint implies a value of α {\displaystyle \alpha } , for which we can solve:
E { | y v | 2 } = α 2 s H R v − 1 s = 1 , {\displaystyle \ E\{|y_{v}|^{2}\}=\alpha ^{2}s^{\mathrm {H} }R_{v}^{-1}s=1,}
yielding
α = 1 s H R v − 1 s , {\displaystyle \ \alpha ={\frac {1}{\sqrt {s^{\mathrm {H} }R_{v}^{-1}s}}},}
giving us our normalized filter,
h = 1 s H R v − 1 s R v − 1 s . {\displaystyle \ h={\frac {1}{\sqrt {s^{\mathrm {H} }R_{v}^{-1}s}}}R_{v}^{-1}s.}
If we care to write the impulse response h {\displaystyle h} of the filter for the convolution system, it is simply the complex conjugate time reversal of the input s {\displaystyle s} . Though we have derived the matched filter in discrete time, we can extend the concept to continuous-time systems if we replace R v {\displaystyle R_{v}} with the continuous-time autocorrelation function of the noise, assuming a continuous signal s ( t ) {\displaystyle s(t)} , continuous noise v ( t ) {\displaystyle v(t)} , and a continuous filter h ( t ) {\displaystyle h(t)} .
Derivation via Lagrangian Alternatively, we may solve for the matched filter by solving our maximization problem with a Lagrangian. Again, the matched filter endeavors to maximize the output signal-to-noise ratio ( S N R {\displaystyle \mathrm {SNR} } ) of a filtered deterministic signal in stochastic additive noise. The observed sequence, again, is
x = s + v , {\displaystyle \ x=s+v,\,}
with the noise auto-correlation matrix,
R v = E { v v H } . {\displaystyle \ R_{v}=E\{vv^{\mathrm {H} }\}.\,}
The signal-to-noise ratio is
S N R = | y s | 2 E { | y v | 2 } , {\displaystyle \mathrm {SNR} ={\frac {|y_{s}|^{2}}{E\{|y_{v}|^{2}\}}},}
where y s = h H s {\displaystyle y_{s}=h^{\mathrm {H} }s} and y v = h H v {\displaystyle y_{v}=h^{\mathrm {H} }v} . Evaluating the expression in the numerator, we have
| y s | 2 = y s H y s = h H s s H h . {\displaystyle \ |y_{s}|^{2}={y_{s}}^{\mathrm {H} }y_{s}=h^{\mathrm {H} }ss^{\mathrm {H} }h.\,}
and in the denominator,
E { | y v | 2 } = E { y v H y v } = E { h H v v H h } = h H R v h . {\displaystyle \ E\{|y_{v}|^{2}\}=E\{{y_{v}}^{\mathrm {H} }y_{v}\}=E\{h^{\mathrm {H} }vv^{\mathrm {H} }h\}=h^{\mathrm {H} }R_{v}h.\,}
The signal-to-noise ratio becomes
S N R = h H s s H h h H R v h . {\displaystyle \mathrm {SNR} ={\frac {h^{\mathrm {H} }ss^{\mathrm {H} }h}{h^{\mathrm {H} }R_{v}h}}.}
If we now constrain the denominator to be 1, the problem of maximizing S N R {\displaystyle \mathrm {SNR} } is reduced to maximizing the numerator. We can then formulate the problem using a Lagrange multiplier:
h H R v h = 1 {\displaystyle \ h^{\mathrm {H} }R_{v}h=1}
L = h H s s H h + λ ( 1 − h H R v h ) {\displaystyle \ {\mathcal {L}}=h^{\mathrm {H} }ss^{\mathrm {H} }h+\lambda (1-h^{\mathrm {H} }R_{v}h)}
∇ h ∗ L = s s H h − λ R v h = 0 {\displaystyle \ \nabla _{h^{*}}{\mathcal {L}}=ss^{\mathrm {H} }h-\lambda R_{v}h=0}
( s s H ) h =