Updated smnp.dsp (markdown)

Bartłomiej Przemysław Pluta
2020-03-26 20:52:55 +01:00
parent cbfc146ceb
commit e8ed7ebc11

@@ -1,3 +1,44 @@
# Functions
## `plot(...signals: list<int, float>)`
Plots given lists as individual signals.
## `plot(config: map<string><>, ...signals: map<string><>)`
Plots given signals using global config map and individual maps with series.
### Arguments
* `config` - global config map, which includes following keys (all of them are optional):
| KEY | TYPE | VALUE | DEFAULT |
|:-------:|:--------:|:--------------------------------------------------------------------:|:-------:|
| title | `string` | The title of plot written at the very top of it. | - |
| output | `string` | The output image file name. If passed, plot is not displayed. | - |
| format | `string` | The format of output image. Applicable only when `output` is passed. | png |
Available formats:
* png
* jpg
* bpm
* gif
* eps
* pdf
* svg
* `signals` - a list of maps of following schema:
| KEY | TYPE |VALUE | REQUIRED? | DEFAULT |
|:-------:|:------:|:-------------------------------------------------------------------:|:---------:|:--------:|
| name | `string` | The name of series (will be applied in legend). | Yes | - |
| y | `list<int, float>` | The data to be plotted. | Yes | - |
| x | `list<int, float>` | The X series (horizontal axis). | No | 0, 1, 2, ... |
### Example
```
plot({ title -> "Example plot", output -> "myFile", format -> "pdf" },
{ name -> "C", y -> wave([@C:32]) },
{ name -> "D", y -> wave([@D:32]) },
{ name -> "E", y -> wave([@E:32]) }
);
```
## `fft(signal: list<int, float>)`
Returns a signal passed through FFT/radix-2 algorithm as a list of floats.