Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danlessa/signal_composer
Library for composing signals from arrays and functions.
https://github.com/danlessa/signal_composer
signal-processing
Last synced: about 9 hours ago
JSON representation
Library for composing signals from arrays and functions.
- Host: GitHub
- URL: https://github.com/danlessa/signal_composer
- Owner: danlessa
- License: mit
- Created: 2022-08-10T22:08:57.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-03-19T16:59:52.000Z (11 months ago)
- Last Synced: 2025-01-15T13:11:06.353Z (24 days ago)
- Topics: signal-processing
- Language: Python
- Homepage:
- Size: 232 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# signal_composer
Library for composing signals from arrays and functions.
## Usage
### Creating Signals
#### From interpolated arrays
```python
signal = Signal([1, 0, 1, -1, 1])
```![](assets/signal_interpolate.png)
#### From functions
```python
f = lambda x: x ** 3 - x ** 2
signal = Signal(f)
```![](assets/signal_function.png)
```python
f = lambda x: x ** 3 - x ** 2
signal = Signal(f, function_input_span=[0, 1 + 0.25])
```![](assets/signal_function_span.png)
### Composing Signals
#### From adding signals```python
signal_1 = Signal([0, 1])
signal_2 = Signal(lambda x: 1 + x ** 3)
composed_signal = signal_1 + signal_2
```![Time-series for the composed signal above.](assets/compose_add.png)
#### From lists
```python
signals = [
lambda x: x ** 2,
[-1, 0, 1],
lambda x: 4 + x ** (1/2)
]composed_signal = Signal.compose_from_list(signals)
```![](assets/compose_list.png)
## How to install
### Option 1: Manually
Clone the GitHub repo and install manually by passing
```
gh repo clone danlessa/signal_composer
cd signal_composer
pip install -e .
```### Option 2: PyPi
Just pass:
`pip install signal_composer`