I was hoping that there would be some psuedo or example code for the CMSIS generated bit reverse look up tables for the FFTs. I would like to try and extend the FFT to 8k in length. So I am looking at these tables, but can not figure out how they are generated, specifically the tables like armBitRevIndexTable128.
Thanks.
yup that's it. Good thing too, cause I now see a flaw in the code I posted here. I forgot about the data being a complex pair. In the assembly I got around this by loading the pair all at once as a 32 bit number (even though its actually 2 16 bit numbers). But in my posted C code, I'm only loading 16 bits. So here is a modified version that loads the 32 bits rather than 16.
/*
* @brief In-place bit reversal function.
* @param[in, out] *pSrc points to the in-place buffer of unknown 32-bit data type.
* @param[in] bitRevLen bit reversal table length
* @param[in] *pBitRevTab points to bit reversal table.
* @return none.
*/
static void arm_bitreversal_16(uint16_t * pSrc, uint16_t bitRevLen, const uint16_t * pBitRevTable)
{
uint32_t v0, v1, i;
uint32_t *p0, *p1;
for (i = (bitRevLen + 1) >> 1; i > 0; i--) {
p0 = (uint32_t*)((uint8_t*)pSrc + (pBitRevTable[0] >> 1));
p1 = (uint32_t*)((uint8_t*)pSrc + (pBitRevTable[1] >> 1));
v0 = *p0;
v1 = *p1;
*p0 = v1;
*p1 = v0;
pBitRevTable += 4;
}