5 ms·
A Few of My Favorite Sigmoids (2018)
- final_draft 8y agoI've always loved sigmoids, a really simple beauty to them.
- montecarl 8y agoHow does the function map to sound? I didn't see any discussion of that on the site.
- eindiran 8y agoYou 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() }
- deleted 8y ago[deleted]
- buschtoens 8y agoTurn down the volume before playing the samples. Especially when wearing headphones.
- HocusLocus 8y agoMy fave, https://en.wikipedia.org/wiki/Sigmoid_colon https://en.wikipedia.org/wiki/Sigmoid_colon
- olooney 8y agoDon'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