⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ifft.cpp

📁 c++的数学物理方程数值算法源程序。这是"Numerical Methods for Physics"第二版的源程序。
💻 CPP
字号:
#include "NumMeth.h"void fft( Matrix& RealA, Matrix& ImagA);void ifft( Matrix& RealA, Matrix& ImagA) {// Routine to compute inverse Fourier transform using FFT algorithm// Inputs//    RealA, ImagA         Real and imaginary parts of transform// Outputs//    RealA, ImagA         Real and imaginary parts of time series  int i, N = RealA.nRow();   // Number of data points

  //* Take complex conjugate of input transform  for( i=1; i<=N; i++ )    ImagA(i) *= -1.0;        // Complex conjugate
  //* Evaluate fast fourier transform    fft( RealA, ImagA );         
  //* Take complex conjugate and normalize by N  double invN = 1.0/N;  for( i=1; i<=N; i++ ) {    RealA(i) *= invN;    ImagA(i) *= -invN;    // Normalize and complex conjugate  }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -