status = {S,D}FCT_APPLY (direction, in, out, fct_struct, stride)
direction character*(*) 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. fct_struct record /dxml_s_fct_structure/ for single-precision operations record /dxml_d_fct_structure/ for double-precision operations stride integer*4 Specifies the distance between consecutive elements in the input and output arrays, depending on the value of stride_1_flag provided in the _INIT function.
The _FCT_APPLY functions compute the fast Cosine transform of one- dimensional data in three steps.
0 DXML_SUCCESS() 12 DXML_INS_RES() 13 DXML_BAD_STRIDE() 15 DXML_BAD_DIRECTION_STRING() 17 DXML_OPTION_NOT_SUPPORTED()
INTEGER*4 N PARAMETER (N=1024) INCLUDE 'CXMLDEF.FOR' INTEGER*4 STATUS RECORD /CXML_S_FCT_STRUCTURE/ D_FCT_STRUCT RECORD /CXML_D_FCT_STRUCTURE/ D_FCT_STRUCT REAL*8 C(0:N),D(0:N) REAL*4 E(0:N-1),F(0:N-1) STATUS = DFCT_INIT(N,D_FCT_STRUCT,1,.TRUE.) STATUS = DFCT_APPLY('F',C,D,D_FCT_STRUCT,1) STATUS = DFCT_APPLY('B',D,C,D_FCT_STRUCT,1) STATUS = DFCT_EXIT(D_FCT_STRUCT) STATUS = SFCT_INIT(N,S_FCT_STRUCT,2,.TRUE.) STATUS = SFCT_APPLY('F',E,F,S_FCT_STRUCT,1) STATUS = SFCT_APPLY('B',F,E,S_FCT_STRUCT,1) STATUS = SFCT_EXIT(D_FCT_STRUCT) 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.