DSPRelated.com
Forums

Finally! Match Filtering On Excel

Started by Bret Cahill December 14, 2010
Make a signal.

Make some less than correlated noise

Add the signal to the noise

Use the signal as the reference.

Take the Fourier transform of the noisy signal to get F.sig

Take the Fourier transform of the reference to get F.ref

Take the real of F.sig

Take the real of  F.ref

Multiply the real parts of F.sig with F.ref.  This is straightforward
if you first think about just recovering the ref. with an inverse
transform and then try to do the same thing.  Here you must undo what
is effectively a squaring so you must take the sqrt.  To preserve the
sign use the SIGN function.

SIGN(IMREAL(F.ref))*SQRT(ABS(IMREAL(F.sig)*IMREAL(F.ref)))

Take the imaginary of F.sig

Take the imaginary of  F.ref

Multiply the two imaginary parts:

SIGN(IMAGINARY(F.ref))*SQRT(ABS(IMAGINARY(F.sig)*IMAGINARY(F.ref)))

Now recombine the real product and the imaginary product,
COMPLEX(real, imaginary)

Then take the inverse Fourier transform of the complex number.

The real of the inverse should pretty much graph over the original
function.


Bret Cahill








On Dec 14, 10:34&#4294967295;pm, Bret Cahill <Bret_E_Cah...@yahoo.com> wrote:
> Make a signal. > > Make some less than correlated noise > > Add the signal to the noise > > Use the signal as the reference. > > Take the Fourier transform of the noisy signal to get F.sig > > Take the Fourier transform of the reference to get F.ref > > Take the real of F.sig > > Take the real of &#4294967295;F.ref > > Multiply the real parts of F.sig with F.ref. &#4294967295;This is straightforward > if you first think about just recovering the ref. with an inverse > transform and then try to do the same thing. &#4294967295;Here you must undo what > is effectively a squaring so you must take the sqrt. &#4294967295;To preserve the > sign use the SIGN function. > > SIGN(IMREAL(F.ref))*SQRT(ABS(IMREAL(F.sig)*IMREAL(F.ref))) > > Take the imaginary of F.sig > > Take the imaginary of &#4294967295;F.ref > > Multiply the two imaginary parts: > > SIGN(IMAGINARY(F.ref))*SQRT(ABS(IMAGINARY(F.sig)*IMAGINARY(F.ref))) > > Now recombine the real product and the imaginary product, > COMPLEX(real, imaginary) > > Then take the inverse Fourier transform of the complex number. > > The real of the inverse should pretty much graph over the original > function. > > Bret Cahill
I can't tell you how long I have been waiting for this solution.
On 10-12-15 07:26 PM, John wrote:
> On Dec 14, 10:34 pm, Bret Cahill<Bret_E_Cah...@yahoo.com> wrote: >> Make a signal. >> >> Make some less than correlated noise >> >> Add the signal to the noise >> >> Use the signal as the reference. >> >> Take the Fourier transform of the noisy signal to get F.sig >> >> Take the Fourier transform of the reference to get F.ref >> >> Take the real of F.sig >> >> Take the real of F.ref >> >> Multiply the real parts of F.sig with F.ref. This is straightforward >> if you first think about just recovering the ref. with an inverse >> transform and then try to do the same thing. Here you must undo what >> is effectively a squaring so you must take the sqrt. To preserve the >> sign use the SIGN function. >> >> SIGN(IMREAL(F.ref))*SQRT(ABS(IMREAL(F.sig)*IMREAL(F.ref))) >> >> Take the imaginary of F.sig >> >> Take the imaginary of F.ref >> >> Multiply the two imaginary parts: >> >> SIGN(IMAGINARY(F.ref))*SQRT(ABS(IMAGINARY(F.sig)*IMAGINARY(F.ref))) >> >> Now recombine the real product and the imaginary product, >> COMPLEX(real, imaginary) >> >> Then take the inverse Fourier transform of the complex number. >> >> The real of the inverse should pretty much graph over the original >> function. >> >> Bret Cahill > > I can't tell you how long I have been waiting for this solution.
I feel no one can tell him how long they've been waiting for this solution. I certainly can't. mike
On 12/14/2010 7:34 PM, Bret Cahill wrote:
> Make a signal. > > Make some less than correlated noise > > Add the signal to the noise > > Use the signal as the reference. > > Take the Fourier transform of the noisy signal to get F.sig > > Take the Fourier transform of the reference to get F.ref > > Take the real of F.sig > > Take the real of F.ref > > Multiply the real parts of F.sig with F.ref. This is straightforward > if you first think about just recovering the ref. with an inverse > transform and then try to do the same thing. Here you must undo what > is effectively a squaring so you must take the sqrt. To preserve the > sign use the SIGN function. > > SIGN(IMREAL(F.ref))*SQRT(ABS(IMREAL(F.sig)*IMREAL(F.ref))) > > Take the imaginary of F.sig > > Take the imaginary of F.ref > > Multiply the two imaginary parts: > > SIGN(IMAGINARY(F.ref))*SQRT(ABS(IMAGINARY(F.sig)*IMAGINARY(F.ref))) > > Now recombine the real product and the imaginary product, > COMPLEX(real, imaginary) > > Then take the inverse Fourier transform of the complex number. > > The real of the inverse should pretty much graph over the original > function. > > > Bret Cahill >
Unless you're starting with complex signals and filter, the result should be purely real - after all it's the convolution of the filter with the signal isn't it? I guess the "filter" is the signal flipped so that the convolution becomes correlation. Fred
On 10-12-16 02:45 PM, Fred Marshall wrote:

> Unless you're starting with complex signals and filter, the result > should be purely real - after all it's the convolution of the filter > with the signal isn't it? I guess the "filter" is the signal flipped so > that the convolution becomes correlation.
Please excuse my ignorance, but what happens when you DON'T have the original signal? How does this technique work when the noise is added to a signal of undetermined shape? To my untrained eye, this system is like needing a key to take to the locksmith in order to duplicate a lost key. mike
On Dec 17, 12:09&#4294967295;am, m II <C...@in.the.hat> wrote:
> On 10-12-16 02:45 PM, Fred Marshall wrote: > > > Unless you're starting with complex signals and filter, the result > > should be purely real - after all it's the convolution of the filter > > with the signal isn't it? I guess the "filter" is the signal flipped so > > that the convolution becomes correlation. > > Please excuse my ignorance, but what happens when you DON'T have the > original signal?
Without the original signal you can not make a matched filter.
> How does this technique work when the noise is added to > a signal of undetermined shape?
It doesn't.
> To my untrained eye, this system is like needing a key to take to the > locksmith in order to duplicate a lost key.
A very good comparision indeed: Like a key only works with a given lock, a matched filter only works with a given signal. Rune
On Dec 16, 11:46&#4294967295;pm, Rune Allnor <all...@tele.ntnu.no> wrote:
> On Dec 17, 12:09&#4294967295;am, m II <C...@in.the.hat> wrote:
...
> > To my untrained eye, this system is like needing a key to take to the > > locksmith in order to duplicate a lost key. > > A very good comparision indeed: Like a key only works with a > given lock, a matched filter only works with a given signal.
The comparison isn't exact, though. A lock either opens or doesn't. With supposedly matched filters, the noise reduction depends on the goodness of the match. Jerry -- Distrust people who preface their statements with "Let's be honest."
> > Make a signal. > > > Make some less than correlated noise > > > Add the signal to the noise > > > Use the signal as the reference. > > > Take the Fourier transform of the noisy signal to get F.sig > > > Take the Fourier transform of the reference to get F.ref > > > Take the real of F.sig > > > Take the real of &#4294967295;F.ref > > > Multiply the real parts of F.sig with F.ref. &#4294967295;This is straightforward > > if you first think about just recovering the ref. with an inverse > > transform and then try to do the same thing. &#4294967295;Here you must undo what > > is effectively a squaring so you must take the sqrt. &#4294967295;To preserve the > > sign use the SIGN function. > > > SIGN(IMREAL(F.ref))*SQRT(ABS(IMREAL(F.sig)*IMREAL(F.ref))) > > > Take the imaginary of F.sig > > > Take the imaginary of &#4294967295;F.ref > > > Multiply the two imaginary parts: > > > SIGN(IMAGINARY(F.ref))*SQRT(ABS(IMAGINARY(F.sig)*IMAGINARY(F.ref))) > > > Now recombine the real product and the imaginary product, > > COMPLEX(real, imaginary) > > > Then take the inverse Fourier transform of the complex number. > > > The real of the inverse should pretty much graph over the original > > function. > > > Bret Cahill > > Unless you're starting with complex signals and filter, the result > should be purely real -
Completely real.
> after all it's the convolution of the filter > with the signal isn't it? &#4294967295;I guess the "filter" is the signal flipped so > that the convolution becomes correlation.
In fact, you can do about as good just using the correlation function CORREL which saves a lot of time. Bret Cahill
> > Unless you're starting with complex signals and filter, the result > > should be purely real - after all it's the convolution of the filter > > with the signal isn't it? I guess the "filter" is the signal flipped so > > that the convolution becomes correlation. > > Please excuse my ignorance, but what happens when you DON'T have the > original signal? How does this technique work when the noise is added to > a signal of undetermined shape? > > To my untrained eye, this system is like needing a key to take to the > locksmith in order to duplicate a lost key.
The match or North filter may have originated in radar where you know the shape of the clean noise free outgoing signal because you're the one who created in the first place. The returning signal, however, is picked up by an antenna which picks up everything, noise as well as the signal. Unless someone is playing around with you the noise won't correlate well with the original wave form so you keep checking and checking the correlation. You take a break and then go back to checking the correlation until you see a spike. That's when you can be pretty certain the signal has finally returned home to Mom. Now you can calculate the distance to the reflecting object by the time interval and speed of light. BTW the same thing goes on all the time in the political, financial, intellectual, technological, and social "domains." There's isn't any more reason to make artificial distinctions between one kind of signal processing and another than to claim temperature isn't a signal. If our climate researchers are to be believed temperature is The Signal. Bret Cahill "For you it's all the same thing, port [disasters], DC politics . . ." -- stevedore [astounded] "You figured me out, sir." -- Bret
> > > To my untrained eye, this system is like needing a key to take to the > > > locksmith in order to duplicate a lost key. > > > A very good comparision indeed: Like a key only works with a > > given lock, a matched filter only works with a given signal. > > The comparison isn't exact, though. A lock either opens or doesn't. > With supposedly matched filters, the noise reduction depends on the > goodness of the match.
And the "badness" of the correlation w/ the noise. The military must have all kinds of ways to monkey around with someone else's signal. Bret Cahill