# cross-correlation, chirp finding

Started by November 29, 2009
```I am trying to find short chirps in a signal. I am expecting two
repetitions of the chirp. The input signal is sampled at 44.1 Khz and
the chirp is 850 samples long.

My current method is to cross-correlate the input signal and the chirp
into z. then i use a peak finding algorithm to find the two highest
peaks. My current algorithm is messy as the second chirp if it occurs
close to the first is hard to separate in the cross-correlated signal.

My question is what is a better way to identify the two signals?

```
```On 29 Nov, 12:42, amcneilly <amcnei...@gmail.com> wrote:
> I am trying to find short chirps in a signal. I am expecting two
> repetitions of the chirp. The input signal is sampled at 44.1 Khz and
> the chirp is 850 samples long.
>
> My current method is to cross-correlate the input signal and the chirp
> into z. then i use a peak finding algorithm to find the two highest
> peaks. My current algorithm is messy as the second chirp if it occurs
> close to the first is hard to separate in the cross-correlated signal.
>
> My question is what is a better way to identify the two signals?

The first obvious attempt is to use the matched filter,
which is what you already do. If that doesn't work, I'd
try a normalized non-linear variation:

1) Formulate the filter as a sequence of vetcor dot
product between the reference signal h and the
data x: y[n] = <x[n:n-N+1],h[1:N]>. This is esentially
what a FIR filter already does.
2) Normalize h to magnitude 1 (view with fixed-width font):

N-1
h = h/sum (h[n]^2)
n=0

Up to this point you have only reformulated what you
already do, and scaled the filter response.

The nonlinear variation goes as follows: For *every*
output sample y[n], scale the corresponding vector
x[n:n-N] to unit magnitude:

N-1
y[n] = <x[n:n-N+1]/sum(x[n-k]^2,h[n]).
k=0

This way the response at the detector is |y[n]| == 1
if a noise-and interference-free chirp is detected,
and |y[n]| < 1 otherwise.

This kind of thing might help if one chirp has a much
larger magnitude than the other.

If the problem is about separation in time, you are
limited by the time-bandwitdh product.

Rune
```
```On Nov 30, 12:33=A0am, Rune Allnor <all...@tele.ntnu.no> wrote:
> On 29 Nov, 12:42, amcneilly <amcnei...@gmail.com> wrote:
>
> > I am trying to find short chirps in a signal. I am expecting two
> > repetitions of the chirp. The input signal is sampled at 44.1 Khz and
> > the chirp is 850 samples long.
>
> > My current method is to cross-correlate the input signal and the chirp
> > into z. then i use a peak finding algorithm to find the two highest
> > peaks. My current algorithm is messy as the second chirp if it occurs
> > close to the first is hard to separate in the cross-correlated signal.
>
> > My question is what is a better way to identify the two signals?
>
> The first obvious attempt is to use the matched filter,
> which is what you already do. If that doesn't work, I'd
> try a normalized non-linear variation:
>
> 1) Formulate the filter as a sequence of vetcor dot
> =A0 =A0product between the reference signal h and the
> =A0 =A0data x: y[n] =3D <x[n:n-N+1],h[1:N]>. This is esentially
> =A0 =A0what a FIR filter already does.
> 2) Normalize h to magnitude 1 (view with fixed-width font):
>
> =A0 =A0 =A0 =A0 =A0N-1
> =A0 =A0h =3D h/sum (h[n]^2)
> =A0 =A0 =A0 =A0 =A0n=3D0
>
> Up to this point you have only reformulated what you
> already do, and scaled the filter response.
>
> The nonlinear variation goes as follows: For *every*
> output sample y[n], scale the corresponding vector
> x[n:n-N] to unit magnitude:
>
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0N-1
> =A0 y[n] =3D <x[n:n-N+1]/sum(x[n-k]^2,h[n]).
> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0k=3D0
>
> This way the response at the detector is |y[n]| =3D=3D 1
> if a noise-and interference-free chirp is detected,
> and |y[n]| < 1 otherwise.
>
> This kind of thing might help if one chirp has a much
> larger magnitude than the other.
>
> If the problem is about separation in time, you are
> limited by the time-bandwitdh product.
>
> Rune

I am having a few problems understanding the following

x: y[n] =3D <x[n:n-N+1],h[1:N]>

is N the size of the array ?
is h[1:N] 1 to the length of h ?
What does the little n denote?

Thanks

```
```On 4 Des, 05:49, amcneilly <amcnei...@gmail.com> wrote:
> On Nov 30, 12:33=A0am, Rune Allnor <all...@tele.ntnu.no> wrote:
>
>
>
>
>
> > On 29 Nov, 12:42, amcneilly <amcnei...@gmail.com> wrote:
>
> > > I am trying to find short chirps in a signal. I am expecting two
> > > repetitions of the chirp. The input signal is sampled at 44.1 Khz and
> > > the chirp is 850 samples long.
>
> > > My current method is to cross-correlate the input signal and the chir=
p
> > > into z. then i use a peak finding algorithm to find the two highest
> > > peaks. My current algorithm is messy as the second chirp if it occurs
> > > close to the first is hard to separate in the cross-correlated signal=
.
>
> > > My question is what is a better way to identify the two signals?
>
> > The first obvious attempt is to use the matched filter,
> > which is what you already do. If that doesn't work, I'd
> > try a normalized non-linear variation:
>
> > 1) Formulate the filter as a sequence of vetcor dot
> > =A0 =A0product between the reference signal h and the
> > =A0 =A0data x: y[n] =3D <x[n:n-N+1],h[1:N]>. This is esentially
> > =A0 =A0what a FIR filter already does.
> > 2) Normalize h to magnitude 1 (view with fixed-width font):
>
> > =A0 =A0 =A0 =A0 =A0N-1
> > =A0 =A0h =3D h/sum (h[n]^2)
> > =A0 =A0 =A0 =A0 =A0n=3D0
>
> > Up to this point you have only reformulated what you
> > already do, and scaled the filter response.
>
> > The nonlinear variation goes as follows: For *every*
> > output sample y[n], scale the corresponding vector
> > x[n:n-N] to unit magnitude:
>
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0N-1
> > =A0 y[n] =3D <x[n:n-N+1]/sum(x[n-k]^2,h[n]).
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0k=3D0
>
> > This way the response at the detector is |y[n]| =3D=3D 1
> > if a noise-and interference-free chirp is detected,
> > and |y[n]| < 1 otherwise.
>
> > This kind of thing might help if one chirp has a much
> > larger magnitude than the other.
>
> > If the problem is about separation in time, you are
> > limited by the time-bandwitdh product.
>
> > Rune
>
>
> I am having a few problems understanding the following
>
> x: y[n] =3D <x[n:n-N+1],h[1:N]>
>
> is N the size of the array ?

The length of the reference signal h.

> is h[1:N] 1 to the length of h ?

Yes.

> What does the little n denote?

The running index of the (presumably) time-domain signal.

Rune
```