[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Discuss-gnuradio] patch to gcell fft
From: |
Eric Blossom |
Subject: |
Re: [Discuss-gnuradio] patch to gcell fft |
Date: |
Wed, 9 Jul 2008 14:26:27 -0700 |
User-agent: |
Mutt/1.5.17 (2007-11-01) |
On Wed, Jul 09, 2008 at 04:38:20PM -0400, Charles Swiger wrote:
> Here is a patch to add windowing to
> gcell/src/lib/wrapper/spu/gcs_fft_1d_r2.c , seems quick and snappy:
>
>
> 24a25
> > #include <spu_intrinsics.h>
> 50a52
> >
> 52,53c54,69
> < // FIXME pointwise multiply in *= window
> < assert(0);
> ---
> > /* pointwise multiply: in *= window
> > *
> > * shuffle pattern to make float 'window' suitable for vector multiply
> > * by complex 'in'
> > */
> > vector unsigned char pattern[2];
> > pattern[0] = (vector unsigned
> > char){0x0,0x1,0x2,0x3,0x0,0x1,0x2,0x3,0x4,0x5,0x6,0x7,0x4,0x5,0x6,0x7};
> > pattern[1] = (vector unsigned
> > char){0x8,0x9,0xa,0xb,0x8,0x9,0xa,0xb,0xc,0xd,0xe,0xf,0xc,0xd,0xe,0xf};
> > register vector float zeros = (vector float){0,0,0,0};
> > register vector float tempwin;
> >
> > int i;
> > for (i=0; i<(1 << log2_fft_length)/2; i++) {
> > tempwin = spu_shuffle(window[i/2],zeros,pattern[(i & 0x1)]);
> > in[i] *= tempwin;
> > }
>
>
> Seems to work, take a lot of 'spikeyness' out:
>
> http://www.swigerco.com/fft_windowing.html
>
> It will also break gr-gcell/src/qa_fft.py
>
> --Chuck
No need for all this shuffling...
I'll see if I can't get something in later on today.
Eric