[an error occurred while processing this directive]
[an error occurred while processing this directive]
|
У AD есть пример вычисления FFT на 1024 точки (DIT Radix-2). Я хочу переделать этот пример на 4096 точки, не нужно ли мне при этом менять модуль BFP_ADJ (кроме константы Ntimes2, которая будет с этом случае 8192), чтобы не получить переполнение?. Исходный пример модуля BFP_ADJ ниже.
.MODULE dit_radix_2_bfp_adjust;
{
Calling Parameters
Radix-2 DIT FFT stage results in inplacereal and inplaceimag
NOTE: this code assumes inplaceimag immediately follows inplacereal in memory!
Return Parameters
inplacereal and inplaceimag adjusted for bit growth
Altered Registers
I0,I1,AX0,AY0,AR,MX0,MY0,MR,CNTR
Altered Memory
inplacereal, inplaceimag, blk_exponent
}
.CONST Ntimes2=2048;
.EXTERNAL inplacereal, blk_exponent;
.ENTRY bfp_adj;
bfp_adj: AY0=CNTR; {Check for last stage}
AR=AY0-1;
IF EQ RTS; {If last stage, return}
AY0=-2;
AX0=SB;
AR=AX0-AY0; {Check for SB=-2}
IF EQ RTS; {IF SB=-2, no bit growth, return}
I0=^inplacereal; {I0=read pointer}
I1=^inplacereal; {I1=write pointer}
AY0=-1;
MY0=H#4000; {Set MY0 to shift 1 bit right}
AR=AX0-AY0,MX0=DM(I0,M1); {Check if SB=-1; Get first sample}
IF EQ JUMP strt_shift; {If SB=-1, shift block data 1 bit}
AX0=-2; {Set AX0 for block exponent update}
MY0=H#2000; {Set MY0 to shift 2 bits right}
strt_shift: CNTR=Ntimes2-1; {initialize loop counter}
DO shift_loop UNTIL CE; {Shift block of data}
MR=MX0*MY0(RND),MX0=DM(I0,M1); {MR=shifted data,MX0=next value}
shift_loop: DM(I1,M1)=MR1; {Unshifted data=shifted data}
MR=MX0*MY0(RND); {Shift last data word}
AY0=DM(blk_exponent); {Update block exponent and}
DM(I1,M1)=MR1,AR=AY0-AX0; {store last shifted sample}
DM(blk_exponent)=AR;
RTS;
.ENDMOD;
E-mail: info@telesys.ru