The R_Ware open source DSP library has received a long awaited update: Linear-Phase FIR Oversampling!
Check it out here: https://github.com/NeverKnewTheName/R_OpenLib
It's been a long while and this update was long overdue. Finding time to add to this project becomes increasingly difficult unfortunately :/
Anyways, here's an implementation of a polyphase FIR oversampler (upsampler + downsampler).
I have updated the Hardclipper example to showcase how to use the oversampler. There's also a new fir oversampler oscillator that shows how to just use the downsampler.
There's a long debate to be had when it comes to FIR vs IIR oversampling. In my experience/opinion, IIR oversampling is a lot more suited in the modular context. FIR oversampling (in this case) is linear phase, which is nice, but inevitably introduces latency. This breaks feedback loops and parallel patches. VM cannot compensate this latency. To be clear: this is not a bug! just a tradeoff..
You can implement and add your own FIR filter coefficients. calculating coefficients can be done with math software like GNU Octave or websites like http://t-filter.engineerjs.com/ or https://fiiir.com/ . The coefficients given in R_OpenLib are calculated with Octave by applying a Kaiser window to a sinc. it's been a long try-and-error process until the filtering was good enough yet also efficient enough. feel free to share your coefficients if you can come up with great FIR filters
Have fun creating amazing modules!
R_OpenLib update - FIR Oversamping
Re: R_OpenLib update - FIR Oversamping
Awesome, Chris. Thanks again for all your hard work and generosity in bringing this to the community. It's very much appreciated.
______________________
Dome Music Technologies
Dome Music Technologies
Re: R_OpenLib update - FIR Oversamping
Thanks for your kind words Grant!
i'd love to expand R_OpenLib a lot more, but unfortunately i can't find enough time.
Next on my list to add are oscillators... soon-ish
i'd love to expand R_OpenLib a lot more, but unfortunately i can't find enough time.
Next on my list to add are oscillators... soon-ish
Re: R_OpenLib update - FIR Oversamping
Thank you so much! Besides being quite easy to add to a project, working code is a wonderful resource for learning.
P.S. Adding oscillators would be fantastic if you ever find time.
P.S. Adding oscillators would be fantastic if you ever find time.
Re: R_OpenLib update - FIR Oversamping
you are very much welcome!
the code is MIT licensed, so feel free to use in your personal and commercial projects.
i am fascinated by oscillators. i think there's so much more to do with oscillators than what we currently have in the audio world. the basics are pretty simple tbh. most oscillators are phasor based. a phasor is a ramp-up whose wave-cycle is relative to the frequency. in essence sth like:
Code: Select all
void setFreq( double freq )
{
//calculate the distance the phase needs to travel per sample
m_phi = freq / sampleRate;
}
double advance()
{
//increment phase
m_phasor += m_phi;
//handle wrap around at 1 (this won't work for negative frequencies)
m_phasor -= (int)m_phasor;
return Math.sin( 2 * Math.PI * m_phasor );
}
double m_phasor;
double m_phi;
for R_OpenLib i need to come up with a flexible and extensible design that's easy to use and allows for a multitude of use cases. that takes careful consideration.... and of course time
-
- Posts: 625
- Joined: Mon Nov 15, 2021 9:23 pm
Re: R_OpenLib update - FIR Oversamping
Thanks, Chris. We all appreciate your time and the quality of your work!
Reid
Reid
Cyberwerks Heavy Industries -- viewforum.php?f=76