HTBasic Help
×
Menu
Index
Rfilter
Filter a real sequence.
 
Loading        LOADSUB ALL FROM "FFT.HTS"
or LOADSUB FROM "MATHLIB.HTS"
or LOADSUB Rfilter FROM "MATHLIB.HTS"
 
Usage                INTEGER Logn
REAL A(*),B(*),F(*)
CALL Rfilter(Logn,A(*),F(*),B(*))
 
Description                
Rfilter calculates the sequence produced by filtering the time-domain (or space-domain) sequence in A by the filter whose frequency-domain coefficients are in F. It returns the resulting sequence in the array B. Logn is the base-2 log of the number of points in the sequences in A and B. The arrays A and B must contain at least 2Logn elements. The array F must contain at least 2Logn-1 elements. If the arrays have extra elements, the extra elements are ignored and unmodified.
 
The values in F are the amounts by which to scale the corresponding frequency components in A to produce the resultant sequence. These values are magnitudes; Rfilter assumes that all filter coefficients have zero phase; use Filter to use a filter function having both magnitude and phase.
 
The first element in F represents the amount by which the d. c. term in A is to be scaled, the second the amount by which the 1/N frequency component is scaled, the third the amount by which the 2/N frequency component is scaled, etc. The meaning of each frequency component is the same for Rfilter as for Fft and is explained in the entry for Fft.
 
If the sequence to be used as a filter is specified as an impulse response, the Convolve function may be used to filter using the impulse response as input.
 
Errors                
Rfilter causes an HTBasic error if its arguments are not of the types shown in the USAGE section, above, if Logn is not between 2 and 15, inclusive, or if the size of A or B is smaller than 2Logn, or if F is smaller than 2Logn-1.
 
See Also
Cfft, Convolve, Filter, Fft