discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] fast dot product?


From: Jens Elsner
Subject: [Discuss-gnuradio] fast dot product?
Date: Thu, 27 Jul 2006 00:47:46 +0200
User-agent: Mutt/1.5.9i

Hello,

I'd like to calculate the complex dot product with GNU Radio.

Is there a way to do it faster that this? This correlation takes 
"ages"...

--- snipp ---

// calculates the inner product <a, b> between complex vectors (dot
// product), optionally shifts vector b first.
gr_complex ofdm_rx_cc::dot_prod(gr_complex* a, gr_complex* b, unsigned
int len, int shift)
{
        gr_complex cor;

        assert((unsigned int)abs(shift)<len);

        if (shift<0) { return conj(dot_prod(b, a, -shift)); }

        b=b+shift;
        for(unsigned int i=0; i<(len-shift); i++) {
                cor+=a[i]*conj(b[i]);
        }

        return cor;
}

--- snipp --

Jens




reply via email to

[Prev in Thread] Current Thread [Next in Thread]