
A Few of My Favorite Sigmoids (2018) - bibyte
https://raphlinus.github.io/audio/2018/09/05/sigmoid.html
======
olooney
Don't forget the Gompertz function[1], used to model population growth:

$$ g(x) = a e^{-b e^{-cx} } $$

[1]:
[https://en.wikipedia.org/wiki/Gompertz_function](https://en.wikipedia.org/wiki/Gompertz_function)

------
HocusLocus
My fave,

[https://en.wikipedia.org/wiki/Sigmoid_colon](https://en.wikipedia.org/wiki/Sigmoid_colon)

------
montecarl
How does the function map to sound? I didn't see any discussion of that on the
site.

~~~
eindiran
You take a damped sine wave, where its amplitude gradually moves towards zero,
of some frequency and you pass it through the particular sigmoid function.
Just like you can play a sine wave, you can play the resulting tone.

If you look at his code, you can see how he wrote it:

    
    
      fn gen_audio(len: usize) -> Vec<f32> {
          //(0..len).map(|i| ((i as f32).powi(2) * 1e-7).sin()).collect()
          let f = 440.0;
          let d = f / 44_100.0 * 2.0 * std::f64::consts::PI;
          (0..len).map(|i| {
              let i = i as f64;
              let amp = 100.0 * (i * -4e-5).exp();
              let tone = (i * d).sin() * amp;
              tone.max(-1.0).min(1.0) as f32
              //erf7(tone as f32)
              //(tone / (1.0 + tone * tone).sqrt()) as f32
              //tone.tanh() as f32
          }).collect()
      }

------
buschtoens
Turn down the volume before playing the samples. Especially when wearing
headphones.

------
final_draft
I've always loved sigmoids, a really simple beauty to them.

