Agathe Herrou
Florent de Dinechin, Stéphane Letz, Yann Orlarey, Anastasia Volkova
import("stdfaust.lib");
N = 100;
freq = 100;
process = sum(i, N, os.osc(freq*(i+1))/(i+1));
faust saw.dsp
faust -double saw.dsp
| Floating-point numbers | Fixed-point numbers |
|---|---|
| Big dynamics ✅ | Small dynamics ❌ |
| Expensive on FPGA ❌ | Cheap on FPGA ✅ |
$\Ra$ We use fixed-point numbers for hardware audio programs
process = +(1/64) ~ %(1) : *(2*ma.PI) : sin;
+(1/64) ~ %(1):
fRec0[0] = sfx_t(31,-24)(sfx_t(1,-38)(
sfx_t(0,-32)(fmodfx(fRec0[1], sfx_t(0,-32)(1.0)))
+ sfx_t(-6,-38)(0.015625)));
output0[i0] = FAUSTFLOAT(sfx_t(0,-109)(
sinfx(sfx_t(31,-54)(sfx_t(3,-30)(6.2831855)
* fRec0[0]))));
fRec0[1] = fRec0[0];
| Program | Signal-to-noise ratio |
|---|---|
| Sine with increment $\frac{1}{64}$ | 32 |
| Sine with increment 0.01 | 25 |
| Karplus-Strong | 33 |
Code on branch master-dev of
https://github.com/grame-cncm/faust/
sinPi