C++实现FFT中的DIT

本文介绍了如何在C++中实现快速傅里叶变换(FFT)的直接分频法(DIT)算法,以8点FFT为例,详细阐述了算法流程,并具体讲解了蝶形运算单元的设置及其参数确定。同时,提到了该实现可在Visual Studio 2015及Python 3.5环境下运行。
摘要由CSDN通过智能技术生成

 算法流程(以8点为例)

蝶形运算单元及参数确定

运行环境: 

     vs2015及Python3.5

#Complex.h
#pragma once

#include "iostream"
#include <string>
using namespace std;

class Complex
{
public:
	Complex(double real,double img);    //构造函数
	Complex(Complex &c);              //拷贝函数
	Complex();        //默认构造函数
	Complex operator=(const Complex &c)  //赋值运算符重载
	{
		this->real = c.real;
		this->img = c.img;

		return *this;
	}
	Complex operator*(const Complex &c)  //乘法运算符
	{
		Complex temp;
		temp.real = this->real * c.real - this->img * c.img;
		temp.img = this->real * c.img + this->img * c.real;
		return temp;
	}
	Complex operator+(const Complex &c) //加法运算符重载
	{
		Complex temp;
		temp.real = this->real + c.real;
		temp.img = this->img + c.img;
		return temp;
	}
	Complex operator-(const Complex &c) //减法云算法重载
	{
		Complex temp;
		temp.real = this->real - c.real;
		temp.img = this->img - c.img;
		return temp;
	}
	string getComplex();       //输出复数
	void setComplex(double &real,double &img);       //设置复数
	void setReal(double real);     //设置实数
	void setImg(double img);    //设置虚部
	double getRea
  • 2
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值