6
smnp.dsp
Bartłomiej Przemysław Pluta edited this page 2020-04-02 09:24:28 +02:00

Functions

plot

plot(...signals: list<int, float>)                     #1
plot(config: map<string><>, ...signals: map<string><>) #2

Plots given lists as individual signals (#1). Plots given signals using global config map and individual maps with series (#2).

Arguments

#1
  • signals - series to be plotted
#2
  • 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(fft(wave([@F#])));

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

fft(signal: list<int, float>)

Returns a signal passed through FFT/radix-2 algorithm as a list of floats.