14
Software Examples
14 – 17
{bflys_per_group=bflys_per_group / 2}
{———— LAST STAGE —————}
I0=^inplacereal;
I1=^inplnover2;
I2=^inplaceimag;
I3=^inplnover2;
CNTR=nover2;
M2=DM(node_space);
M4=1;
I4=^twid_real;
I5=^twid_imag;
MY0=PM(I4,M4),MX0=DM(I1,M0);
{MY0=C,MX0=x1}
MY1=PM(I5,M4),MX1=DM(I3,M0);
{MY1=-S,MX1=y1}
DO bfly_lp UNTIL CE;
MR=MX0*MY1(SS),AX0=DM(I0,M0);
{MR=x1(-S),AX0=x0}
MR=MR+MX1*MY0(RND),AX1=DM(I2,M0);
{MR=(y1(C)+x1(-S)),AX1=y0}
AY1=MR1,MR=MX0*MY0(SS);
{AY1=y1(C)+x1(-S),MR=x1(C)}
MR=MR-MX1*MY1(RND);
{MR=x1(C)-y1(-S)}
AY0=MR1,AR=AX1-AY1;
{AY0=x1(C)-y1(-S), AR=y0-[y1(C)+x1(-S)]}
SB=EXPADJ AR,DM(I3,M1)=AR;
{Check for bit growth, y1=y0-[y1(C)+x1(-S)]}
AR=AX0-AY0,MX1=DM(I3,M0),MY1=PM(I5,M4);
{AR=x0-[x1(C)-y1(-S)], MX1=next y1,MY1=next (-S)}
SB=EXPADJ AR,DM(I1,M1)=AR;
{Check for bit growth, x1=x0-[x1(C)-y1(-S)]}
AR=AX0+AY0,MX0=DM(I1,M0),MY0=PM(I4,M4);
{AR=x0+[x1(C)-y1(-S)], MX0=next x1,MY0=next C}
SB=EXPADJ AR,DM(I0,M1)=AR;
{Check for bit growth, x0=x0+[x1(C)-y1(-S)]}
AR=AX1+AY1;
{AR=y0+[y1(C)+x1(-S)]}
bfly_lp:
SB=EXPADJ AR,DM(I2,M1)=AR;
{Check for bit growth}
CALL bfp_adj;
RTS;
.ENDMOD;
Listing 14.6 Radix-2 DIT FFT Routine, Conditional Block Floating-Point