Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for upsample filter #137

Open
soumyabanerjee opened this issue Sep 10, 2021 · 4 comments
Open

Support for upsample filter #137

soumyabanerjee opened this issue Sep 10, 2021 · 4 comments
Labels
enhancement New feature or request

Comments

@soumyabanerjee
Copy link

soumyabanerjee commented Sep 10, 2021

Presently I am using sox upsample filter (insert 0 value samples) to expand the bandwidth and follow it up with camilladsp FIR for interpolation with my custom coefficients. It would be great if upsampling can be done (with 64 bit float) in camilladsp itself. That way I can eliminate sox out of my pipeline altogether and just chain filters within camilladsp config file itself.

presently it is something like this:
sox -c 2 -r 44100 -b 64 -e floating-point -t raw - -r 705600 -t raw - upsample 16 | camilladsp -l off <path_to_config.yml>

Love your work btw! CamillaDSP has replaced by brutefir pipeline ever since :)

@HEnquist
Copy link
Owner

HEnquist commented Sep 10, 2021

I haven't thought of this but makes sense to include. And why not add decimation at the same time.
I'm planning to release version 1.0 as soon as I'm sure the new CoreAudio backend is ready. Then this could go in the next version.
The implementation will then go in the resampling library: https://github.com/HEnquist/rubato

@HEnquist HEnquist added the enhancement New feature or request label Sep 10, 2021
@soumyabanerjee
Copy link
Author

Thanks Henrik!
Yeah having decimation along with upsample makes total sense.
That said I am not sure including upsample filter in resampling library will be optimal - reason being users might want to use cascaded / multi-stage upsampling + interpolation (using custom FIR) for any number of reasons.
At least I do so.
So a processing pipeline like : 4x upsample -> interpolation -> 4x upsample -> interpolation
I am not entirely sure if such a processing pipeline could be achieved if the proposed filter is part of rubato resampling module/library, unless you have bigger plans :)

@HEnquist
Copy link
Owner

HEnquist commented Oct 2, 2021

All filters in a camilladsp pipeline must work at the same sample rate, it's not possible to use different rates in different parts of the pipeline. That's why the resampling is handled in the capture thread, before passing the audio data to the pipeline.
Relaxing this would make the configuration much more complicated (and be a lot of work!), and I don't think the benefit would be large enough to make up for it.

I have started looking at how to add this to rubato. It seems pretty straightforward, shouldn't take very long once I get started.

@soumyabanerjee
Copy link
Author

That's fine. I understand the constraints are there for a reason and making them more flexible would be more effort on your part - and likely not many would be interested in this feature.
Coming from sox style of filter pipeline, it seemed natural to do so.
Not a deal breaker though by any means. Even for me since I will continue to follow it up with another instance of camilladsp with a different up-sampling factor.
Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants