clear-dsp 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- clear_dsp-0.1.0/.gitignore +159 -0
- clear_dsp-0.1.0/LICENSE +21 -0
- clear_dsp-0.1.0/PKG-INFO +131 -0
- clear_dsp-0.1.0/README.md +90 -0
- clear_dsp-0.1.0/pyproject.toml +115 -0
- clear_dsp-0.1.0/src/clear_dsp/__init__.py +12 -0
- clear_dsp-0.1.0/src/clear_dsp/filters.py +12 -0
- clear_dsp-0.1.0/src/clear_dsp/py.typed +0 -0
- clear_dsp-0.1.0/src/clear_dsp/spectral.py +10 -0
- clear_dsp-0.1.0/src/clear_dsp/windows.py +19 -0
- clear_dsp-0.1.0/tests/__init__.py +0 -0
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
# Byte-compiled / optimized / DLL files
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*$py.class
|
|
5
|
+
|
|
6
|
+
# C extensions
|
|
7
|
+
*.so
|
|
8
|
+
|
|
9
|
+
# Distribution / packaging
|
|
10
|
+
.Python
|
|
11
|
+
build/
|
|
12
|
+
develop-eggs/
|
|
13
|
+
dist/
|
|
14
|
+
downloads/
|
|
15
|
+
eggs/
|
|
16
|
+
.eggs/
|
|
17
|
+
lib/
|
|
18
|
+
lib64/
|
|
19
|
+
parts/
|
|
20
|
+
sdist/
|
|
21
|
+
var/
|
|
22
|
+
wheels/
|
|
23
|
+
share/python-wheels/
|
|
24
|
+
*.egg-info/
|
|
25
|
+
.installed.cfg
|
|
26
|
+
*.egg
|
|
27
|
+
MANIFEST
|
|
28
|
+
|
|
29
|
+
# PyInstaller
|
|
30
|
+
*.manifest
|
|
31
|
+
*.spec
|
|
32
|
+
|
|
33
|
+
# Installer logs
|
|
34
|
+
pip-log.txt
|
|
35
|
+
pip-delete-this-directory.txt
|
|
36
|
+
|
|
37
|
+
# Unit test / coverage reports
|
|
38
|
+
htmlcov/
|
|
39
|
+
.tox/
|
|
40
|
+
.nox/
|
|
41
|
+
.coverage
|
|
42
|
+
.coverage.*
|
|
43
|
+
.cache
|
|
44
|
+
nosetests.xml
|
|
45
|
+
coverage.xml
|
|
46
|
+
*.cover
|
|
47
|
+
*.py,cover
|
|
48
|
+
.hypothesis/
|
|
49
|
+
.pytest_cache/
|
|
50
|
+
cover/
|
|
51
|
+
|
|
52
|
+
# Translations
|
|
53
|
+
*.mo
|
|
54
|
+
*.pot
|
|
55
|
+
|
|
56
|
+
# Django stuff:
|
|
57
|
+
*.log
|
|
58
|
+
local_settings.py
|
|
59
|
+
db.sqlite3
|
|
60
|
+
db.sqlite3-journal
|
|
61
|
+
|
|
62
|
+
# Flask stuff:
|
|
63
|
+
instance/
|
|
64
|
+
.webassets-cache
|
|
65
|
+
|
|
66
|
+
# Scrapy stuff:
|
|
67
|
+
.scrapy
|
|
68
|
+
|
|
69
|
+
# Sphinx documentation
|
|
70
|
+
docs/_build/
|
|
71
|
+
|
|
72
|
+
# PyBuilder
|
|
73
|
+
.pybuilder/
|
|
74
|
+
target/
|
|
75
|
+
|
|
76
|
+
# Jupyter Notebook
|
|
77
|
+
.ipynb_checkpoints
|
|
78
|
+
|
|
79
|
+
# IPython
|
|
80
|
+
profile_default/
|
|
81
|
+
ipython_config.py
|
|
82
|
+
|
|
83
|
+
# pyenv
|
|
84
|
+
.python-version
|
|
85
|
+
|
|
86
|
+
# pipenv
|
|
87
|
+
Pipfile.lock
|
|
88
|
+
|
|
89
|
+
# UV
|
|
90
|
+
uv.lock
|
|
91
|
+
|
|
92
|
+
# poetry
|
|
93
|
+
poetry.lock
|
|
94
|
+
|
|
95
|
+
# pdm
|
|
96
|
+
pdm.lock
|
|
97
|
+
pdm.toml
|
|
98
|
+
|
|
99
|
+
# PEP 582
|
|
100
|
+
__pypackages__/
|
|
101
|
+
|
|
102
|
+
# Celery stuff
|
|
103
|
+
celerybeat-schedule
|
|
104
|
+
celerybeat.pid
|
|
105
|
+
|
|
106
|
+
# SageMath parsed files
|
|
107
|
+
*.sage.py
|
|
108
|
+
|
|
109
|
+
# Environments
|
|
110
|
+
.env
|
|
111
|
+
.venv
|
|
112
|
+
env/
|
|
113
|
+
venv/
|
|
114
|
+
ENV/
|
|
115
|
+
env.bak/
|
|
116
|
+
venv.bak/
|
|
117
|
+
|
|
118
|
+
# Spyder project settings
|
|
119
|
+
.spyderproject
|
|
120
|
+
.spyproject
|
|
121
|
+
|
|
122
|
+
# Rope project settings
|
|
123
|
+
.ropeproject
|
|
124
|
+
|
|
125
|
+
# mkdocs documentation
|
|
126
|
+
/site
|
|
127
|
+
|
|
128
|
+
# mypy
|
|
129
|
+
.mypy_cache/
|
|
130
|
+
.dmypy.json
|
|
131
|
+
dmypy.json
|
|
132
|
+
|
|
133
|
+
# Pyre type checker
|
|
134
|
+
.pyre/
|
|
135
|
+
|
|
136
|
+
# pytype static type analyzer
|
|
137
|
+
.pytype/
|
|
138
|
+
|
|
139
|
+
# Cython debug symbols
|
|
140
|
+
cython_debug/
|
|
141
|
+
|
|
142
|
+
# ruff
|
|
143
|
+
.ruff_cache/
|
|
144
|
+
|
|
145
|
+
# IDE
|
|
146
|
+
.idea/
|
|
147
|
+
.vscode/
|
|
148
|
+
*.swp
|
|
149
|
+
*.swo
|
|
150
|
+
*~
|
|
151
|
+
|
|
152
|
+
# OS
|
|
153
|
+
.DS_Store
|
|
154
|
+
Thumbs.db
|
|
155
|
+
|
|
156
|
+
# Project specific
|
|
157
|
+
*.h5
|
|
158
|
+
*.npz
|
|
159
|
+
*.npzz
|
clear_dsp-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Andrew Wilwerding
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
clear_dsp-0.1.0/PKG-INFO
ADDED
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: clear-dsp
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: A lightweight JAX-optimized package of pure functions for digital signal processing
|
|
5
|
+
Project-URL: Homepage, https://github.com/APWilwerding/clear-dsp
|
|
6
|
+
Project-URL: Repository, https://github.com/APWilwerding/clear-dsp
|
|
7
|
+
Project-URL: Issues, https://github.com/APWilwerding/clear-dsp/issues
|
|
8
|
+
Project-URL: Documentation, https://github.com/APWilwerding/clear-dsp#readme
|
|
9
|
+
Author: Andrew Wilwerding
|
|
10
|
+
License-Expression: MIT
|
|
11
|
+
License-File: LICENSE
|
|
12
|
+
Keywords: audio,digital-signal-processing,dsp,fft,filters,jax,scientific-computing,signal-processing
|
|
13
|
+
Classifier: Development Status :: 3 - Alpha
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Intended Audience :: Science/Research
|
|
16
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
17
|
+
Classifier: Operating System :: OS Independent
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Multimedia :: Sound/Audio :: Analysis
|
|
24
|
+
Classifier: Topic :: Scientific/Engineering
|
|
25
|
+
Classifier: Topic :: Scientific/Engineering :: Information Analysis
|
|
26
|
+
Classifier: Typing :: Typed
|
|
27
|
+
Requires-Python: >=3.10
|
|
28
|
+
Requires-Dist: jax>=0.4.20
|
|
29
|
+
Requires-Dist: jaxlib>=0.4.20
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: mypy>=1.11; extra == 'dev'
|
|
32
|
+
Requires-Dist: pre-commit>=3.8; extra == 'dev'
|
|
33
|
+
Requires-Dist: pytest-cov>=5.0; extra == 'dev'
|
|
34
|
+
Requires-Dist: pytest>=8.0; extra == 'dev'
|
|
35
|
+
Requires-Dist: ruff>=0.6; extra == 'dev'
|
|
36
|
+
Provides-Extra: docs
|
|
37
|
+
Requires-Dist: myst-parser>=3.0; extra == 'docs'
|
|
38
|
+
Requires-Dist: sphinx-book-theme>=1.1; extra == 'docs'
|
|
39
|
+
Requires-Dist: sphinx>=7.0; extra == 'docs'
|
|
40
|
+
Description-Content-Type: text/markdown
|
|
41
|
+
|
|
42
|
+
# clear-dsp
|
|
43
|
+
|
|
44
|
+
**A lightweight JAX-optimized package of pure functions for digital signal processing.**
|
|
45
|
+
|
|
46
|
+
`clear-dsp` provides a clean, functional, and high-performance set of DSP primitives built on [JAX](https://github.com/jax-ml/jax). Every function is pure, JIT-compatible, and designed for composition, autodiff, and acceleration on CPU, GPU, or TPU.
|
|
47
|
+
|
|
48
|
+
## Design Principles
|
|
49
|
+
|
|
50
|
+
- **Pure functions only** — no classes, no mutable state, no side effects
|
|
51
|
+
- **JAX-native** — fully compatible with `jax.jit`, `jax.vmap`, `jax.grad`, and `jax.pmap`
|
|
52
|
+
- **Lightweight** — minimal dependencies (just JAX)
|
|
53
|
+
- **Composable** — small, focused building blocks that combine cleanly
|
|
54
|
+
- **Type-safe** — full type annotations and mypy-friendly
|
|
55
|
+
|
|
56
|
+
## Installation
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install clear-dsp
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Or for development:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
git clone https://github.com/yourusername/clear-dsp.git
|
|
66
|
+
cd clear-dsp
|
|
67
|
+
pip install -e ".[dev]"
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## Quick Start
|
|
71
|
+
|
|
72
|
+
```python
|
|
73
|
+
import jax.numpy as jnp
|
|
74
|
+
from clear_dsp import filters, spectral
|
|
75
|
+
|
|
76
|
+
# Example: simple low-pass FIR filter (placeholder API)
|
|
77
|
+
# signal = jnp.sin(jnp.linspace(0, 10 * jnp.pi, 1000))
|
|
78
|
+
# filtered = filters.fir_lowpass(signal, cutoff=0.1, num_taps=51)
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
> **Note:** The API is under active development. Check the source and tests for currently implemented functions.
|
|
82
|
+
|
|
83
|
+
## Project Structure
|
|
84
|
+
|
|
85
|
+
```
|
|
86
|
+
clear-dsp/
|
|
87
|
+
├── src/
|
|
88
|
+
│ └── clear_dsp/
|
|
89
|
+
│ ├── __init__.py
|
|
90
|
+
│ ├── filters.py # FIR/IIR filters, windowing
|
|
91
|
+
│ ├── spectral.py # FFT-related, spectrograms, STFT
|
|
92
|
+
│ ├── windows.py # Window functions
|
|
93
|
+
│ └── ...
|
|
94
|
+
├── tests/
|
|
95
|
+
├── pyproject.toml
|
|
96
|
+
└── README.md
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Development
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
# Install with development dependencies
|
|
103
|
+
pip install -e ".[dev]"
|
|
104
|
+
|
|
105
|
+
# Run tests
|
|
106
|
+
pytest
|
|
107
|
+
|
|
108
|
+
# Lint
|
|
109
|
+
ruff check src tests
|
|
110
|
+
|
|
111
|
+
# Type check
|
|
112
|
+
mypy src
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
## Roadmap (initial ideas)
|
|
116
|
+
|
|
117
|
+
- Window functions (Hann, Hamming, Blackman, Kaiser, etc.)
|
|
118
|
+
- FIR filter design and application
|
|
119
|
+
- Basic IIR filters (biquads)
|
|
120
|
+
- STFT / ISTFT
|
|
121
|
+
- Spectral analysis helpers
|
|
122
|
+
- Convolution and correlation
|
|
123
|
+
- Resampling
|
|
124
|
+
- Envelope detection / Hilbert transform
|
|
125
|
+
- Signal analysis
|
|
126
|
+
|
|
127
|
+
Contributions and suggestions are welcome!
|
|
128
|
+
|
|
129
|
+
## License
|
|
130
|
+
|
|
131
|
+
MIT License — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# clear-dsp
|
|
2
|
+
|
|
3
|
+
**A lightweight JAX-optimized package of pure functions for digital signal processing.**
|
|
4
|
+
|
|
5
|
+
`clear-dsp` provides a clean, functional, and high-performance set of DSP primitives built on [JAX](https://github.com/jax-ml/jax). Every function is pure, JIT-compatible, and designed for composition, autodiff, and acceleration on CPU, GPU, or TPU.
|
|
6
|
+
|
|
7
|
+
## Design Principles
|
|
8
|
+
|
|
9
|
+
- **Pure functions only** — no classes, no mutable state, no side effects
|
|
10
|
+
- **JAX-native** — fully compatible with `jax.jit`, `jax.vmap`, `jax.grad`, and `jax.pmap`
|
|
11
|
+
- **Lightweight** — minimal dependencies (just JAX)
|
|
12
|
+
- **Composable** — small, focused building blocks that combine cleanly
|
|
13
|
+
- **Type-safe** — full type annotations and mypy-friendly
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
pip install clear-dsp
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or for development:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
git clone https://github.com/yourusername/clear-dsp.git
|
|
25
|
+
cd clear-dsp
|
|
26
|
+
pip install -e ".[dev]"
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
## Quick Start
|
|
30
|
+
|
|
31
|
+
```python
|
|
32
|
+
import jax.numpy as jnp
|
|
33
|
+
from clear_dsp import filters, spectral
|
|
34
|
+
|
|
35
|
+
# Example: simple low-pass FIR filter (placeholder API)
|
|
36
|
+
# signal = jnp.sin(jnp.linspace(0, 10 * jnp.pi, 1000))
|
|
37
|
+
# filtered = filters.fir_lowpass(signal, cutoff=0.1, num_taps=51)
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
> **Note:** The API is under active development. Check the source and tests for currently implemented functions.
|
|
41
|
+
|
|
42
|
+
## Project Structure
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
clear-dsp/
|
|
46
|
+
├── src/
|
|
47
|
+
│ └── clear_dsp/
|
|
48
|
+
│ ├── __init__.py
|
|
49
|
+
│ ├── filters.py # FIR/IIR filters, windowing
|
|
50
|
+
│ ├── spectral.py # FFT-related, spectrograms, STFT
|
|
51
|
+
│ ├── windows.py # Window functions
|
|
52
|
+
│ └── ...
|
|
53
|
+
├── tests/
|
|
54
|
+
├── pyproject.toml
|
|
55
|
+
└── README.md
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Development
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
# Install with development dependencies
|
|
62
|
+
pip install -e ".[dev]"
|
|
63
|
+
|
|
64
|
+
# Run tests
|
|
65
|
+
pytest
|
|
66
|
+
|
|
67
|
+
# Lint
|
|
68
|
+
ruff check src tests
|
|
69
|
+
|
|
70
|
+
# Type check
|
|
71
|
+
mypy src
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
## Roadmap (initial ideas)
|
|
75
|
+
|
|
76
|
+
- Window functions (Hann, Hamming, Blackman, Kaiser, etc.)
|
|
77
|
+
- FIR filter design and application
|
|
78
|
+
- Basic IIR filters (biquads)
|
|
79
|
+
- STFT / ISTFT
|
|
80
|
+
- Spectral analysis helpers
|
|
81
|
+
- Convolution and correlation
|
|
82
|
+
- Resampling
|
|
83
|
+
- Envelope detection / Hilbert transform
|
|
84
|
+
- Signal analysis
|
|
85
|
+
|
|
86
|
+
Contributions and suggestions are welcome!
|
|
87
|
+
|
|
88
|
+
## License
|
|
89
|
+
|
|
90
|
+
MIT License — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["hatchling"]
|
|
3
|
+
build-backend = "hatchling.build"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "clear-dsp"
|
|
7
|
+
version = "0.1.0"
|
|
8
|
+
description = "A lightweight JAX-optimized package of pure functions for digital signal processing"
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
requires-python = ">=3.10"
|
|
11
|
+
license = "MIT"
|
|
12
|
+
authors = [
|
|
13
|
+
{ name = "Andrew Wilwerding" }
|
|
14
|
+
]
|
|
15
|
+
keywords = [
|
|
16
|
+
"dsp",
|
|
17
|
+
"digital-signal-processing",
|
|
18
|
+
"jax",
|
|
19
|
+
"signal-processing",
|
|
20
|
+
"filters",
|
|
21
|
+
"fft",
|
|
22
|
+
"audio",
|
|
23
|
+
"scientific-computing",
|
|
24
|
+
]
|
|
25
|
+
classifiers = [
|
|
26
|
+
"Development Status :: 3 - Alpha",
|
|
27
|
+
"Intended Audience :: Developers",
|
|
28
|
+
"Intended Audience :: Science/Research",
|
|
29
|
+
"License :: OSI Approved :: MIT License",
|
|
30
|
+
"Operating System :: OS Independent",
|
|
31
|
+
"Programming Language :: Python :: 3",
|
|
32
|
+
"Programming Language :: Python :: 3.10",
|
|
33
|
+
"Programming Language :: Python :: 3.11",
|
|
34
|
+
"Programming Language :: Python :: 3.12",
|
|
35
|
+
"Programming Language :: Python :: 3.13",
|
|
36
|
+
"Topic :: Scientific/Engineering",
|
|
37
|
+
"Topic :: Scientific/Engineering :: Information Analysis",
|
|
38
|
+
"Topic :: Multimedia :: Sound/Audio :: Analysis",
|
|
39
|
+
"Typing :: Typed",
|
|
40
|
+
]
|
|
41
|
+
dependencies = [
|
|
42
|
+
"jax>=0.4.20",
|
|
43
|
+
"jaxlib>=0.4.20",
|
|
44
|
+
]
|
|
45
|
+
|
|
46
|
+
[project.optional-dependencies]
|
|
47
|
+
dev = [
|
|
48
|
+
"pytest>=8.0",
|
|
49
|
+
"pytest-cov>=5.0",
|
|
50
|
+
"ruff>=0.6",
|
|
51
|
+
"mypy>=1.11",
|
|
52
|
+
"pre-commit>=3.8",
|
|
53
|
+
]
|
|
54
|
+
docs = [
|
|
55
|
+
"sphinx>=7.0",
|
|
56
|
+
"sphinx-book-theme>=1.1",
|
|
57
|
+
"myst-parser>=3.0",
|
|
58
|
+
]
|
|
59
|
+
|
|
60
|
+
[project.urls]
|
|
61
|
+
Homepage = "https://github.com/APWilwerding/clear-dsp"
|
|
62
|
+
Repository = "https://github.com/APWilwerding/clear-dsp"
|
|
63
|
+
Issues = "https://github.com/APWilwerding/clear-dsp/issues"
|
|
64
|
+
Documentation = "https://github.com/APWilwerding/clear-dsp#readme"
|
|
65
|
+
|
|
66
|
+
[tool.hatch.build.targets.wheel]
|
|
67
|
+
packages = ["src/clear_dsp"]
|
|
68
|
+
|
|
69
|
+
[tool.hatch.build.targets.sdist]
|
|
70
|
+
include = [
|
|
71
|
+
"/src",
|
|
72
|
+
"/tests",
|
|
73
|
+
"/README.md",
|
|
74
|
+
"/LICENSE",
|
|
75
|
+
"/pyproject.toml",
|
|
76
|
+
]
|
|
77
|
+
|
|
78
|
+
[tool.pytest.ini_options]
|
|
79
|
+
testpaths = ["tests"]
|
|
80
|
+
pythonpath = ["src"]
|
|
81
|
+
addopts = "-v --strict-markers"
|
|
82
|
+
|
|
83
|
+
[tool.ruff]
|
|
84
|
+
target-version = "py310"
|
|
85
|
+
line-length = 88
|
|
86
|
+
src = ["src", "tests"]
|
|
87
|
+
|
|
88
|
+
[tool.ruff.lint]
|
|
89
|
+
select = [
|
|
90
|
+
"E", # pycodestyle errors
|
|
91
|
+
"W", # pycodestyle warnings
|
|
92
|
+
"F", # pyflakes
|
|
93
|
+
"I", # isort
|
|
94
|
+
"B", # flake8-bugbear
|
|
95
|
+
"C4", # flake8-comprehensions
|
|
96
|
+
"UP", # pyupgrade
|
|
97
|
+
]
|
|
98
|
+
ignore = [
|
|
99
|
+
"E501", # line too long (handled by formatter)
|
|
100
|
+
]
|
|
101
|
+
|
|
102
|
+
[tool.ruff.lint.isort]
|
|
103
|
+
known-first-party = ["clear_dsp"]
|
|
104
|
+
|
|
105
|
+
[tool.mypy]
|
|
106
|
+
python_version = "3.10"
|
|
107
|
+
strict = true
|
|
108
|
+
warn_return_any = true
|
|
109
|
+
warn_unused_configs = true
|
|
110
|
+
mypy_path = "src"
|
|
111
|
+
packages = ["clear_dsp"]
|
|
112
|
+
|
|
113
|
+
[[tool.mypy.overrides]]
|
|
114
|
+
module = ["jax.*", "jaxlib.*"]
|
|
115
|
+
ignore_missing_imports = true
|
|
File without changes
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"""Window functions for digital signal processing.
|
|
2
|
+
|
|
3
|
+
All functions return JAX arrays and are pure / JIT-compatible.
|
|
4
|
+
"""
|
|
5
|
+
|
|
6
|
+
from __future__ import annotations
|
|
7
|
+
|
|
8
|
+
import jax
|
|
9
|
+
import jax.numpy as jnp
|
|
10
|
+
from jax import Array
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
def rectangular(n: int) -> Array:
|
|
14
|
+
"""Rectangular (boxcar) window of length ``n``."""
|
|
15
|
+
return jnp.ones(n, dtype=jnp.float32)
|
|
16
|
+
|
|
17
|
+
__all__ = [
|
|
18
|
+
"rectangular",
|
|
19
|
+
]
|
|
File without changes
|