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




_______________________________________________
Discuss-gnuradio mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/discuss-gnuradio

Reply via email to