DSPRelated.com
Forums

AW: AW: optimised autocorrelation

Started by Jens Michaelsen September 13, 2003

I must be somewhat wrong,
don't get the same results
if I do A or B or C:

Variant A:
bor(a)
xT(b);

Variant B:
bT(a);
y=RMS(b);

Variant C:
bT(a);
c=RMS(b);
d=IFFT(c);
zT(d); > Why not try autocorrelation using FFT.
> ADI provided FFT routines are very much
> efficient and will save computations quite a lot.

Sorry, looks like school days are quite too far away.
Maybe Acorr via FFT is good, but I currently don't
have the handling in something like C to start with.

Tryed to dig for it via google and so, but looks
like its too special for such global machines.

May someone be so kind to give me a short hint.

ThanX
Jens Michaelsen -----Ursprungliche Nachricht-----
Von: hemant ramdasi [mailto:]
Gesendet: Samstag, 13. September 2003 06:29
An:
Betreff: Re: AW: [adsp] optimised autocorrelation Why not try this( u may have :) )

FFT(); -----------|
get power spectrum(); |--Acor();
IFFT of power spectrum()-------|

By the way , this is only for cycle reduction and not
for noise.
regards
hemant
--- Jens Michaelsen <> wrote:
>
> Right, the FFT routines are quite good.
> We process 1024 samples like this:
> - Acor();
> - FFT();
> - search for maximum();
> - ...
> - done
>
> There is good signal from
> about 500 Hz up to some kHz.
> There is all kind of noise.
> Down from near DC up to several kHz.
> To name it would write NOISE.
> Wind, gear, mud, all these things.
>
> There is something called "fast convolution",
> but not shure if this will help me.
> Did not find much about it.
> What I found did not help so far.
>
> Is there math-man that can give some help?
> Did not find the gap that helps me doing
> a FFT to kick out the acorr().
> If I do a FFT only, without acorr()
> I don't even see the signal, no way
> to find any maximum via software.
>
> ThanX for your patience :)
> Jens Michaelsen
>
> -----Urspr|ngliche Nachricht-----
> Von:
>

> oo.com
>
[mailto:
> oups.yahoo.com]Im Auftrag von hemant ramdasi
> Gesendet: Freitag, 12. September 2003 19:35
> An:
> Cc:
> Betreff: Re: [adsp] optimised autocorrelation >
> I have been able to reduce the cycles by this
> method.
>
> regards
> hemant


__________________________________




Are you trying to compute the autocorrelation (a time-domain function) or are
you after the amplitude reponse?

The autocorrelation of a sequence x(n) of length M can be obtained thus:

1) Augment the sequence with zeros to (at least) length N = 2M-1. If you are
using a radix-2 FFT (the most common version) the length will have to be a
power of 2, so if the length M of the original sequence is not a power of 2,
augment it with extra zeros until the sequence N >= 2M. The reason for
augmenting the original sequence is that the DFT computes, not the linear,
but the circular correlation. However, when the input sequence is augmented
with zeros, the circular correlation becomes equivalent to its linear
conterpart.
2) Compute the FFT: X(k) = FFT(x(n))
3) compute Y(k) = X(k)X'(k), k = 0, 1, ..., N-1, where ' stands for
conjugatation. Note that the products X(k)X'(k) are complex multiplications.
4) Compute a(n) = IFFT(Y(k)). The sequence a(n), n = 0, 1, ..., N-1, is the
autocorrelation.

If you are just after the amplitude spectrum, the procedure is simply:
1) X(k) = FFT(x(n)), k and k = 0,1, ..., M-1. No zero augmentation is
required.
2) |X(k)| = sqrt( (Xre(k) )^2 + (Xim(k) )^2 ).

Note that if you take the inverse FFT of the amplitude spectrum |X(k)| you end
up with the autocorrelation. But in this case you must augment the original
sequence with zeros first.

Also note that the FFT (Fast Fourier Fransform) is just a fast algorithm for
computeing the discrete Fourier transform (DFT). Le Samedi 13 Septembre 2003 11:45, Jens Michaelsen rivit :
> I must be somewhat wrong,
> don't get the same results
> if I do A or B or C:
>
> Variant A:
> bor(a)
> xT(b);
>
> Variant B:
> bT(a);
> y=RMS(b);
>
> Variant C:
> bT(a);
> c=RMS(b);
> d=IFFT(c);
> zT(d);
>
> > Why not try autocorrelation using FFT.
> > ADI provided FFT routines are very much
> > efficient and will save computations quite a lot.
>
> Sorry, looks like school days are quite too far away.
> Maybe Acorr via FFT is good, but I currently don't
> have the handling in something like C to start with.
>
> Tryed to dig for it via google and so, but looks
> like its too special for such global machines.
>
> May someone be so kind to give me a short hint.
>
> ThanX
> Jens Michaelsen > -----Ursprungliche Nachricht-----
> Von: hemant ramdasi [mailto:]
> Gesendet: Samstag, 13. September 2003 06:29
> An:
> Betreff: Re: AW: [adsp] optimised autocorrelation > Why not try this( u may have :) )
>
> FFT(); -----------|
> get power spectrum(); |--Acor();
> IFFT of power spectrum()-------|
>
> By the way , this is only for cycle reduction and not
> for noise.
> regards
> hemant
>
> --- Jens Michaelsen <> wrote:
> > Right, the FFT routines are quite good.
> > We process 1024 samples like this:
> > - Acor();
> > - FFT();
> > - search for maximum();
> > - ...
> > - done
> >
> > There is good signal from
> > about 500 Hz up to some kHz.
> > There is all kind of noise.
> > Down from near DC up to several kHz.
> > To name it would write NOISE.
> > Wind, gear, mud, all these things.
> >
> > There is something called "fast convolution",
> > but not shure if this will help me.
> > Did not find much about it.
> > What I found did not help so far.
> >
> > Is there math-man that can give some help?
> > Did not find the gap that helps me doing
> > a FFT to kick out the acorr().
> > If I do a FFT only, without acorr()
> > I don't even see the signal, no way
> > to find any maximum via software.
> >
> > ThanX for your patience :)
> > Jens Michaelsen
> >
> > -----Urspr|ngliche Nachricht-----
> > Von: >
> > oo.com
>
> [mailto:
>
> > oups.yahoo.com]Im Auftrag von hemant ramdasi
> > Gesendet: Freitag, 12. September 2003 19:35
> > An:
> > Cc:
> > Betreff: Re: [adsp] optimised autocorrelation
> >
> >
> >
> > I have been able to reduce the cycles by this
> > method.
> >
> > regards
> > hemant
>
> __________________________________ >
> _____________________________________
> Note: If you do a simple "reply" with your email client, only the author of
> this message will receive your answer. You need to do a "reply all" if you
> want your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to
>
> To Post: Send an email to
>
> To Leave: Send an email to
>
> Archives: http://groups.yahoo.com/group/adsp
>
> Other Groups: http://www.dsprelated.com/groups.php3 > ">http://docs.yahoo.com/info/terms/