bmcfee / resampy

Efficient sample rate conversion in python
https://resampy.readthedocs.io
ISC License
253 stars 36 forks source link

Question : is it possible to apply fractional delay? #74

Closed pfeatherstone closed 4 years ago

pfeatherstone commented 4 years ago

Can one use resampy to apply a fractional delay to the audio, say sqrt(2) of a sample?

bmcfee commented 4 years ago

If you just want a delay, and not a change of sampling rate, resampy is not the right tool for this.

pfeatherstone commented 4 years ago

Okidok. Can I suggest adding a delay parameter to your FIR filters? This is trivially done for sinc functions, not so trivial for window functions, but still ok. Then i think if you set a cutoff/stop frequency of 0.45 or something, then do FIR filtering, you should get delayed audio.

bmcfee commented 4 years ago

What would be the use case for this? It's easy enough to implement a delay before (or after) resampling, so I'm not seeing much benefit in combining the two and making the resampling implementation more complex.

pfeatherstone commented 4 years ago

Sorry, I guess it wouldn't be part of a resampling operation. Just some FIR filtering. Since resampling requires doing some filtering anyway, maybe expose some filtering functions. The use case is if i want to apply some fractional delay to the audio.

bmcfee commented 4 years ago

Right -- if it's not part of resampling, it should be a different API.