Metadata-Version: 2.1
Name: signal_composer
Version: 0.0.2
Summary: Library for composing signals from arrays and functions.
Author-email: Danilo Lessa Bernardineli <danilo.lessa@gmail.com>
License: MIT License
        
        Copyright (c) 2022 Danilo Lessa Bernardineli
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/danlessa/signal_composer
Project-URL: Bug Tracker, https://github.com/danlessa/signal_composer/issues
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
License-File: LICENSE

# 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`
