总结:
1.离散傅里叶变换DFT
2.快速傅里叶变换FFT
2.1 基2FFT算法
2.2 例:时间抽选基2FFT算法
2.3 以N=8举例说明蝶形运算
2.4 码位倒置伪算法
3. C#代码解读
4. 参考:
1.离散傅里叶变换DFT
2.快速傅里叶变换FFT
3. C#代码解读
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace FFT_Prj
{
public class Complex
{
//实部Re 虚部Im
public double Re;
public double Im;
public Complex()
{
Re = 0;
Im = 0;
}
public Complex(double re)
{
Re = re;
Im = 0;
}
public Complex(double re, double im)
{
Re = re;
Im = im;
}
//求幅值
public double Modulus()
{
return Math.Sqrt(Re * Re + Im * Im);
}
public override string ToString()
{
string retStr;
if (Math.Abs(Im) < 0.0001)
{
retStr = Re.ToString("f4");
}
else if (Math.Abs(Re) < 0.0001)
{
if (Im > 0)
retStr = "j" + Im.ToString("f4");
else
retStr = "- j" + (0 - Im).ToString("f4");
}
else
{
if (Im > 0)
retStr = Re.ToString("f4") + "+ j" + Im.ToString("f4");
else
retStr = Re.ToString("f4") + "- j" + (0 - Im).ToString("f4");
}
retStr += " ";
return retStr;
}
//操作符重载
public static Complex operator +(Complex c1, Complex c2)
{
return new Complex(c1.Re + c2.Re, c1.Im + c2.Im);
}
public static Complex operator +(double d, Complex c)
{
return new Complex(d + c.Re, c.Im);
}
public static Complex operator -(Complex c1, Complex c2)
{
return new Complex(c1.Re - c2.Re, c1.Im - c2.Im);
}
public static Complex operator -(double d, Complex c)
{
return