FFT加速多项式乘法C语言版(基2FFT)

本文提供了一种使用递归版本的快速傅里叶变换(FFT)来加速多项式乘法的C语言实现方法。该代码已在VS2017上通过测试。
摘要由CSDN通过智能技术生成

本文代码中FFT使用递归版本实现

FFT加速多项式乘法原理不多说了,直接贴代码如下:

在vs2017上测试成功

#include "pch.h"
#define _CRT_SECURE_NO_WARNINGS
#include "stdlib.h"
#include "math.h"
#include "stdio.h"


#define N 8
#define MAXN 100

#define Pi  3.1415927   //定义圆周率Pi
#define LEN sizeof(struct Compx)  //定义复数结构体大小

//-----定义复数结构体-----------------------
typedef struct Compx
{
	double real;
	double imag;
}Compx;

//-----复数乘法运算函数---------------------
struct Compx mult(struct Compx b1, struct Compx b2)
{
	struct Compx b3;
	b3.real = b1.real*b2.real - b1.imag*b2.imag;
	b3.imag = b1.real*b2.imag + b1.imag*b2.real;
	return(b3);
}

//-----复数减法运算函数---------------------
struct Compx sub(struct Compx a, struct Compx b)
{
	struct Compx c;
	c.real = a.real - b.real;
	c.imag = a.imag - b.imag;
	return(c);
}

//-----复数加法运算函数---------------------
struct Compx add(struct Compx a, struct Compx b)
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值