Skip to content

Instantly share code, notes, and snippets.

View rytse's full-sized avatar

Ryan Tse rytse

View GitHub Profile
@VictorTaelin
VictorTaelin / implementing_fft.md
Last active April 30, 2024 05:32
Implementing complex numbers and FFT with just datatypes (no floats)

Implementing complex numbers and FFT with just datatypes (no floats)

In this article, I'll explain why implementing numbers with just algebraic datatypes is desirable. I'll then talk about common implementations of FFT (Fast Fourier Transform) and why they hide inherent inefficiencies. I'll then show how to implement integers and complex numbers with just algebraic datatypes, in a way that is extremely simple and elegant. I'll conclude by deriving a pure functional implementation of complex FFT with just datatypes, no floats.

@rytse
rytse / setup.sh
Last active December 29, 2021 02:21
## Personal setup script
## TODO: before using, change email addresses in git and ssh
# Update system, install the basics
sudo apt update; sudo apt -y upgrade
sudo add-apt-repository ppa:pi-rho/dev -y
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt upgrade -y