MCPcopy Create free account
hub / github.com/LabSound/LabSound / fftBRInit

Function fftBRInit

src/core/_SoundPipe_FFT.cpp:516–540  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

514}
515
516void fftBRInit(int M, int16_t * BRLow)
517{
518 /* Compute BRLow, the bit reversed table for ffts */
519 /* of size pow(2,M/2 -1) */
520 /* INPUTS */
521 /* M = log2 of fft size */
522 /* OUTPUTS */
523 /* *BRLow = bit reversed counter table */
524 int Mroot_1 = M / 2 - 1;
525 int Nroot_1 = POW2(Mroot_1);
526 int i1;
527 int bitsum;
528 int bitmask;
529 int bit;
530
531 for (i1 = 0; i1 < Nroot_1; i1++)
532 {
533 bitsum = 0;
534 bitmask = 1;
535 for (bit = 1; bit <= Mroot_1; bitmask <<= 1, bit++)
536 if (i1 & bitmask)
537 bitsum = bitsum + (Nroot_1 >> bit);
538 BRLow[i1] = bitsum;
539 }
540}
541
542/*****************
543* parts of ffts1 *

Callers 1

sp_fft_initFunction · 0.85

Calls 1

POW2Function · 0.85

Tested by

no test coverage detected