Skip to content

Instantly share code, notes, and snippets.

View inipro's full-sized avatar

Embedded Github inipro

View GitHub Profile
@inipro
inipro / fix_fft.c
Created February 24, 2018 13:13 — forked from Tomwi/fix_fft.c
/* fix_fft.c - Fixed-point in-place Fast Fourier Transform */
/*
All data are fixed-point short integers, in which -32768
to +32768 represent -1.0 to +1.0 respectively. Integer
arithmetic is used for speed, instead of the more natural
floating-point.
For the forward FFT (time -> freq), fixed scaling is
performed to prevent arithmetic overflow, and to map a 0dB
sine/cosine wave (i.e. amplitude = 32767) to two -6dB freq