torchlpc
torchlpc copied to clipboard
Final delay values 'zf'
Hello,
Thank you for your work.
It would be great to be able to get the final delay values 'zf' like with scipy.signal.lfilter, so that on the next calls to sample_wise_lpc with consecutive buffers, one can pass zi = zf.
zf can be obtained like this, but it's not so obvious:
y1 = sample_wise_lpc(x[:, :L], a, zi=None)
order = a.size(-1)
zf = y1[: -order:].flip(1)
y2 = sample_wise_lpc(x[:, L:), a, zi=zf)
Hi @ybourdin , glad to know you're interested in our work!
Good suggestion!
I suggest having a separate function like sample_wise_lpc_zf that implements what you describe and returns a tuple (y, zf) so we don't introduce backwards incompatible changes.
Please feel free to submit a PR, and we'll review it.
Hi @ybourdin , the feature has been added to the main branch f50b419ea58dd1dc26fab3e9602cc3bef1a0dbbb