fft2.f
来自「Fortran的数学物理方程数值算法源程序。这是"Numerical Metho」· F 代码 · 共 47 行
F
47 行
subroutine fft2( A, N, MAXN ) integer*4 N, MAXN complex*16 A(MAXN,MAXN)! Routine to compute two dimensional Fourier transform! using FFT algorithm! Inputs! A Complex input data array! N Elements transformed are A(1,1) to A(N,N)! MAXN Array dimensioned as A(MAXN,MAXN)! Outputs! A Complex transform of data integer*4 MAXNT parameter( MAXNT = 2048 ) integer*4 i, j complex*16 T(MAXNT) ! Temporary work vector !* Loop over the columns of the matrix do j=1,N !* Copy out a column into a vector do i=1,N T(i) = A(i,j) enddo !* Take FFT of the vector call fft(T,N) !* Copy the transformed vector back into the column do i=1,N A(i,j) = T(i) enddo enddo !* Loop over the rows of the matrix do i=1,N !* Copy out a row into a vector do j=1,N T(j) = A(i,j) enddo !* Take FFT of the vector call fft(T,N) !* Copy the transformed vector back into the row do j=1,N A(i,j) = T(j) enddo enddo return end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?