@@ -29,6 +29,9 @@ y = sample_wise_lpc(x, A)
2929# Optionally, you can provide initial values for the output signal (default is 0)
3030zi = torch.randn(10 , 3 )
3131y = sample_wise_lpc(x, A, zi = zi)
32+
33+ # Return the delay values similar to `scipy.signal.lfilter`
34+ y, zf = sample_wise_lpc(x, A, zi = zi, return_zf = True )
3235```
3336
3437
@@ -44,6 +47,22 @@ or from source
4447pip install git+https://github.com/DiffAPF/torchlpc.git
4548```
4649
50+ If you want to use the CUDA version, make sure you have a compatible CUDA toolkit with your PyTorch installation.
51+
52+ ### MacOS
53+
54+ To compile with OpenMP support on MacOS, you need to instal ` libomp ` via Homebrew.
55+ Also, use ` llvm@15 ` as the C++ compiler to ensure compatibility with OpenMP.
56+
57+ ``` bash
58+ brew install libomp
59+ export CXX=$( brew --prefix llvm@15) /bin/clang++
60+ export LDFLAGS=" -L/usr/local/opt/libomp/lib"
61+ export CPPFLAGS=" -I/usr/local/opt/libomp/include"
62+ ```
63+
64+ After performing the above steps, you can install ` torchlpc ` as usual.
65+
4766## Derivation of the gradients of the LPC filter
4867
4968The details of the derivation can be found in our preprints[ ^ 1 ] [ ^ 2 ] .
@@ -118,6 +137,7 @@ This algorithm is more efficient than [^3] because it only needs one pass of fil
118137
119138- [x] Use PyTorch C++ extension for faster computation.
120139- [x] Use native CUDA kernels for GPU computation.
140+ - [ ] Support Metal for MacOS.
121141- [ ] Add examples.
122142
123143## Related Projects
0 commit comments