Dransform of a real sequence lengthened with zeros.
Loading LOADSUB ALL FROM "FFT.HTS"
or LOADSUB FROM "MATHLIB.HTS"
or LOADSUB Fftz FROM "MATHLIB.HTS"
Usage INTEGER Logn
REAL A(*)
COMPLEX F(*)
CALL Fftz(Logn,A(*),F(*))
Description
Fftzcalculates the discrete Fourier transform of the sequence in the arrayAlengthened with 2Lognzeros and stores the result in the arrayF.Lognis the base-2 log of the number of points in the sequence inA. The arraysAandFmust contain at least 2Lognelements. If they have more than the required number of elements, the extra elements are ignored and unmodified. The number of elements denoted by each permitted value ofLognis shown in the table below:
Logn No. Elements (2Logn)
2 4
3 8
4 16
5 32
6 64
7 128
8 256
9 512
10 1024
11 2048
12 4096
13 8192
14 16384
Except for the lengthening of the input sequence, the values returned byFftzhave the same meaning as those returned byFft; see the entry forFftfor an explanation of the meaning of the values returned.
Fftzhas been provided as a separate CSUB because lengthened sequences are often used when implementing convolutions and correlations and when implementing multiple-window operations on long streams of data. Such operations often have results that are twice as long in the time or space domain as either of their inputs. This results in their Fourier transforms having twice as many frequency components as the transforms of their inputs, with the extra components halfway between the components in the transforms in the input sequences.
Errors
Fftzcauses an HTBasic error if its arguments are not of the types shown in the USAGE section, above, ifLognis not between 2 and 15, inclusive, or if the size ofAorFis smaller than the values described above.