SFCT(3dxml) — Subroutines
Name
sfct, dfct − Fast cosine transform in one dimension
FORMAT
status = {S,D}FCT (direction, in, out, n, type, stride)
Arguments
directioncharacter∗(∗)
Specifies the operation as either the forward or inverse transform. Use Use ’B’ or
in, out
real∗4 | real∗8
Both the arguments are one-dimensional arrays. The input and output arrays can be the same array. The IN array contains the data to be transformed. The OUT array contains the transformed data. For type-I FCT, the length of the IN,OUT array must must be
ninteger∗4
Specifies the size of the transform. The minimum size of the IN, OUT array is n; where n
and even.
typeinteger∗4
Specifies the type of the Cosine transform desired. Currently only type-1 and type-2 transforms are supported.
strideinteger∗4
Specifies the distance between consecutive elements in the IN and OUT arrays. The distance must be at least 1.
Description
The _FCT functions compute the fast Cosine transform of one-dimensional data in one step.
Return Values
0DXML_SUCCESS()
4DXML_ILL_N_IS_ODD()
8DXML_ILL_N_RANGE()
12DXML_INS_RES()
13DXML_BAD_STRIDE()
15DXML_BAD_DIRECTION_STRING()
17DXML_OPTION_NOT_SUPPORTED()
Example
INTEGER∗4 N
PARAMETER (N=1024)
INCLUDE ’{file_location}DXMLDEF.FOR’
INTEGER∗4 STATUS
REAL∗8 C(0:N),D(0:N)
REAL∗4 E(1:N-1),F(1:N-1)
STATUS = DFCT(’F’,C,D,N,1,1)
STATUS = DFCT(’B’,D,C,N,1,1)
STATUS = SFCT(’F’,E,F,N,2,1)
STATUS = SFCT(’B’,F,E,N,2,1)
This FORTRAN code computes the following:
•Forward Type-1 Cosine transform of the real sequence C to real sequence D.
•Backward Type-1 Cosine transform of the real sequence D to real sequence C.
•Forward Type-2 Cosine transform of the real sequence E to real sequence F.
•Backward Type-2 Cosine transform of the real sequence F to real sequence E.