(no title)
ReactiveJelly | 2 years ago
Like, I understand FFTs and DCTs. But the explanation for how to construct filters in software is pathetic.
I looked at the code for VCVRack but could not understand it. It's already optimized for SIMD, processing 4 signals at once, which didn't help readability. (I'm sure it's very fast though)
samdafi|2 years ago
https://webaudio.github.io/Audio-EQ-Cookbook/audio-eq-cookbo...
An analog modeling approach, but cross-reference the coefficient calculations!
https://cytomic.com/technical-papers/
ChuckMcM|2 years ago
For me, the "aha" moment was when I connected the dots between "averaging" (which is a common way to filter noise out in an embedded computer) and "rolling average" is just summing the previous 'n' samples as sample * 1/n, and a picture of a fir filter that was (C code but it's pretty readable)
That is a "FIR" filter where the coefficients are all 1/n. Now take that and do the FFT of n samples of n/1 (adding zeros to get the resolution you want). And that is the frequency response of your filter for frequencies between 0 (DC) and sample_rate/2.For me at least that connected a lot of dots in what I was reading.
o11c|2 years ago
thepjb|2 years ago
Here's mine lol
Yeah I can't help but think there might be a niche for intermediate level discussion of these topics. I have a burning desire to wrap my head around z transform and other dsp black magic... (Like for example application of Hilbert transform to synthesis, anyone?) A lot of it comes back to understanding the complex plane. Like, I think Z transform relies on the fact that every *e^j2pi wraps around the unit circle again for one sample period.
benrow|2 years ago
The filter was the weirdest, least intuitive part. I ended up porting some open source code to java. This eventually worked, but was essentially impossible to debug without some sort of software oscilloscope.
That was about 18 years ago (yikes), and I still think about DSP from time to time.
The best intuition I have of low pass filters is to imagine it like an averaging, smoothing function which operates on the sample values as a sliding window. But that's not really true - it's not a straight rolling average, instead the sinc function (sin x / x) is used to scale the sample values with respect to time.
The way FIR filters work assumes a finite amount of samples (otherwise it would be technically impossible to know all past and future samples), so instead you pick a time period over which to calculate the output. Since there are always past and future samples included, this leads to a delayed output. Eg for a 100 sample filter window, you'd need to first have 100 samples in order to calculate the first output sample. This is intuitive, since a filter is sort of a smoothing, averaging function.
rcxdude|2 years ago
pajko|2 years ago
https://www.gnuradio.org/grcon/grcon18/presentations/The_Bri...
https://w7fu.com/audio-oscillator-project/
The best option to install it on Windows is radioconda: https://github.com/ryanvolz/radioconda
bigbillheck|2 years ago
Pick your favorite FIR filter, set up a ring buffer, input samples go in, at each step you multiply the buffer elements by your filter coefficients, sum, and output the result.
ahartmetz|2 years ago
AtomicOrbital|2 years ago
samdafi|2 years ago
ViktorV|2 years ago
Scene_Cast2|2 years ago
For more understanding, I do recommend reading up on DSP and Signals concepts, they're pretty critical to know if you're designing filters.
voidhorse|2 years ago
iainctduncan|2 years ago
parenthesis|2 years ago
https://github.com/csound/csound/blob/master/Opcodes/butter....