PR READ "Template.Fast_Fourier_transform.a68" PRįORMAT real array fmt := $f ( real fmt ) ", "$ įORMAT compl fmt := $f ( real fmt ) "⊥"f ( real fmt )$ įORMAT compl array fmt := $f (compl fmt ) ", "$ PROC ( COMPL ) COMPL scalar exp = complex exp ) File: test.Fast_Fourier_transform.a68 #!/usr/local/bin/a68g -script # PROC fft = ( SCALAR in t ) SCALAR : (ĬOMPL cis t = scalar exp (0 I ( -w * k ) ) *odd SCALAR out įOR index FROM LWB in BY step TO UPB in DO # Dice the array, extract array values a "step" apart # OP DICE = ( SCALAR in, INT step ) SCALAR : ( File: Template.Fast_Fourier_transform.a68 PRIO DICE = 9 # ideally = 11 # Works with: ALGOL 68G version Any - tested with release algol68g-2.3.5. Put (X (I - Y'First + X'First ), Aft => 3, Exp => 0 ) Complex_Elementary_Functions įunction FFT is new Generic_FFT (Ada. Odd (Odd'First + K ) := Even (Even'First + K ) - T Įven (Even'First + K ) := Even (Even'First + K ) + T T : constant Complex := Odd (Odd'First + K ) / F ** K Odd : Complex_Vector := FFT (X (X'First + S. Generic_Complex_Elementary_Functionsįunction FFT (X : Complex_Vector N, S : Positive )į : constant Complex := exp (Pi * j / Real_Arrays. Generic_Complex_Elementary_Functions įunction Generic_FFT (X : Complex_Vector ) return Complex_Vector is Generic_Complex_Arrays ( ) įunction Generic_FFT (X : Complex_Vector ) return Complex_Vector The FFT function is defined as a generic function, instantiated uponĪ user instance of _Complex_Arrays.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |