Professional Documents
Culture Documents
L=∑(dt-yt)2
And we know that
y(t)=f(t)*x(t) = ∑fτ.xt-τ
Hence:
L= ∑[dt- (∑fτ.xt-τ)]2
Our goal is to compute the filter coefficients (f0, f1, f2,
f3,…..) so that the error is minimum.
Internal
Wiener Filter
The minimum error can be attained by setting the
variation of L with respect to fi=0.
Based on this equation:
L= ∑[dt- (∑fτ.xt-τ)]2
f x
t
t xt i d t xt i
t
f xt xt i dt xt i
t t
Internal
Wiener Filter
f x
t
t xt i dt xt i
t
x
t
t xt i = ri r ie the auto-correlation of x (input)
Note that:
d x
t
t t i = gi ie the cross-correlation of desired (d) with x
f r g i i i=0,1,2,3,4,5…..
Internal
Toeplitz Matrix
This can be re-written in matrix called Toeplitz Matrix
r0 r1 r2 ... rn 1 f 0 g 0
r r0 r1 ... rn 2 f1 g1
1
r2 r1 r0 ... rn 3 f 2 g 2
: : : : : : :
rn rn 1 rn 2 ... r0 f n 1 g n 1
The autocorrelation lag The cross
of the input correlation of the
input with desired
output
so ... gi f r i
so ... L min dt2 2 f g f f i xt xt i
d2 2 f g f f i xt xt i
t i
L min 2
L min t 2 f g f f i r i
t
t d i
L min
t d t
2
2
f g
f
i f i r i
d 2 2 f g f g
2 f g
t 2 i
L d f g
L min
min
tt
t
t
min d
dtt2 ff gg
2
L min
tt
Internal
Optimum Wiener Filter
The optimum wiener filter (f1,….,fn-1) is optimum in that the
least-squares errors between the actual and desired output is
minimum.
When the desired output is zero-lag spike (1,0,0,0..) then
wiener filter is identical to the least-square inverse filter.
Least square inverse filter is a special case of wiener filter
Wiener filter applies to any type of desired output
Type 1: Zero-lag spike
Type 2: Spike at arbitrary lag
Type 3: Time advance from input series
Type 4: Zero phase wavelet
Type 5: Any desired arbitrary shape
Internal
Spiking Deconvolution
Optimum Wiener Filter:
Desired output = zero lag spike (1,0,0,0…)
Input Desired
wavelet Output
Cross
correlation
Auto r0 r1 r2 ... rn1 f0 g0
correlation r r0 r1 ... rn2 f1 g1
Wiener 1
filter r2 r1 r0 ... rn3 f 2 g 2
* : : : : : : :
rn rn1 rn2 ... r0 f n1 g n1
Actual
Output
Internal
Spiking Deconvolution
r0 r1 r2 ... rn 1 f 0 g 0
r r0 r1 ... rn 2 f1 g1
1
r2 r1 r0 ... rn 3 f 2 g 2
: : : : : : :
rn rn 1 rn 2 ... r0 f n 1 g n 1
-r1
thus ......... a1 = Solve the filter coefficients
r0
(a1’, and a2’) using the
same steps
Note that from 1st iteration
we get a1 and v
Internal
Spiking Deconvolution
rewrite the equations (2 points filter) by adding a row e r2 r1a1
r0 r1 r2 1 v
r0 r1 1 v
r ...............
r1 r0 r1
a1 0
1 r0 a1
0
r2 r1 r0
0
e
a 2 0 c
and
v ' v ce
0
0 0
0 e cv
Internal
Spiking Deconvolution
The recursive scheme is repeated to determine the next
set of filter coefficients.
Thus yields the Wiener filter (1, a1, a2, a3, a4, ……, an-i) of
desired length.
Internal
Wiener vs Least Square
Comparing the matrix equation of Wiener and least square
inverse filter
Least square Wiener
r0 r1 r2 ... ... rn-1 1 v r0 r1 r2 ... ... rn-1 f 0 g 0
r ... ... rn-2 a1 0 r ... ... rn-2 f1 g1
1 r0 r1
1 r0 r1
r2 r1 r0 ... ... rn-3 a 2 0 r2 r1 r0 ... ... rn-3 f 2 g 2
: : : :.. :.. : : : : : : :.. :.. : : :
: : : :.. :.. : : : : : : :.. :.. : : :
rn-1 rn-2 rn-3 ... ... r0 an-1 0 rn-1 rn-2 rn-3 ... ... r0 f n-1 g n-1
Internal
Problem with Spiking Deconvolution
Example: Spiking deconvolution cannot compress wavelet
(-0.5, 1) to a zero lag spike (1,0,0).
STEPS
1. Compute the cross-correlation of
Input Desired
wavelet Output input wavelet and desired output.
2. Compute the auto-correlation of
Cross
correlation input wavelet.
Auto
correlation 3. Find the filter coefficients.
Wiener filter
4. Convolve with input wavelet to get
the actual output.
* 5. Calculate LS error between desired
Actual Output and actual.
Internal
Shaping Filter: Example
1. Compute the cross-correlation of input wavelet and
desired output
Input Desired
wavelet Output 0 1 0 output
Cross -0.5 1 1
Auto
correlation
-0.5 1 -0.5
correlation -0.5 0
Wiener filter
*
Actual Output
Internal
Shaping Filter: Example
2. Compute the auto-correlation of input wavelet
Input Desired
wavelet Output
-0.5 1 output
Cross
correlation
-0.5 1 1.25
Auto
correlation
-0.5 -0.5
Wiener filter
*
Actual Output
Internal
Shaping Filter: Example
3. Find the filter coefficients.
r0 r1 a g0
r
Input Desired 1 r0 b g1
wavelet Output
* b 2
21
Actual Output
21 ,
so the filter coefficient (a,b)=( 16 2
21 )
Internal
Shaping Filter: Example
4. Convolve with input wavelet to get the actual output
Input Desired
wavelet Output
-0.5 1 output
Cross 16/21 -8/21
correlation
Auto -2/21 16/21 17/21
correlation
-2/21 -2/21
Wiener filter
*
Actual Output
Internal
Shaping Filter: Example
5. Calculate LS error between desired and actual
L=∑(di – ai)2
Input Desired
wavelet Output Desired Actual L
Cross
0 -8/21
Auto
correlation 1 17/21
correlation 0 -2/21
Wiener filter 84/441
*
Actual Output
Internal
Shaping Filter: Example
If the desired output is zero-lag spike (1,0,0), instead
of delay-lag spike (0,1,0), the error is:
L=∑(di – ai)2
Input Desired
wavelet Output Desired Actual L
Cross
1 5/21
Auto
correlation 0 -8/21
correlation 0 -4/21
Wiener filter 336/441
*
Actual Output
Internal
Shaping Filter: Example
If the desired output is 2-lag spike (0,0,1), the error is:
Input Desired
wavelet Output Desired Actual L
Cross
0
Auto
correlation 0
correlation 1
Wiener filter ?
*
Actual Output
Internal
Shaping Filter: Summary
• Less error when converting wavelet (-0.5, 1) to delay
spike than to a zero lag spike
• In general, a series of desired outputs can be defined as
delayed spike
• If plot least square error as a function of delay:
lag corresponds to least error is chosen to define the
desired delayed spike output LS Error
* 336/441
* 84/441
* ?? lag
Internal