fftpack
Subroutines and functions
- subroutine cfftb(n, c, wsave)
! CFFTB computes the backward complex discrete Fourier transform.
Discussion:
This process is sometimes called Fourier synthesis.
CFFTB computes a complex periodic sequence from its Fourier coefficients.
A call of CFFTF followed by a call of CFFTB will multiply the sequence by N. In other words, the transforms are not normalized.
The array WSAVE must be initialized by CFFTI.
The transform is defined by:
- C_out(J) = sum ( 1 <= K <= N )
C_in(K) * exp ( sqrt ( - 1 ) * ( J - 1 ) * ( K - 1 ) * 2 * PI / N )
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the sequence to be transformed. The method is more efficient when N is the product of small primes.
Input/output, complex C(N). On input, C contains the sequence of Fourier coefficients. On output, C contains the sequence of data values that correspond to the input coefficients.
Input, real WSAVE(4*N+15). The array must be initialized by calling CFFTI. A different WSAVE array must be used for each different value of N.
- Parameters:
- Called from:
- Call to:
cfftb1(),passb4(),passb2(),passb3(),passb5(),passb(),cfftb(),cfftf1(),passf4(),passf2(),passf3(),passf5(),passf(),cfftf(),cffti1(),i_factor(),r_pi(),cosqb1(),rfftb(),cosqf1(),rfftf(),rffti(),r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),dsint1(),dvec_identity(),d_random(),ezffti1(),r_cas(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cfftb1(n, c, ch, wa, ifac)
! CFFTB1 is a lower-level routine used by CFFTB.
Modified:
12 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer N, the length of the sequence to be transformed.
Input/output, complex C(N). On input, C contains the sequence of Fourier coefficients. On output, C contains the sequence of data values that correspond to the input coefficients.
Input, complex CH(N).
Input, real WA(2*N).
Input, integer IFAC(15). IFAC(1) = N, the number that was factored. IFAC(2) = NF, the number of factors. IFAC(3:2+NF), the factors.
- Parameters:
- Called from:
- Call to:
passb4(),passb2(),passb3(),passb5(),passb(),cfftb(),cfftf1(),passf4(),passf2(),passf3(),passf5(),passf(),cfftf(),cffti1(),i_factor(),r_pi(),cosqb1(),rfftb(),cosqf1(),rfftf(),rffti(),r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),dsint1(),dvec_identity(),d_random(),ezffti1(),r_cas(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cfftb_2d(ldf, n, f, wsave)
! CFFTB_2D computes a backward two dimensional complex fast Fourier transform.
Discussion:
The routine computes the backward two dimensional fast Fourier transform, of a complex N by N matrix of data.
The output is unscaled, that is, a call to CFFTB_2D followed by a call to CFFTF_2D will return the original data multiplied by N*N.
For some applications it is desirable to have the transform scaled so the center of the N by N frequency square corresponds to zero frequency. The user can do this replacing the original input data F(I,J) by F(I,J) * (-1.)**(I+J), I,J =0,…,N-1.
Before calling CFFTF_2D or CFFTB_2D, it is necessary to initialize the array WSAVE by calling CFFTI.
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
Modified:
12 March 2001
Parameters:
Input, integer LDF, the leading dimension of the matrix.
Input, integer N, the number of rows and columns in the matrix.
Input/output, complex F(LDF,N), On input, an N by N array of complex values to be transformed. On output, the transformed values.
Input, real WSAVE(4*N+15), a work array whose values depend on N, and which must be initialized by calling CFFTI.
- Parameters:
- Call to:
cfftb(),cfftf1(),passf4(),passf2(),passf3(),passf5(),passf(),cfftf(),cffti1(),i_factor(),r_pi(),cosqb1(),rfftb(),cosqf1(),rfftf(),rffti(),r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),dsint1(),dvec_identity(),d_random(),ezffti1(),r_cas(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cfftf(n, c, wsave)
! CFFTF computes the forward complex discrete Fourier transform.
Discussion:
This process is sometimes called Fourier analysis.
CFFTF computes the Fourier coefficients of a complex periodic sequence.
The transform is not normalized. To obtain a normalized transform, the output must be divided by N. Otherwise a call of CFFTF followed by a call of CFFTB will multiply the sequence by N.
The array WSAVE must be initialized by calling CFFTI.
The transform is defined by:
- C_out(J) = sum ( 1 <= K <= N )
C_in(K) * exp ( - sqrt ( -1 ) * ( J - 1 ) * ( K - 1 ) * 2 * PI / N )
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the sequence to be transformed. The method is more efficient when N is the product of small primes.
Input/output, complex C(N). On input, the data sequence to be transformed. On output, the Fourier coefficients.
Input, real WSAVE(4*N+15). The array must be initialized by calling CFFTI. A different WSAVE array must be used for each different value of N.
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d()- Call to:
cfftf1(),passf4(),passf2(),passf3(),passf5(),passf(),cfftf(),cffti1(),i_factor(),r_pi(),cosqb1(),rfftb(),cosqf1(),rfftf(),rffti(),r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),dsint1(),dvec_identity(),d_random(),ezffti1(),r_cas(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cfftf1(n, c, ch, wa, ifac)
! CFFTF1 is a lower level routine used by CFFTF.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer N, the length of the sequence to be transformed.
Input/output, complex C(N). On input, the data sequence to be transformed. On output, the Fourier coefficients.
Input, complex CH(N).
Input, real WA(2*N).
Input, integer IFAC(15). IFAC(1) = N, the number that was factored. IFAC(2) = NF, the number of factors. IFAC(3:2+NF), the factors.
- Parameters:
- Called from:
- Call to:
passf4(),passf2(),passf3(),passf5(),passf(),cfftf(),cffti1(),i_factor(),r_pi(),cosqb1(),rfftb(),cosqf1(),rfftf(),rffti(),r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),dsint1(),dvec_identity(),d_random(),ezffti1(),r_cas(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cfftf_2d(ldf, n, f, wsave)
! CFFTF_2D computes a two dimensional complex fast Fourier transform.
Discussion:
The routine computes the forward two dimensional fast Fourier transform, of a complex N by N matrix of data.
The output is unscaled, that is, a call to CFFTF_2D, followed by a call to CFFTB_2D will return the original data multiplied by N*N.
For some applications it is desirable to have the transform scaled so the center of the N by N frequency square corresponds to zero frequency. The user can do this replacing the original input data F(I,J) by F(I,J) *(-1.)**(I+J), I,J =0,…,N-1.
Before calling CFFTF_2D or CFFTB_2D, it is necessary to initialize the array WSAVE by calling CFFTI.
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
Modified:
12 March 2001
Parameters:
Input, integer LDF, the leading dimension of the matrix.
Input, integer N, the number of rows and columns in the matrix.
Input/output, complex F(LDF,N), On input, an N by N array of complex values to be transformed. On output, the transformed values.
Input, real WSAVE(4*N+15), a work array whose values depend on N, and which must be initialized by calling CFFTI.
- Parameters:
- Call to:
cfftf(),cffti1(),i_factor(),r_pi(),cosqb1(),rfftb(),cosqf1(),rfftf(),rffti(),r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),dsint1(),dvec_identity(),d_random(),ezffti1(),r_cas(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cffti(n, wsave)
! CFFTI initializes WSAVE, used in CFFTF and CFFTB.
Discussion:
The prime factorization of N together with a tabulation of the trigonometric functions are computed and stored in WSAVE.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the sequence to be transformed.
Output, real WSAVE(4*N+15), contains data, dependent on the value of N, which is necessary for the CFFTF or CFFTB routines.
- Parameters:
n [integer,in]
wsave (15 + 4 * n) [real,out]
- Call to:
cffti1(),i_factor(),r_pi(),cosqb1(),rfftb(),cosqf1(),rfftf(),rffti(),r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),dsint1(),dvec_identity(),d_random(),ezffti1(),r_cas(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cffti1(n, wa, ifac)
! CFFTI1 is a lower level routine used by CFFTI.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer N, the length of the sequence to be transformed.
Input, real WA(2*N).
Input, integer IFAC(15). IFAC(1) = N, the number that was factored. IFAC(2) = NF, the number of factors. IFAC(3:2+NF), the factors.
- Parameters:
n [integer,in]
wa (2 * n) [real,out]
ifac (15) [integer,out]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti()- Call to:
i_factor(),r_pi(),cosqb1(),rfftb(),cosqf1(),rfftf(),rffti(),r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),dsint1(),dvec_identity(),d_random(),ezffti1(),r_cas(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cosqb(n, x, wsave)
! COSQB computes the fast cosine transform of quarter wave data.
Discussion:
COSQB computes a sequence from its representation in terms of a cosine series with odd wave numbers.
The transform is defined by:
X_out(I) = sum ( 1 <= K <= N )
4 * X_in(K) * cos ( ( 2 * K - 1 ) * ( I - 1 ) * PI / ( 2 * N ) )
COSQB is the unnormalized inverse of COSQF since a call of COSQB followed by a call of COSQF will multiply the input sequence X by 4*N.
The array WSAVE must be initialized by calling COSQI.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the array X. The method is more efficient when N is the product of small primes.
Input/output, real X(N). On input, the cosine series coefficients. On output, the corresponding data vector.
Input, real WSAVE(3*N+15), contains data, depending on N, and required by the algorithm. The WSAVE array must be initialized by calling COSQI. A different WSAVE array must be used for each different value of N.
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1(),rsct(),rsftb(),rsftf(),rsht(),rsst(),rsqctb(),rsqctf(),rsqstb(),rsqstf(),rvec_identity(),rvec_print_some(),rvec_random(),rvec_reverse(),sinqb()- Call to:
cosqb1(),rfftb(),cosqf1(),rfftf(),r_pi(),rffti(),r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),ezffti1(),r_cas(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cosqb1(n, x, w, xh)
! COSQB1 is a lower level routine used by COSQB.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer N, the length of the array.
Input/output, real X(N). On input, the cosine series coefficients. On output, the corresponding data vector.
Input, real W(N).
Input, real XH(2*N+15).
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb()- Call to:
rfftb(),cosqf1(),rfftf(),r_pi(),rffti(),r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),ezffti1(),r_cas(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cosqf(n, x, wsave)
! COSQF computes the fast cosine transform of quarter wave data.
Discussion:
COSQF computes the coefficients in a cosine series representation with only odd wave numbers.
COSQF is the unnormalized inverse of COSQB since a call of COSQF followed by a call of COSQB will multiply the input sequence X by 4*N.
The array WSAVE must be initialized by calling COSQI.
The transform is defined by:
X_out(I) = X_in(1) + sum ( 2 <= K <= N )
2 * X_in(K) * cos ( ( 2 * I - 1 ) * ( K - 1 ) * PI / ( 2 * N ) )
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the array X. The method is more efficient when N is the product of small primes.
Input/output, real X(N). On input, the data to be transformed. On output, the transformed data.
Input, real WSAVE(3*N+15), contains data, depending on N, and required by the algorithm. The WSAVE array must be initialized by calling COSQI. A different WSAVE array must be used for each different value of N.
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1(),rsct(),rsftb(),rsftf(),rsht(),rsst(),rsqctb(),rsqctf(),rsqstb(),rsqstf(),rvec_identity(),rvec_print_some(),rvec_random(),rvec_reverse(),sinqb(),sinqf()- Call to:
cosqf1(),rfftf(),r_pi(),rffti(),r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),ezffti1(),r_cas(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cosqf1(n, x, w, xh)
! COSQF1 is a lower level routine used by COSQF.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer N, the length of the array to be transformed.
Input/output, real X(N). On input, the data to be transformed. On output, the transformed data.
Input, real W(N).
Input, real XH(2*N+15).
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf()- Call to:
rfftf(),r_pi(),rffti(),r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),ezffti1(),r_cas(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cosqi(n, wsave)
! COSQI initializes WSAVE, used in COSQF and COSQB.
Discussion:
The prime factorization of N together with a tabulation of the trigonometric functions are computed and stored in WSAVE.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the array to be transformed. The method is more efficient when N is the product of small primes.
Output, real WSAVE(3*N+15), contains data, depending on N, and required by the COSQB and COSQF algorithms.
- Parameters:
n [integer,in]
wsave (15 + 3 * n) [real,out]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1(),rsct(),rsftb(),rsftf(),rsht(),rsst(),rsqctb(),rsqctf(),rsqstb(),rsqstf(),rvec_identity(),rvec_print_some(),rvec_random(),rvec_reverse(),sinqb(),sinqf(),sinqi()- Call to:
r_pi(),rffti(),r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_cas(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cvec_print_some(n, x, max_print, title)
! CVEC_PRINT_SOME prints some of a complex vector.
Discussion:
The user specifies MAX_PRINT, the maximum number of lines to print.
If N, the size of the vector, is no more than MAX_PRINT, then the entire vector is printed, one entry per line.
Otherwise, if possible, the first MAX_PRINT-2 entries are printed, followed by a line of periods suggesting an omission, and the last entry.
Modified:
17 December 2001
Author:
John Burkardt
Parameters:
Input, integer N, the number of entries of the vector.
Input, complex X(N), the vector to be printed.
Input, integer MAX_PRINT, the maximum number of lines to print.
Input, character ( len = * ) TITLE, an optional title.
- Parameters:
n [integer]
x (n) [complex]
max_print [integer]
title [character]
- Call to:
r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine cvec_random(alo, ahi, n, a)
! CVEC_RANDOM returns a random complex vector in a given range.
Modified:
08 March 2001
Author:
John Burkardt
Parameters:
Input, real ALO, AHI, the range allowed for the entries.
Input, integer N, the number of entries in the vector.
Output, complex A(N), the vector of randomly chosen values.
- Parameters:
alo [real]
ahi [real]
n [integer]
a (n) [complex]
- Call to:
r_random(),d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- function d_pi()
! D_PI returns the value of pi.
Modified:
07 January 2002
Author:
John Burkardt
Parameters:
Output, double precision D_PI, the value of PI.
- Return:
precision [double]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst()- Call to:
d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine d_random(dlo, dhi, d)
! D_RANDOM returns a random double precision value in a given range.
Modified:
19 December 2001
Author:
John Burkardt
Parameters:
Input, double precision DLO, DHI, the minimum and maximum values.
Output, double precision D, the randomly chosen value.
- Parameters:
precision [double]
precision
precision
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random()- Call to:
d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dadf2(ido, l1, cc, ch, wa1)
! DADF2 is a lower level routine used by DFFTF1.
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
ido [integer]
l1 [integer]
precision [double]
precision
precision
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1()- Call to:
d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dadf3(ido, l1, cc, ch, wa1, wa2)
! DADF3 is a lower level routine used by DFFTF1.
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
ido [integer]
l1 [integer]
precision [double]
precision
precision
precision
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1()- Call to:
d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dadf4(ido, l1, cc, ch, wa1, wa2, wa3)
! DADF4 is a lower level routine used by DFFTF1.
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
ido [integer]
l1 [integer]
precision [double]
precision
precision
precision
precision
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1()- Call to:
d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dadf5(ido, l1, cc, ch, wa1, wa2, wa3, wa4)
! DADF5 is a lower level routine used by DFFTF1.
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
ido [integer]
l1 [integer]
precision [double]
precision
precision
precision
precision
precision
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1()- Call to:
d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dadfg(ido, ip, l1, idl1, cc, c1, c2, ch, ch2, wa)
! DADFG is a lower level routine used by DFFTF1.
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
ido [integer]
ip [integer]
l1 [integer]
idl1 [integer]
precision [double]
precision
precision
precision
precision
precision
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1()- Call to:
d_pi(),dfftf(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dcost(n, x, wsave)
! DCOST computes the discrete Fourier cosine transform of an even sequence.
Discussion:
This routine is the unnormalized inverse of itself. Two successive calls will multiply the input sequence X by 2*(N-1).
The array WSAVE must be initialized by calling DCOSTI.
The transform is defined by:
X_out(I) = X_in(1) + (-1) **(I-1) * X_in(N) + sum ( 2 <= K <= N-1 )
2 * X_in(K) * cos ( ( K - 1 ) * ( I - 1 ) * PI / ( N - 1 ) )
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the sequence to be transformed. The method is more efficient when N-1 is the product of small primes.
Input/output, double precision X(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, double precision WSAVE(3*N+15). The WSAVE array must be initialized by calling DCOSTI. A different array must be used for each different value of N.
- Parameters:
n [integer]
precision [double]
precision
- Call to:
dfftf(),d_pi(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dcosti(n, wsave)
! DCOSTI initializes WSAVE, used in DCOST.
Discussion:
The prime factorization of N together with a tabulation of the trigonometric functions are computed and stored in WSAVE.
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the sequence to be transformed. The method is more efficient when N-1 is the product of small primes.
Output, double precision WSAVE(3*N+15), contains data, depending on N, and required by the DCOST algorithm.
- Parameters:
n [integer,in]
precision [double]
- Call to:
d_pi(),dffti(),dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),dsint1(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dfftf(n, r, wsave)
! DFFTF computes the Fourier coefficients of a real periodic sequence.
Discussion:
This process is sometimes called Fourier analysis.
The transform is unnormalized. A call to DFFTF followed by a call to DFFTB will multiply the input sequence by N.
The transform is defined by:
R_out(1) = sum ( 1 <= I <= N ) R_in(I)
Letting L = (N+1)/2, then for K = 2,…,L
R_out(2*K-2) = sum ( 1 <= I <= N )
R_in(I) * cos ( ( K - 1 ) * ( I - 1 ) * 2 * PI / N )
R_out(2*K-1) = sum ( 1 <= I <= N )
-R_in(I) * sin ( ( K - 1 ) * ( I - 1 ) * 2 * PI / N )
And, if N is even, then:
R_out(N) = sum ( 1 <= I <= N ) (-1)**(I-1) * R_in(I)
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the array to be transformed. The method is more efficient when N is the product of small primes.
Input/output, double precision R(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, double precision WSAVE(2*N+15), a work array. The WSAVE array must be initialized by calling DFFTI. A different WSAVE array must be used for each different value of N.
- Parameters:
n [integer]
precision [double]
precision
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost()- Call to:
dfftf1(),dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),d_pi(),dsint1(),dffti(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dfftf1(n, c, ch, wa, ifac)
! DFFTF1 is a lower level routine used by DFFTF and DSINT.
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer N, the length of the array to be transformed.
Input/output, double precision C(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, double precision CH(N).
Input, double precision WA(N).
Input, integer IFAC(15). IFAC(1) = N, the number that was factored. IFAC(2) = NF, the number of factors. IFAC(3:2+NF), the factors.
- Parameters:
n [integer]
precision [double]
precision
precision
ifac (15) [integer]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1()- Call to:
dadf4(),dadf2(),dadf3(),dadf5(),dadfg(),dffti1(),i_factor(),d_pi(),dsint1(),dfftf1(),dffti(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dffti(n, wsave)
! DFFTI initializes WSAVE, used in DFFTF and DFFTB.
Discussion:
The prime factorization of N together with a tabulation of the trigonometric functions are computed and stored in WSAVE.
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the sequence to be transformed.
Output, double precision WSAVE(2*N+15), contains data, dependent on the value of N, which is necessary for the DFFTF and DFFTB routines.
- Parameters:
n [integer,in]
precision [double]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti()- Call to:
dffti1(),i_factor(),d_pi(),dsint1(),dfftf1(),dffti(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dffti1(n, wa, ifac)
! DFFTI1 is a lower level routine used by DFFTI.
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer N, the length of the sequence to be transformed.
Input, double precision WA(N).
Input, integer IFAC(15). IFAC(1) = N, the number that was factored. IFAC(2) = NF, the number of factors. IFAC(3:2+NF), the factors.
- Parameters:
n [integer,in]
precision [double]
ifac (15) [integer,out]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti()- Call to:
i_factor(),d_pi(),dsint1(),dfftf1(),dffti(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dsct(n, x, y)
! DSCT computes a double precision “slow” cosine transform.
Discussion:
This routine is provided for illustration and testing. It is inefficient relative to optimized routines that use fast Fourier techniques.
Y(1) = Sum ( 1 <= J <= N ) X(J)
For I from 2 to N-1:
- Y(I) = 2 * Sum ( 1 <= J <= N ) X(J)
cos ( PI * ( I - 1 ) * ( J - 1 ) / ( N - 1 ) )
Y(N) = Sum ( X(1:N:2) ) - Sum ( X(2:N:2) )
Applying the routine twice in succession should yield the original data, multiplied by 2 * ( N + 1 ). This is a good check for correctness and accuracy.
Modified:
07 January 2002
Author:
John Burkardt
Parameters:
Input, integer N, the number of data values.
Input, double precision X(N), the data sequence.
Output, double precision Y(N), the transformed data.
- Parameters:
n [integer]
precision [double]
precision
- Call to:
d_pi(),dsint1(),dfftf1(),dffti(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),i_factor(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dsint(n, x, wsave)
! DSINT computes the discrete Fourier sine transform of an odd sequence.
Discussion:
This routine is the unnormalized inverse of itself since two successive calls will multiply the input sequence X by 2*(N+1).
The array WSAVE must be initialized by calling DSINTI.
The transform is defined by:
- X_out(I) = sum ( 1 <= K <= N )
2 * X_in(K) * sin ( K * I * PI / ( N + 1 ) )
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the sequence to be transformed. The method is most efficient when N+1 is the product of small primes.
Input/output, real X(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, double precision WSAVE((5*N+30)/2), a work array. The WSAVE array must be initialized by calling DSINTI. A different WSAVE array must be used for each different value of N.
- Parameters:
n [integer]
precision [double]
precision
- Call to:
dsint1(),dfftf1(),d_pi(),dffti(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),i_factor(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dsint1(n, war, was, xh, x, ifac)
! DSINT1 is a lower level routine used by DSINT.
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer N, the length of the sequence to be transformed.
Input/output, double precision WAR(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, double precision WAS(N/2).
Input, double precision XH(N).
Input, double precision X(N+1), ?.
Input, integer IFAC(15). IFAC(1) = N, the number that was factored. IFAC(2) = NF, the number of factors. IFAC(3:2+NF), the factors.
- Parameters:
n [integer]
precision [double]
precision
precision
precision
ifac (15) [integer]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint()- Call to:
dfftf1(),d_pi(),dffti(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),i_factor(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dsinti(n, wsave)
! DSINTI initializes WSAVE, used in DSINT.
Discussion:
The prime factorization of N together with a tabulation of the trigonometric functions are computed and stored in WSAVE.
Modified:
07 January 2002
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the sequence to be transformed. The method is most efficient when N+1 is a product of small primes.
Output, double precision WSAVE((5*N+30)/2), contains data, dependent on the value of N, which is necessary for the DSINT routine.
- Parameters:
n [integer,in]
precision [double]
- Call to:
d_pi(),dffti(),dvec_identity(),d_random(),rfftb(),rfftf(),ezffti1(),i_factor(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dsst(n, x, y)
! DSST computes a double precision “slow” sine transform.
Discussion:
This routine is provided for illustration and testing. It is inefficient relative to optimized routines that use fast Fourier techniques.
For I from 1 to N,
Y(I) = Sum ( 1 <= J <= N ) X(J) * sin ( PI * I * J / ( N + 1 ) )
Applying the routine twice in succession should yield the original data, multiplied by N / 2. This is a good check for correctness and accuracy.
Modified:
18 December 2001
Author:
John Burkardt
Parameters:
Input, integer N, the number of data values.
Input, double precision X(N), the data sequence.
Output, double precision Y(N), the transformed data.
- Parameters:
n [integer]
precision [double]
precision
- Call to:
dvec_identity(),d_pi(),d_random(),rfftb(),rfftf(),ezffti1(),i_factor(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dvec_identity(n, a)
! DVEC_IDENTITY sets a double precision vector to the identity vector A(I)=I.
Modified:
19 December 2001
Author:
John Burkardt
Parameters:
Input, integer N, the number of elements of A.
Output, double precision A(N), the array to be initialized.
- Parameters:
n [integer]
precision [double]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst()- Call to:
d_random(),rfftb(),rfftf(),ezffti1(),i_factor(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dvec_print_some(n, a, max_print, title)
! DVEC_PRINT_SOME prints “some” of a double precision vector.
Discussion:
The user specifies MAX_PRINT, the maximum number of lines to print.
If N, the size of the vector, is no more than MAX_PRINT, then the entire vector is printed, one entry per line.
Otherwise, if possible, the first MAX_PRINT-2 entries are printed, followed by a line of periods suggesting an omission, and the last entry.
Modified:
19 December 2001
Author:
John Burkardt
Parameters:
Input, integer N, the number of entries of the vector.
Input, double precision A(N), the vector to be printed.
Input, integer MAX_PRINT, the maximum number of lines to print.
Input, character ( len = * ) TITLE, an optional title.
- Parameters:
n [integer]
precision [double]
max_print [integer]
title [character]
- Call to:
d_random(),rfftb(),rfftf(),ezffti1(),i_factor(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine dvec_random(alo, ahi, n, a)
! DVEC_RANDOM returns a random double precision vector in a given range.
Modified:
19 December 2001
Author:
John Burkardt
Parameters:
Input, double precision ALO, AHI, the range allowed for the entries.
Input, integer N, the number of entries in the vector.
Output, double precision A(N), the vector of randomly chosen values.
- Parameters:
precision [double]
precision
n [integer]
precision
- Call to:
d_random(),rfftb(),rfftf(),ezffti1(),i_factor(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine ezfftb(n, r, azero, a, b, wsave)
! EZFFTB computes a real periodic sequence from its Fourier coefficients.
Discussion:
This process is sometimes called Fourier synthesis.
EZFFTB is a simplified but slower version of RFFTB.
The transform is defined by:
R(I) = AZERO + sum ( 1 <= K <= N/2 )
A(K) * cos ( K * ( I - 1 ) * 2 * PI / N )
B(K) * sin ( K * ( I - 1 ) * 2 * PI / N )
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the output array. The method is more efficient when N is the product of small primes.
Output, real R(N), the reconstructed data sequence.
Input, real AZERO, the constant Fourier coefficient.
Input, real A(N/2), B(N/2), the Fourier coefficients.
Input, real WSAVE(3*N+15), a work array. The WSAVE array must be initialized by calling EZFFFTI. A different WSAVE array must be used for each different value of N.
- Parameters:
- Call to:
rfftb(),rfftf(),ezffti1(),i_factor(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine ezfftf(n, r, azero, a, b, wsave)
! EZFFTF computes the Fourier coefficients of a real periodic sequence.
Discussion:
This process is sometimes called Fourier analysis.
EZFFTF is a simplified but slower version of RFFTF.
The transform is defined by:
AZERO = sum ( 1 <= I <= N ) R(I) / N,
and, for K = 1 to (N-1)/2,
- A(K) = sum ( 1 <= I <= N )
( 2 / N ) * R(I) * cos ( K * ( I - 1 ) * 2 * PI / N )
and, if N is even, then
A(N/2) = sum ( 1 <= I <= N ) (-1) **(I-1) * R(I) / N
For K = 1 to (N-1)/2,
- B(K) = sum ( 1 <= I <= N )
( 2 / N ) * R(I) * sin ( K * ( I - 1 ) * 2 * PI / N )
and, if N is even, then
B(N/2) = 0.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the array to be transformed. The method is more efficient when N is the product of small primes.
Input, real R(N), the sequence to be transformed.
Input, real WSAVE(3*N+15), a work array. The WSAVE array must be initialized by calling EZFFTI. A different WSAVE array must be used for each different value of N.
Output, real AZERO, the constant Fourier coefficient.
Output, real A(N/2), B(N/2), the Fourier coefficients.
- Parameters:
- Call to:
rfftf(),ezffti1(),i_factor(),r_pi(),r_cas(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine ezffti(n, wsave)
! EZFFTI initializes WSAVE, used in EZFFTF and EZFFTB.
Discussion:
The prime factorization of N together with a tabulation of the trigonometric functions are computed and stored in WSAVE.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the array to be transformed. The method is more efficient when N is the product of small primes.
Output, real WSAVE(3*N+15), contains data, dependent on the value of N, which is necessary for the EZFFTF or EZFFTB routines.
- Parameters:
n [integer,in]
wsave (15 + 3 * n) [real,out]
- Call to:
ezffti1(),i_factor(),r_pi(),r_cas(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine ezffti1(n, wa, ifac)
! EZFFTI1 is a lower level routine used by EZFFTI.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer N, the length of the array to be transformed.
Output, real WA(N).
Input, integer IFAC(15). IFAC(1) = N, the number that was factored. IFAC(2) = NF, the number of factors. IFAC(3:2+NF), the factors.
- Parameters:
n [integer,in]
wa (n) [real,out]
ifac (15) [integer,out]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti()- Call to:
i_factor(),r_pi(),r_cas(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine i_factor(n, ifac)
- Parameters:
n [integer,in]
ifac (15) [integer,out]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1()
- subroutine passb(nac, ido, ip, l1, idl1, cc, c1, c2, ch, ch2, wa)
- subroutine passb2(ido, l1, cc, ch, wa1)
- subroutine passb3(ido, l1, cc, ch, wa1, wa2)
- subroutine passb4(ido, l1, cc, ch, wa1, wa2, wa3)
- subroutine passb5(ido, l1, cc, ch, wa1, wa2, wa3, wa4)
- subroutine passf(nac, ido, ip, l1, idl1, cc, c1, c2, ch, ch2, wa)
- Parameters:
- Called from:
- subroutine passf2(ido, l1, cc, ch, wa1)
- subroutine passf3(ido, l1, cc, ch, wa1, wa2)
- subroutine passf4(ido, l1, cc, ch, wa1, wa2, wa3)
- subroutine passf5(ido, l1, cc, ch, wa1, wa2, wa3, wa4)
- function r_cas(x)
- Parameters:
x [real,in]
- Return:
r_cas [real]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1(),rsct(),rsftb(),rsftf(),rsht()
- function r_pi()
! R_PI returns the value of pi.
Modified:
08 May 2001
Author:
John Burkardt
Parameters:
Output, real R_PI, the value of PI.
- Return:
r_pi [real]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1(),rsct(),rsftb(),rsftf(),rsht(),rsst(),rsqctb(),rsqctf(),rsqstb(),rsqstf(),rvec_identity(),rvec_print_some(),rvec_random(),rvec_reverse(),sinqb(),sinqf(),sinqi(),rsint(),rsint1(),rsinti()- Call to:
r_pi(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine r_random(rlo, rhi, r)
! R_RANDOM returns a random real in a given range.
Modified:
06 April 2001
Author:
John Burkardt
Parameters:
Input, real RLO, RHI, the minimum and maximum values.
Output, real R, the randomly chosen value.
- Parameters:
rlo [real]
rhi [real]
r [real]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1(),rsct(),rsftb(),rsftf(),rsht(),rsst(),rsqctb(),rsqctf(),rsqstb(),rsqstf(),rvec_identity(),rvec_print_some(),rvec_random()- Call to:
r_pi(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine r_swap(x, y)
! R_SWAP swaps two real values.
Modified:
01 May 2000
Author:
John Burkardt
Parameters:
Input/output, real X, Y. On output, the values of X and Y have been interchanged.
- Parameters:
x [real]
y [real]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1(),rsct(),rsftb(),rsftf(),rsht(),rsst(),rsqctb(),rsqctf(),rsqstb(),rsqstf(),rvec_identity(),rvec_print_some(),rvec_random(),rvec_reverse()- Call to:
r_pi(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine radb2(ido, l1, cc, ch, wa1)
! RADB2 is a lower level routine used by RFFTB1.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1()- Call to:
r_pi(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine radb3(ido, l1, cc, ch, wa1, wa2)
! RADB3 is a lower level routine used by RFFTB1.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1()- Call to:
r_pi(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine radb4(ido, l1, cc, ch, wa1, wa2, wa3)
! RADB4 is a lower level routine used by RFFTB1.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1()- Call to:
r_pi(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine radb5(ido, l1, cc, ch, wa1, wa2, wa3, wa4)
! RADB5 is a lower level routine used by RFFTB1.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1()- Call to:
r_pi(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine radbg(ido, ip, l1, idl1, cc, c1, c2, ch, ch2, wa)
! RADBG is a lower level routine used by RFFTB1.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1()- Call to:
r_pi(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine radf2(ido, l1, cc, ch, wa1)
! RADF2 is a lower level routine used by RFFTF1.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1()- Call to:
r_pi(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine radf3(ido, l1, cc, ch, wa1, wa2)
! RADF3 is a lower level routine used by RFFTF1.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1()- Call to:
r_pi(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine radf4(ido, l1, cc, ch, wa1, wa2, wa3)
! RADF4 is a lower level routine used by RFFTF1.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1()- Call to:
r_pi(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine radf5(ido, l1, cc, ch, wa1, wa2, wa3, wa4)
! RADF5 is a lower level routine used by RFFTF1.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1()- Call to:
r_pi(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine radfg(ido, ip, l1, idl1, cc, c1, c2, ch, ch2, wa)
! RADFG is a lower level routine used by RFFTF1.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer IDO, ?
Input, integer IP, ?
Input, integer L1, ?
Input, integer IDL1, ?
?, real CC(IDO,IP,L1), ?
?, real C1(IDO,L1,IP), ?
?, real C2(IDL1,IP), ?
?, real CH(IDO,L1,IP), ?
?, real CH2(IDL1,IP), ?
?, real WA(*), ?
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1()- Call to:
r_pi(),rfftf(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine random_initialize(seed)
! RANDOM_INITIALIZE initializes the FORTRAN 90 random number seed.
Discussion:
If you don’t initialize the random number generator, its behavior is not specified. If you initialize it simply by:
call random_seed
its behavior is not specified. On the DEC ALPHA, if that’s all you do, the same random number sequence is returned. In order to actually try to scramble up the random number generator a bit, this routine goes through the tedious process of getting the size of the random number seed, making up values based on the current time, and setting the random number seed.
Modified:
19 December 2001
Author:
John Burkardt
Parameters:
Input/output, integer SEED. If SEED is zero on input, then you’re asking this routine to come up with a seed value, which is returned as output. If SEED is nonzero on input, then you’re asking this routine to use the input value of SEED to initialize the random number generator, and SEED is not changed on output.
- Parameters:
seed [integer]
- Call to:
rfftf(),r_pi(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine rcost(n, x, wsave)
! RCOST computes the discrete Fourier cosine transform of an even sequence.
Discussion:
This routine is the unnormalized inverse of itself. Two successive calls will multiply the input sequence X by 2*(N-1).
The array WSAVE must be initialized by calling RCOSTI.
The transform is defined by:
X_out(I) = X_in(1) + (-1) **(I-1) * X_in(N) + sum ( 2 <= K <= N-1 )
2 * X_in(K) * cos ( ( K - 1 ) * ( I - 1 ) * PI / ( N - 1 ) )
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the sequence to be transformed. The method is more efficient when N-1 is the product of small primes.
Input/output, real X(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, real WSAVE(3*N+15). The WSAVE array must be initialized by calling RCOSTI. A different array must be used for each different value of N.
- subroutine rcosti(n, wsave)
! RCOSTI initializes WSAVE, used in RCOST.
Discussion:
The prime factorization of N together with a tabulation of the trigonometric functions are computed and stored in WSAVE.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the sequence to be transformed. The method is more efficient when N-1 is the product of small primes.
Output, real WSAVE(3*N+15), contains data, depending on N, and required by the RCOST algorithm.
- Options:
n [integer,optional/default=(-15 + shape(wsave, 0)) / 3]
- Parameters:
wsave (15 + 3 * n) [real]
- Call to:
r_pi(),rffti(),rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),uniform_01_sample()
- subroutine rfftb(n, r, wsave)
! RFFTB computes a real periodic sequence from its Fourier coefficients.
Discussion:
This process is sometimes called Fourier synthesis.
The transform is unnormalized. A call to RFFTF followed by a call to RFFTB will multiply the input sequence by N.
If N is even, the transform is defined by:
R_out(I) = R_in(1) + (-1)**(I-1) * R_in(N) + sum ( 2 <= K <= N/2 )
2 * R_in(2*K-2) * cos ( ( K - 1 ) * ( I - 1 ) * 2 * PI / N )
2 * R_in(2*K-1) * sin ( ( K - 1 ) * ( I - 1 ) * 2 * PI / N )
If N is odd, the transform is defined by:
R_out(I) = R_in(1) + sum ( 2 <= K <= (N+1)/2 )
2 * R_in(2*K-2) * cos ( ( K - 1 ) * ( I - 1 ) * 2 * PI / N )
2 * R_in(2*K-1) * sin ( ( K - 1 ) * ( I - 1 ) * 2 * PI / N )
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the array to be transformed. The method is more efficient when N is the product of small primes.
Input/output, real R(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, real WSAVE(2*N+15), a work array. The WSAVE array must be initialized by calling RFFTI. A different WSAVE array must be used for each different value of N.
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb()- Call to:
rfftb1(),radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_pi(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rffti(),uniform_01_sample()
- subroutine rfftb1(n, c, ch, wa, ifac)
! RFFTB1 is a lower level routine used by RFFTB.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer N, the length of the array to be transformed.
Input/output, real C(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, real CH(N).
Input, real WA(N).
Input, integer IFAC(15). IFAC(1) = N, the number that was factored. IFAC(2) = NF, the number of factors. IFAC(3:2+NF), the factors.
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb()- Call to:
radb4(),radb2(),radb3(),radb5(),radbg(),rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_pi(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rffti(),uniform_01_sample()
- subroutine rfftf(n, r, wsave)
! RFFTF computes the Fourier coefficients of a real periodic sequence.
Discussion:
This process is sometimes called Fourier analysis.
The transform is unnormalized. A call to RFFTF followed by a call to RFFTB will multiply the input sequence by N.
The transform is defined by:
R_out(1) = sum ( 1 <= I <= N ) R_in(I)
Letting L = (N+1)/2, then for K = 2,…,L
R_out(2*K-2) = sum ( 1 <= I <= N )
R_in(I) * cos ( ( K - 1 ) * ( I - 1 ) * 2 * PI / N )
R_out(2*K-1) = sum ( 1 <= I <= N )
-R_in(I) * sin ( ( K - 1 ) * ( I - 1 ) * 2 * PI / N )
And, if N is even, then:
R_out(N) = sum ( 1 <= I <= N ) (-1)**(I-1) * R_in(I)
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the array to be transformed. The method is more efficient when N is the product of small primes.
Input/output, real R(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, real WSAVE(2*N+15), a work array. The WSAVE array must be initialized by calling RFFTI. A different WSAVE array must be used for each different value of N.
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost()- Call to:
rfftf1(),radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_pi(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rffti(),uniform_01_sample()
- subroutine rfftf1(n, c, ch, wa, ifac)
! RFFTF1 is a lower level routine used by RFFTF and RSINT.
Modified:
12 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer N, the length of the array to be transformed.
Input/output, real C(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, real CH(N).
Input, real WA(N).
Input, integer IFAC(15). IFAC(1) = N, the number that was factored. IFAC(2) = NF, the number of factors. IFAC(3:2+NF), the factors.
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1(),rsct(),rsftb(),rsftf(),rsht(),rsst(),rsqctb(),rsqctf(),rsqstb(),rsqstf(),rvec_identity(),rvec_print_some(),rvec_random(),rvec_reverse(),sinqb(),sinqf(),sinqi(),rsint(),rsint1()- Call to:
radf4(),radf2(),radf3(),radf5(),radfg(),rffti1(),i_factor(),r_pi(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),rffti(),uniform_01_sample()
- subroutine rffti(n, wsave)
! RFFTI initializes WSAVE, used in RFFTF and RFFTB.
Discussion:
The prime factorization of N together with a tabulation of the trigonometric functions are computed and stored in WSAVE.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the sequence to be transformed.
Output, real WSAVE(2*N+15), contains data, dependent on the value of N, which is necessary for the RFFTF and RFFTB routines.
- Parameters:
n [integer,in]
wsave (15 + 2 * n) [real,out]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1(),rsct(),rsftb(),rsftf(),rsht(),rsst(),rsqctb(),rsqctf(),rsqstb(),rsqstf(),rvec_identity(),rvec_print_some(),rvec_random(),rvec_reverse(),sinqb(),sinqf(),sinqi(),rsint(),rsint1(),rsinti()- Call to:
rffti1(),i_factor(),r_pi(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),rffti(),uniform_01_sample()
- subroutine rffti1(n, wa, ifac)
! RFFTI1 is a lower level routine used by RFFTI.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer N, the length of the sequence to be transformed.
Input, real WA(N).
Input, integer IFAC(15). IFAC(1) = N, the number that was factored. IFAC(2) = NF, the number of factors. IFAC(3:2+NF), the factors.
- Parameters:
n [integer,in]
wa (n) [real,out]
ifac (15) [integer,out]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti()- Call to:
i_factor(),r_pi(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),rffti(),uniform_01_sample()
- subroutine rsct(n, x, y)
! RSCT computes a real “slow” cosine transform.
Discussion:
This routine is provided for illustration and testing. It is inefficient relative to optimized routines that use fast Fourier techniques.
Y(1) = Sum ( 1 <= J <= N ) X(J)
For I from 2 to N-1:
- Y(I) = 2 * Sum ( 1 <= J <= N ) X(J)
cos ( PI * ( I - 1 ) * ( J - 1 ) / ( N - 1 ) )
Y(N) = Sum ( X(1:N:2) ) - Sum ( X(2:N:2) )
Applying the routine twice in succession should yield the original data, multiplied by 2 * ( N + 1 ). This is a good check for correctness and accuracy.
Modified:
07 January 2002
Author:
John Burkardt
Parameters:
Input, integer N, the number of data values.
Input, real X(N), the data sequence.
Output, real Y(N), the transformed data.
- Parameters:
- Call to:
r_pi(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),rffti(),uniform_01_sample()
- subroutine rsftb(n, r, azero, a, b)
! RSFTB computes a “slow” backward Fourier transform of real data.
Modified:
13 March 2001
Author:
John Burkardt
Parameters:
Input, integer N, the number of data values.
Output, real R(N), the reconstructed data sequence.
Input, real AZERO, the constant Fourier coefficient.
Input, real A(N/2), B(N/2), the Fourier coefficients.
- Parameters:
- Call to:
r_pi(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),rffti(),uniform_01_sample()
- subroutine rsftf(n, r, azero, a, b)
! RSFTF computes a “slow” forward Fourier transform of real data.
Modified:
13 March 2001
Parameters:
Input, integer N, the number of data values.
Input, real R(N), the data to be transformed.
Output, real AZERO, = sum ( 1 <= I <= N ) R(I) / N.
Output, real A(N/2), B(N/2), the Fourier coefficients.
- Parameters:
- Call to:
r_pi(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),rffti(),uniform_01_sample()
- subroutine rsht(n, a, b)
! RSHT computes a “slow” Hartley transform of real data.
Discussion:
The discrete Hartley transform B of a set of data A is
B(I) = 1/sqrt(N) * Sum ( 0 <= J <= N-1 ) A(J) * CAS(2*PI*I*J/N)
Here, the data and coefficients are indexed from 0 to N-1.
With the above normalization factor of 1/sqrt(N), the Hartley transform is its own inverse.
This routine is provided for illustration and testing. It is inefficient relative to optimized routines.
Modified:
06 January 2002
Author:
John Burkardt
Parameters:
Input, integer N, the number of data values.
Input, real A(0:N-1), the data to be transformed.
Output, real B(0:N-1), the transformed data.
- Parameters:
- Call to:
r_pi(),r_cas(),rvec_identity(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),rffti(),uniform_01_sample()
- subroutine rsst(n, x, y)
! RSST computes a real “slow” sine transform.
Discussion:
This routine is provided for illustration and testing. It is inefficient relative to optimized routines that use fast Fourier techniques.
For I from 1 to N,
Y(I) = Sum ( 1 <= J <= N ) X(J) * sin ( PI * I * J / ( N + 1 ) )
Applying the routine twice in succession should yield the original data, multiplied by N / 2. This is a good check for correctness and accuracy.
Modified:
18 December 2001
Author:
John Burkardt
Parameters:
Input, integer N, the number of data values.
Input, real X(N), the data sequence.
Output, real Y(N), the transformed data.
- Parameters:
- Call to:
rvec_identity(),r_pi(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),rffti(),uniform_01_sample()
- subroutine rsqctb(n, x, y)
! RSQCTB computes a real “slow” quarter cosine transform backward.
Discussion:
This routine is provided for illustration and testing. It is inefficient relative to optimized routines that use fast Fourier techniques.
For I from 0 to N-1,
Y(I) = X(0) + 2 Sum ( 1 <= J <= N-1 ) X(J) * cos ( PI * J * (I+1/2) / N )
Reference:
Briggs and Henson, The Discrete Fourier Transform, SIAM, QA403.5 B75
Modified:
21 January 2002
Author:
John Burkardt
Parameters:
Input, integer N, the number of data values.
Input, real X(0:N-1), the data sequence.
Output, real Y(0:N-1), the transformed data.
- Parameters:
- Call to:
r_pi(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),rffti(),uniform_01_sample()
- subroutine rsqctf(n, x, y)
! RSQCTF computes a real “slow” quarter cosine transform forward.
Discussion:
This routine is provided for illustration and testing. It is inefficient relative to optimized routines that use fast Fourier techniques.
For I from 0 to N-1,
Y(I) = (1/N) Sum ( 0 <= J <= N-1 ) X(J) * cos ( PI * I * (J+1/2) / N )
Modified:
07 January 2002
Author:
John Burkardt
Reference:
Briggs and Henson, The Discrete Fourier Transform, SIAM, QA403.5 B75
Parameters:
Input, integer N, the number of data values.
Input, real X(0:N-1), the data sequence.
Output, real Y(0:N-1), the transformed data.
- Parameters:
- Call to:
r_pi(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),rffti(),uniform_01_sample()
- subroutine rsqstb(n, x, y)
! RSQSTB computes a real “slow” quarter sine transform backward.
Discussion:
This routine is provided for illustration and testing. It is inefficient relative to optimized routines that use fast Fourier techniques.
For I from 0 to N-1,
- Y(I) = -2 Sum ( 1 <= J <= N-1 ) X(J) * sin ( PI * J * (I+1/2) / N )
X(N) * cos ( pi * I )
Modified:
21 January 2002
Author:
John Burkardt
Reference:
Briggs and Henson, The Discrete Fourier Transform, SIAM, QA403.5 B75
Parameters:
Input, integer N, the number of data values.
Input, real X(N), the data sequence.
Output, real Y(0:N-1), the transformed data.
- Parameters:
- Call to:
r_pi(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),rffti(),uniform_01_sample()
- subroutine rsqstf(n, x, y)
! RSQSTF computes a real “slow” quarter sine transform forward.
Discussion:
This routine is provided for illustration and testing. It is inefficient relative to optimized routines that use fast Fourier techniques.
For I from 1 to N,
Y(I) = -(1/N) Sum ( 0 <= J <= N-1 ) X(J) * sin ( PI * I * (J+1/2) / N )
Modified:
06 January 2002
Author:
John Burkardt
Reference:
Briggs and Henson, The Discrete Fourier Transform, SIAM, QA403.5 B75
Parameters:
Input, integer N, the number of data values.
Input, real X(0:N-1), the data sequence.
Output, real Y(N), the transformed data.
- Parameters:
- Call to:
r_pi(),r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),rffti(),uniform_01_sample()
- subroutine rvec_identity(n, a)
! RVEC_IDENTITY sets a real vector to the identity vector A(I)=I.
Modified:
09 February 2001
Author:
John Burkardt
Parameters:
Input, integer N, the number of elements of A.
Output, real A(N), the array to be initialized.
- Parameters:
n [integer]
a (n) [real]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1(),rsct(),rsftb(),rsftf(),rsht(),rsst()- Call to:
r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),r_pi(),rffti(),uniform_01_sample()
- subroutine rvec_print_some(n, a, max_print, title)
! RVEC_PRINT_SOME prints “some” of a real vector.
Discussion:
The user specifies MAX_PRINT, the maximum number of lines to print.
If N, the size of the vector, is no more than MAX_PRINT, then the entire vector is printed, one entry per line.
Otherwise, if possible, the first MAX_PRINT-2 entries are printed, followed by a line of periods suggesting an omission, and the last entry.
Modified:
10 September 1999
Author:
John Burkardt
Parameters:
Input, integer N, the number of entries of the vector.
Input, real A(N), the vector to be printed.
Input, integer MAX_PRINT, the maximum number of lines to print.
Input, character ( len = * ) TITLE, an optional title.
- Parameters:
n [integer]
a (n) [real]
max_print [integer]
title [character]
- Call to:
r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),r_pi(),rffti(),uniform_01_sample()
- subroutine rvec_random(alo, ahi, n, a)
! RVEC_RANDOM returns a random real vector in a given range.
Modified:
04 February 2001
Author:
John Burkardt
Parameters:
Input, real ALO, AHI, the range allowed for the entries.
Input, integer N, the number of entries in the vector.
Output, real A(N), the vector of randomly chosen values.
- Parameters:
alo [real]
ahi [real]
n [integer]
a (n) [real]
- Call to:
r_random(),r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),r_pi(),rffti(),uniform_01_sample()
- subroutine rvec_reverse(n, a)
! RVEC_REVERSE reverses the elements of a real vector.
Example:
Input:
N = 5, A = ( 11.0, 12.0, 13.0, 14.0, 15.0 ).
Output:
A = ( 15.0, 14.0, 13.0, 12.0, 11.0 ).
Modified:
06 October 1998
Author:
John Burkardt
Parameters:
Input, integer N, the number of entries in the array.
Input/output, real A(N), the array to be reversed.
- Parameters:
n [integer]
a (n) [real]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1(),rsct(),rsftb(),rsftf(),rsht(),rsst(),rsqctb(),rsqctf(),rsqstb(),rsqstf(),rvec_identity(),rvec_print_some(),rvec_random(),rvec_reverse(),sinqb(),sinqf()- Call to:
r_swap(),cosqb(),rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),r_pi(),rffti(),uniform_01_sample()
- subroutine sinqb(n, x, wsave)
! SINQB computes the fast sine transform of quarter wave data.
Discussion:
SINQB computes a sequence from its representation in terms of a sine series with odd wave numbers.
SINQF is the unnormalized inverse of SINQB since a call of SINQB followed by a call of SINQF will multiply the input sequence X by 4*N.
The array WSAVE must be initialized by calling SINQI.
The transform is defined by:
X_out(I) = sum ( 1 <= K <= N )
4 * X_in(K) * sin ( ( 2 * K - 1 ) * I * PI / ( 2 * N ) )
Modified:
12 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the array to be transformed. The method is more efficient when N is the product of small primes.
Input/output, real X(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, real WSAVE(3*N+15), a work array. The WSAVE array must be initialized by calling SINQI. A different WSAVE array must be used for each different value of N.
- subroutine sinqf(n, x, wsave)
! SINQF computes the fast sine transform of quarter wave data.
Discussion:
SINQF computes the coefficients in a sine series representation with only odd wave numbers.
SINQB is the unnormalized inverse of SINQF since a call of SINQF followed by a call of SINQB will multiply the input sequence X by 4*N.
The array WSAVE, which is used by SINQF, must be initialized by calling SINQI.
The transform is defined by:
- X_out(I) = (-1)**(I-1) * X_in(N) + sum ( 1 <= K <= N-1 )
2 * X_in(K) * sin ( ( 2 * I - 1 ) * K * PI / ( 2 * N ) )
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the array to be transformed. The method is more efficient when N is the product of small primes.
Input/output, real X(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, real WSAVE(3*N+15), a work array. The WSAVE array must be initialized by calling SINQI. A different WSAVE array must be used for each different value of N.
- Parameters:
- Call to:
rvec_reverse(),cosqf(),cosqi(),rsint1(),rfftf1(),r_pi(),rffti(),uniform_01_sample()
- subroutine sinqi(n, wsave)
! SINQI initializes WSAVE, used in SINQF and SINQB.
Discussion:
The prime factorization of N together with a tabulation of the trigonometric functions are computed and stored in WSAVE.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the array to be transformed.
Output, real WSAVE(3*N+15), contains data, dependent on the value of N, which is necessary for the SINQF or SINQB routines.
- subroutine rsint(n, x, wsave)
! RSINT computes the discrete Fourier sine transform of an odd sequence.
Discussion:
This routine is the unnormalized inverse of itself since two successive calls will multiply the input sequence X by 2*(N+1).
The array WSAVE must be initialized by calling RSINTI.
The transform is defined by:
- X_out(I) = sum ( 1 <= K <= N )
2 * X_in(K) * sin ( K * I * PI / ( N + 1 ) )
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the sequence to be transformed. The method is most efficient when N+1 is the product of small primes.
Input/output, real X(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, real WSAVE((5*N+30)/2), a work array. The WSAVE array must be initialized by calling RSINTI. A different WSAVE array must be used for each different value of N.
- subroutine rsint1(n, war, was, xh, x, ifac)
! RSINT1 is a lower level routine used by RSINT.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Parameters:
Input, integer N, the length of the sequence to be transformed.
Input/output, real WAR(N). On input, the sequence to be transformed. On output, the transformed sequence.
Input, real WAS(N/2).
Input, real XH(N).
Input, real X(N+1), ?.
Input, integer IFAC(15). IFAC(1) = N, the number that was factored. IFAC(2) = NF, the number of factors. IFAC(3:2+NF), the factors.
- Parameters:
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1(),rsct(),rsftb(),rsftf(),rsht(),rsst(),rsqctb(),rsqctf(),rsqstb(),rsqstf(),rvec_identity(),rvec_print_some(),rvec_random(),rvec_reverse(),sinqb(),sinqf(),sinqi(),rsint()- Call to:
- subroutine rsinti(n, wsave)
! RSINTI initializes WSAVE, used in RSINT.
Discussion:
The prime factorization of N together with a tabulation of the trigonometric functions are computed and stored in WSAVE.
Modified:
09 March 2001
Author:
Paul Swarztrauber, National Center for Atmospheric Research
Reference:
David Kahaner, Clever Moler, Steven Nash, Numerical Methods and Software, Prentice Hall, 1988.
P N Swarztrauber, Vectorizing the FFT’s, in Parallel Computations, G. Rodrigue, editor, Academic Press, 1982, pages 51-83.
B L Buzbee, The SLATEC Common Math Library, in Sources and Development of Mathematical Software, W. Cowell, editor, Prentice Hall, 1984, pages 302-318.
Parameters:
Input, integer N, the length of the sequence to be transformed. The method is most efficient when N+1 is a product of small primes.
Output, real WSAVE((5*N+30)/2), contains data, dependent on the value of N, which is necessary for the RSINT routine.
- Options:
n [integer,optional/default=(-15 + shape(wsave, 0)) / (-15 + 35 * 1/(2))]
- Parameters:
wsave (30 + 5 * n) / 2) [real]
- Call to:
- subroutine timestamp()
! TIMESTAMP prints the current YMDHMS date as a time stamp.
Example:
May 31 2001 9:45:54.872 AM
Modified:
31 May 2001
Author:
John Burkardt
Parameters:
None
- Call to:
- function uniform_01_sample(iseed)
! UNIFORM_01_SAMPLE is a portable random number generator.
Formula:
ISEED = ISEED * (7**5) mod (2**31 - 1) RANDOM = ISEED * / ( 2**31 - 1 )
Modified:
01 March 1999
Parameters:
Input/output, integer ISEED, the integer “seed” used to generate the output random number, and updated in preparation for the next one. ISEED should not be zero.
Output, real UNIFORM_01_SAMPLE, a random value between 0 and 1.
Local parameters:
IA = 7**5 IB = 2**15 IB16 = 2**16 IP = 2**31-1
- Parameters:
iseed [integer]
- Return:
uniform_01_sample [real]
- Called from:
cfftb(),cfftb1(),cfftb_2d(),cfftf(),cfftf1(),cfftf_2d(),cffti(),cffti1(),cosqb(),cosqb1(),cosqf(),cosqf1(),cosqi(),cvec_print_some(),cvec_random(),d_pi(),d_random(),dadf2(),dadf3(),dadf4(),dadf5(),dadfg(),dcost(),dcosti(),dfftf(),dfftf1(),dffti(),dffti1(),dsct(),dsint(),dsint1(),dsinti(),dsst(),dvec_identity(),dvec_print_some(),dvec_random(),ezfftb(),ezfftf(),ezffti(),ezffti1(),r_pi(),r_random(),r_swap(),radb2(),radb3(),radb4(),radb5(),radbg(),radf2(),radf3(),radf4(),radf5(),radfg(),random_initialize(),rcost(),rcosti(),rfftb(),rfftb1(),rfftf(),rfftf1(),rffti(),rffti1(),rsct(),rsftb(),rsftf(),rsht(),rsst(),rsqctb(),rsqctf(),rsqstb(),rsqstf(),rvec_identity(),rvec_print_some(),rvec_random(),rvec_reverse(),sinqb(),sinqf(),sinqi(),rsint(),rsint1(),rsinti(),timestamp()