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

Function bitrevR2

src/core/_SoundPipe_FFT.cpp:546–684  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544*****************/
545
546static void bitrevR2(SPFLOAT * ioptr, int M, int16_t * BRLow)
547{
548 /*** bit reverse and first radix 2 stage of forward or inverse fft ***/
549 SPFLOAT f0r;
550 SPFLOAT f0i;
551 SPFLOAT f1r;
552 SPFLOAT f1i;
553 SPFLOAT f2r;
554 SPFLOAT f2i;
555 SPFLOAT f3r;
556 SPFLOAT f3i;
557 SPFLOAT f4r;
558 SPFLOAT f4i;
559 SPFLOAT f5r;
560 SPFLOAT f5i;
561 SPFLOAT f6r;
562 SPFLOAT f6i;
563 SPFLOAT f7r;
564 SPFLOAT f7i;
565 SPFLOAT t0r;
566 SPFLOAT t0i;
567 SPFLOAT t1r;
568 SPFLOAT t1i;
569 SPFLOAT * p0r;
570 SPFLOAT * p1r;
571 SPFLOAT * IOP;
572 SPFLOAT * iolimit;
573 int Colstart;
574 int iCol;
575 unsigned int posA;
576 unsigned int posAi;
577 unsigned int posB;
578 unsigned int posBi;
579
580 const unsigned int Nrems2 = POW2((M + 3) / 2);
581 const unsigned int Nroot_1_ColInc = POW2(M) - Nrems2;
582 const unsigned int Nroot_1 = POW2(M / 2 - 1) - 1;
583 const unsigned int ColstartShift = (M + 1) / 2 + 1;
584
585 posA = POW2(M); /* 1/2 of POW2(M) complexes */
586 posAi = posA + 1;
587 posB = posA + 2;
588 posBi = posB + 1;
589
590 iolimit = ioptr + Nrems2;
591 for (; ioptr < iolimit; ioptr += POW2(M / 2 + 1))
592 {
593 for (Colstart = Nroot_1; Colstart >= 0; Colstart--)
594 {
595 iCol = Nroot_1;
596 p0r = ioptr + Nroot_1_ColInc + BRLow[Colstart] * 4;
597 IOP = ioptr + (Colstart << ColstartShift);
598 p1r = IOP + BRLow[iCol] * 4;
599 f0r = *(p0r);
600 f0i = *(p0r + 1);
601 f1r = *(p0r + posA);
602 f1i = *(p0r + posAi);
603 for (; iCol > Colstart;)

Callers 1

ffts1Function · 0.85

Calls 1

POW2Function · 0.85

Tested by

no test coverage detected