https://github.com/flaport/torch_lfilter
bring low pass filtering to PyTorch!
https://github.com/flaport/torch_lfilter
lowpass-filter pytorch signal-processing torch-lfilter
Last synced: over 1 year ago
JSON representation
bring low pass filtering to PyTorch!
- Host: GitHub
- URL: https://github.com/flaport/torch_lfilter
- Owner: flaport
- License: gpl-3.0
- Created: 2020-08-19T12:27:00.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-09-03T14:34:51.000Z (almost 6 years ago)
- Last Synced: 2024-03-14T15:26:09.232Z (over 2 years ago)
- Topics: lowpass-filter, pytorch, signal-processing, torch-lfilter
- Language: Python
- Homepage:
- Size: 23.4 KB
- Stars: 24
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# torch_lfilter
Bring low pass filtering to PyTorch!
This pytorch extension offers a PyTorch alternative for Scipy's
`lfilter` - with gradient tracking.
## CPU tensors only (efficiently...)
Although it's certainly the goal to implement an efficient CUDA
lfilter in C++, for now only the CPU version is implemented in C++.
That said, the implementation is reasonably fast and doing the
filtering on the CPU might be a viable option. Moreover, the
pure-python implementation works on all devices.
## Installation
The library can be installed with pip:
```
pip install torch_lfilter
```
Please note that no pre-built wheels exist. This means that `pip` will
attempt to install the library from source. Make sure you have the
necessary dependencies installed for your OS.
## Dependencies
### Linux
On Linux, having PyTorch installed is often enough to be able install
the library (along with the typical developer tools for your
distribution). Run the following inside a conda environment:
```
conda install pytorch -c pytorch
pip install torch_lfilter
```
### Windows
On Windows, the installation process is a bit more involved as
typically the build dependencies are not installed. To install those,
download **Visual Studio Community 2017** from
[here](https://my.visualstudio.com/Downloads?q=visual%20studio%202017&wt.mc_id=o~msft~vscom~older-downloads).
During installation, go to **Workloads** and select the following
workloads:
- Desktop development with C++
- Python development
Then go to **Individual Components** and select the following
additional items:
- C++/CLI support
- VC++ 2015.3 v14.00 (v140) toolset for desktop
Then, download Microsoft Visual C++ Redistributable from
[here](https://aka.ms/vs/16/release/vc_redist.x64.exe).
After these installation steps, run the following commands _inside_ a
**x64 Native Tools Command Prompt for VS 2017**, after activating your
conda environment:
```
set DISTUTILS_USE_SDK=1
conda install pytorch -c pytorch
pip install torch_lfilter
```
## License
© Floris Laporte 2020, [GPLv3](license)