Skip to content

Instantly share code, notes, and snippets.

@ksenobojca
ksenobojca / fft.py
Last active October 14, 2022 06:04 — forked from berenoguz/fft.py
The Fast Fourier Transform and The Fast Polynomial Multiplication Algorithms in Python 3
from cmath import exp
from math import pi
# A simple class to simulate n-th root of unity
# This class is by no means complete and is implemented
# merely for FFT and FPM algorithms
class NthRootOfUnity:
def __init__(self, n, k = 1):
self.k = k
self.n = n