TSTOOL home page | TSTOOL documentation page | TSTOOL installation page | TSTOOL link page

Next: 6.21 Class description Up: 6.20 Class signal Previous: 6.20.2 Attributes
Subsections

- 6.20.3.1 abs
- 6.20.3.2 acf
- 6.20.3.3 acp
- 6.20.3.4 amutual
- 6.20.3.5 amutual2
- 6.20.3.6 analyze
- 6.20.3.7 arch
- 6.20.3.8 boxdim
- 6.20.3.9 cao
- 6.20.3.10 center
- 6.20.3.11 corrdim
- 6.20.3.12 corrsum
- 6.20.3.13 corrsum2
- 6.20.3.14 crosscorrdim
- 6.20.3.15 cut
- 6.20.3.16 db
- 6.20.3.17 delaytime
- 6.20.3.18 diff
- 6.20.3.19 dimensions
- 6.20.3.20 display
- 6.20.3.21 embed
- 6.20.3.22 fft
- 6.20.3.23 filterbank
- 6.20.3.24 firstmax
- 6.20.3.25 firstmin
- 6.20.3.26 firstzero
- 6.20.3.27 fracdims
- 6.20.3.28 getaxis
- 6.20.3.29 gmi
- 6.20.3.30 histo
- 6.20.3.31 infodim
- 6.20.3.32 infodim2
- 6.20.3.33 int
- 6.20.3.34 intspikeint
- 6.20.3.35 intspikint
- 6.20.3.36 largelyap
- 6.20.3.37 level_adaption
- 6.20.3.38 localdensity
- 6.20.3.39 max
- 6.20.3.40 medianfilt
- 6.20.3.41 merge
- 6.20.3.42 min
- 6.20.3.43 minus
- 6.20.3.44 movav
- 6.20.3.45 multires
- 6.20.3.46 nearneigh
- 6.20.3.47 norm1
- 6.20.3.48 norm2
- 6.20.3.49 pca
- 6.20.3.50 plosivity
- 6.20.3.51 plus
- 6.20.3.52 poincare
- 6.20.3.53 power
- 6.20.3.54 predict
- 6.20.3.55 predict2
- 6.20.3.56 rang
- 6.20.3.57 removeaxis
- 6.20.3.58 return_time
- 6.20.3.59 reverse
- 6.20.3.60 rms
- 6.20.3.61 scale
- 6.20.3.62 scalogram
- 6.20.3.63 setaxis
- 6.20.3.64 setunit
- 6.20.3.65 shift
- 6.20.3.66 signal
- 6.20.3.67 spacing
- 6.20.3.68 spec
- 6.20.3.69 spec2
- 6.20.3.70 stts
- 6.20.3.71 sttserror
- 6.20.3.72 surrogate1
- 6.20.3.73 surrogate2
- 6.20.3.74 surrogate3
- 6.20.3.75 surrogate_test
- 6.20.3.76 swap
- 6.20.3.77 takens_estimator
- 6.20.3.78 tc3
- 6.20.3.79 trend
- 6.20.3.80 trev
- 6.20.3.81 upsample
- 6.20.3.82 view
- 6.20.3.83 write

## 6.20.3 Member functions

### 6.20.3.1 abs

Syntax:

- `abs(s)`

Take absolut value of all data values of signal `s`. If sample values are complex, `abs(s)` returns the complex modulus (magnitude) of each sample.

###
6.20.3.2 acf

Syntax:

- `acf(s, len)`

Input arguments:

- `len` -length of the fft (optional)

Autocorrelation function for real scalar signals, using fft (of length `len`). If `len` is ommited a default value is calculated. The maximum of the calculated length is 128.

### 6.20.3.3 acp

Syntax:

- `acp(s, tau, past, maxdelay, maxdim, nref)`

Input arguments:

- `tau` - proper delay time for `s`
- `past` - number of samples to exclude before and after reference index (to avoid correlation effects)
- `maxdelay` - maximal delay (should be much smaller than the lenght of `s`) (optional)
- `maxdim` - maximal dimension to use (optional)
- `nref` - number of reference points (optional)

Auto crossprediction function for real scalar signals for increasing dimension. The default value for `maxdelay` is 25% of the input signal's length. The default for `maxdim` is 8 and for `nref` it is 10% of the input signal's length.

### 6.20.3.4 amutual

Syntax:

- `amutual(s, maxtau, bins)`

Input arguments:

- `maxtau` - maximal delay (should be much smaller than the lenght of `s`) (optional)
- `bins` - number of bins used for histogram calculation (optional)

Auto mutual information function for real scalar signals, can be used to determine a proper delay time for time-delay reconstruction. The default value for `maxtau` is 25% of the input signal's length. The default number of bins is 128.

### 6.20.3.5 amutual2

Syntax:

- `amutual2(s, len)`

Input arguments:

- `len` - maximal lag

Auto mutual information (average) function for real scalar signals using 128 equidistant partitions.

### 6.20.3.6 analyze

Syntax:

- `analyze(s, maxdim)`

Input arguments:

- `maxdim` - analyze will not use a dimension higher than this limit

Try to do a automatic analysis procedure of a time series. The time series is embedded using the first zero of the auto mutual information function for the delay time.

### 6.20.3.7 arch

Syntax:

- `[rs, archetypes]=arch(s, na, mode='normalized')`

Input arguments:

- `na` - number of generated archetypes
- `mode` - mode can be one of the following : '`normalized`' , '`mean`', '`raw`' (optional)

Archetypal analysis of column orientated data set:

- each row of data is one 'observation', e.g. the sample values of all channels in a multichannel measurement at one point in time
- in mode '`normalized`' each column of data is centered by removing its mean and then normalized by dividing through its standard deviation before the covariance matrix is calculated
- in mode '`mean`' only the mean of every column of data is removed
- in mode '`raw`' no preprocessing is applied to data

Default value for `mode` is '`normalized`'.

### 6.20.3.8 boxdim

Syntax:

- `rs = boxdim(s, bins)`

Input arguments:

- `s` - data points (row vectors)
- `bins` - maximal number of partition per axis (optional)

Compute the boxcounting (capacity) dimension of a time-delay reconstructed timeseries `s` for dimensions from 1 to `D`, where `D` is the dimension of the input vectors using boxcounting approach. The default number of bins is 100.

###
6.20.3.9 cao

Syntax:

- `[E1, E2] = cao(s, maxdim, tau, NNR, Nref)`

Input arguments:

- `s` - scalar input signal
- `maxdim` - maximal dimension
- `tau` - delay time
- `NNR` - number of nearest neighbor to use
- `Nref` - number of reference points (-1 means: use all points)

Estimate minimum embedding dimension using Cao's method.

The second output argument, `E2`, can be used to distinguish between deterministic and random data.

### 6.20.3.10 center

Syntax:

- `center(s)`

Center signal by removing it's mean.

###
6.20.3.11 corrdim

Syntax:

- `rs = corrdim(s, bins)`

Input arguments:

- `s` - data points (row vectors)
- `bins` - maximal number of partition per axis (optional)

Compute the correlation dimension of a time-delay reconstructed timeseries s for dimensions from 1 to `D`, where `D` is the dimension of the input vectors using boxcounting approach. The default number of `bins` is 100.

###
6.20.3.12 corrsum

Syntax:

- `rs = corrsum(s, n, range, past, bins)`

Input arguments:

- `n` - number of randomly chosen reference points (`n` == -1 means: use all points)
- `range` - maximal relative search radius (relative to attractor size) 0..1
- `past` - number of samples to exclude before and after each reference index
- `bins` - number of bins (optional)

Compute scaling of correlation sum for time-delay reconstructed timeseries `s` (Grassberger-Proccacia Algorithm), using fast nearest neighbor search. Default number of `bins` is 20.

###
6.20.3.13 corrsum2

Syntax:

- `rs = corrsum2(s, npairs, range, past, bins)`

Input arguments:

- `npairs` - number of pairs per bins
- `range` - maximal relative search radius (relative to attractor size) 0..1
- `past` - number of samples to exclude before and after each reference index
- `bins` - number of bins (optional), defaults to 32

Compute scaling of correlation sum for time-delay reconstructed timeseries `s` (Grassberger-Proccacia Algorithm), using fast nearest neighbor search.

###
6.20.3.14 crosscorrdim

Syntax:

- `rs = crosscorrdim(s, s2, n, range, past, bins)`

Input arguments:

- `n` - number of randomly chosen reference points (n == -1 means : use all points)
- `range` - maximal relative search radius (relative to size of data set s2) 0..1
- `past` - number of samples to exclude before and after each reference index
- `bins` - number of bins (optional)

Compute scaling of cross-correlation sum for time-delay reconstructed timeseries `s` against signal s2 (with same dimension as s), using fast nearest neighbor search. Reference points are taken out of signal `s`, while neigbors are searched in `s2`. The default number of `bins` is 32.

###
6.20.3.15 cut

Syntax:

- `rs = cut(s, dim, start, stop)`

Input arguments:

- `dim` - dimension along which the signal is cutted
- `start` - position where to start the cut
- `stop` - position where to stop (optional)

Cut a part of the signal. If `stop` is ommited only the data at `start` is cutted.

###
6.20.3.16 db

Syntax:

- `db(s, dbmin)`

Compute decibel values of signal relative to a reference value that is determined by the signal's `yunit` values below `dbmin` are set to `dbmin`. If `dbmin` is ommited it is set to -120.

###
6.20.3.17 delaytime

Syntax:

- `tau = delaytime(s, maxdelay, past)`

Input arguments:

- `maxdelay` - maximal delay time
- `past` - ?

Compute optimal delaytime for a scalar timeseries with method of Parlitz and Wichard.

###
6.20.3.18 diff

Syntax:

- `diff(s, nth)`

Compute the `n`th numerical derivative along dimension 1. `s` has be to sampled equidistantly.

###
6.20.3.19 dimensions

Syntax:

- `[bc,in,co] = dimensions(s, bins)`

Input arguments:

- `s` - data points (row vectors)
- `bins` - maximal number of partition per axis, default is 100

Output arguments:

- `bc` - scaling of boxes with partititon sizes
- `in` - scaling of information with partititon sizes
- `co` - scaling of correlation with partititon sizes

Compute boxcounting, information and correlation dimension of a time-delay reconstructed timeseries `s` for dimensions from 1 to `D`, where `D` is the dimension of the input vectors using boxcounting approach.

Scale data to be within 0 and 1. Give a sortiment of (integer) partitionsizes with almost exponential behaviour.

###
6.20.3.20 display

###
6.20.3.21 embed

Syntax:

- `emb = embed(s, dim, delay, shift, windowtype)`

Input arguments:

- `dim` - embedding dimension
- `delay` - time delay (optional)
- `shift` - shift for two sequent time delay vectors (optional)
- `windowtype` - type of window (optional)

Output arguments:

- `emb` - n by `dim` array, each row contains the coordinates of one point

Embeds signal `s` with embedding dimension `dim` and delay `delay` (in samples). `s` must be a scalar time series. The default values for `dim` and `delay` are equal to one. The default value for `windowtype` is 'Rect', which is currently the only possible value.

###
6.20.3.22 fft

Syntax:

- `f = fft(s)`

Output arguments:

- `f` - n by 2 array, the first column contains the magnitudes, the second one the phases.

Fourier transform of scalar signal `s`.

###
6.20.3.23 filterbank

Syntax:

- `filterbank(s, depth, filterlen)`

Filter scalar signal `s` into bands of equal bandwith, using maximally flat filters.

###
6.20.3.24 firstmax

Syntax:

- `[xpos, unit] = firstmax(s)`

Give information about first local maximum of scalar signal `s`.

###
6.20.3.25 firstmin

Syntax:

- `[xpos, unit] = firstmin(s)`

Give information about first local minimum of scalar signal `s`.

###
6.20.3.26 firstzero

Syntax:

- `[xpos, unit] = firstzero(s)`

Give information about first zero of scalar signal `s`, using linear interpolation.

###
6.20.3.27 fracdims

Syntax:

- `rs = fracdims(s, kmin, kmax, Nref, gstart, gend, past, steps)`
- `rs = fracdims(s, kmin, kmax, Nref, gstart, gend, past)`
- `rs = fracdims(s, kmin, kmax, Nref, gstart, gend)`

Input arguments:

- `kmin` - minimal number of neighbors for each reference point
- `kmax` - maximal number of neighbors for each reference point
- `Nref` - number of randomly chosen reference points (n == -1 means : use all points)
- `gstart` - starting value for moments
- `gend` - end value for moments
- `past` - (optional) number of samples to exclude before and after each reference index, default is 0
- `steps` - (optional) number of moments to calculate, default is 32

Compute fractal dimension spectrum `D(q)` using moments of neighbor distances for time-delay reconstructed timeseries `s`.

Do the main job - computing nearest neighbors for reference points.

###
6.20.3.28 getaxis

Syntax:

- `a = getaxis(s, dim)`

Get one of the currend `xaxes`.

###
6.20.3.29 gmi

Syntax:

- `gmi(s, D, eps, NNR, len, Nref)`

Input arguments:

- `D` -
- `eps` -
- `NNR` -
- `len` -
- `Nref` -

Generalized mutual information function for a scalar time series

###
6.20.3.30 histo

Syntax:

- `histo(s, partitions)`

Histogram function using equidistantly spaced partitions.

###
6.20.3.31 infodim

Syntax:

- `rs = infodim(s, bins)`

Input arguments:

- `s` - data points (row vectors)
- `bins` - maximal number of partition per axis, default is 100

Compute the information dimension of a time-delay reconstructed timeseries `s` for dimensions from 1 to `D`, where `D` is the dimension of the input vectors. Using boxcounting approach. Scale data to be within 0 and 1. Give a sortiment of (integer) partitionsizes with almost exponential behaviour.

###
6.20.3.32 infodim2

Syntax:

- `rs = infodim2(s, n, kmax, past)`

Input arguments:

- `n` - number of randomly chosen reference points (n == -1 means : use all points)
- `kmax` - maximal number of neighbors for each reference point
- `past` - number of samples to exclude before and after each reference index

Compute scaling of moments of the nearest neighbor distances for time-delay reconstructed timeseries `s`. This can be used to calculate information dimension `D1`.

Numerically compute first derivative of after .

###
6.20.3.33 int

Syntax:

- `int(s)`

Numerical integration along dimension 1 signal `s` has to be sampled equidistantly.

###
6.20.3.34 intspikeint

Syntax:

- `rs = intspikeint(s)`

Compute the interspike intervalls for a spiked scalar timeseries, using transformation on ranked values.

###
6.20.3.35 intspikint

Syntax:

- `rs = intspikeint(s)`

Compute the interspike intervalls for a spiked scalar timeseries, using transformation on ranked values.

###
6.20.3.36 largelyap

Syntax:

- `rs = largelyap(s, n, stepsahead, past, nnr)`

Input arguments:

- `n` - number of randomly chosen reference points (-1 means: use all points)
- `stepsahead` - maximal length of prediction in samples
- `past` - exclude
- `nnr` - number of nearest neighbours (optional)

Output arguments:

- `rs` -

Compute the largest lyapunov exponent of a time-delay reconstructed timeseries `s`, using formula (1.5. of Nonlinear Time-Series Analysis, Ulrich Parlitz 1998 [146]).

###
6.20.3.37 level_adaption

Syntax:

- `level_adaption(s, timeconstants, dynamic_limit, threshold)`

Each channel of signal s is independently divided by a scaling factor that adapts to the current level of the samples in this channel. The adaption process is simulated using a cascade of feedback loops (Püschel 1998) which consists of low pass filters with time constants given as second argument to this function. The number of time constants given determines the number of feedback loops that are used.

Higher values for time constants will result in slower adaption speed. Short time changes in the signal will be transmitted almost linearily. In each feedback loop, a nonlinear compressing characteristic (see Stefan Münkner 1993) limits the signal values to be within `[-dynamic_limit dynamic_limit]`. A low value for `dynamic_limit` will introduce nonlinear distortions to the signal.

To prevent the feedback loops from adapting to a zero level (in case all input values are zero), a tiny threshold is given as 4th argument. The scaling factors will not shrink below this threshold.

###
6.20.3.38 localdensity

Syntax:

- `rs = localdensity(s, n, past)`

Input arguments:

- `n` - number of nearest neighbour to compute
- `past` - a nearest neighbour is only valid if it is as least `past` timesteps away from the reference point `past` = 1 means: use all points but `ref_point` itself

Uses accelerated searching, distances are calculated with euclidian norm.

###
6.20.3.39 max

Syntax:

- `[maximum, yunit, xpos, xunit] = max(s)`

Give information about maximum of scalar signal `s`.

Example:

    disp('maximum of signal : ')
    disp(['y = ' num2str(m) ' ' label(yunit(s))]);
    disp(['x = ' num2str(xpos) ' ' label(a)]);

###
6.20.3.40 medianfilt

Syntax:

- `rs = medianfilt(s, len)`

Moving median filter of width `len` samples for a scalar time series (`len` should be odd).

###
6.20.3.41 merge

Syntax:

- `merge(signal1, signal2, dB)`
- `merge(signal1, signal2)`

Input arguments:

- `signal1, signal2` - Signals
- `dB` - energy ratio, (optional, default = 0)

Merges signal `s1` and `s2` into a new signal with energy ration `dB` (in decibel) a positive value of `dB` increases the amount of `signal1` in the resulting signal.

###
6.20.3.42 min

Syntax:

- `[minimum, yunit, xpos, xunit] = min(s)`

Give information about minimum of scalar signal `s`.

Example:

    disp('minimum of signal : ')
    disp(['y = ' num2str(m) ' ' label(yunit(s))]);
    disp(['x = ' num2str(xpos) ' ' label(a)]);

###
6.20.3.43 minus

Syntax:

- `rs=minus(s, offset)`
- `rs=minus(s1,s2)`

Input arguments:

- `s, s1, s2` - signal object
- `offset` - scalar value

Calculate difference of signals `s1` and `s2` or substract a scalar value from `s`.

###
6.20.3.44 movav

Syntax:

- `rs = movav(s, len, windowtype)`
- `rs = movav(s, len)`

Moving average of width `len` (samples) along first dimension.

###
6.20.3.45 multires

Syntax:

- `rs = multires(s) => scale=3`
- `rs = multires(s, scale)`

Multires perform multiresolution analysis. `Y = MULTIRES (X,H,RH,G,RG,SC)` obtains the SC successive details and the low frequency approximation of signal in `X` from a multiresolution scheme. The analysis lowpass filter `H`, synthesis lowpass filter `RH`, analysis highpass filter `G` and synthesis highpass filter `RG` are used to implement the scheme.

Results are given in a `scale+1` channels. The first scale channels are the details corresponding to the scales to the last row contains the approximation at scale . The original signal can be restored by summing all the channels of the resulting signal.

###
6.20.3.46 nearneigh

Syntax:

- `rs = nearneigh(s, n) => past=1`
- `rs = nearneigh(s, n, past)`

Input arguments:

- `n` - number of nearest neighbour to compute
- `past` - a nearest neighbour is only valid if it is as least past timesteps away from the reference point. past = 1 means: use all points but `ref_point` itself

`n` nearest neighbour algorithm. Find `n` nearest neighbours (in order of increasing distances) to each point in signal `s` uses accelerated searching, distances are calculated with euclidian norm.

###
6.20.3.47 norm1

Syntax:

- `rs=norm1(s) => low=0 , upp=1`
- `rs=norm1(s, low) => upp=1`
- `rs=norm1(s, low, upp)`

Scale and move signal values to be within `[low,upp]`.

###
6.20.3.48 norm2

Syntax:

- `rs=norm2(s)`

Normalize signal by removing it's mean and dividing by the standard deviation.

###
6.20.3.49 pca

Syntax:

- `[rs, eigvals, eigvecs] = pca(s) => mode='normalized' , maxpercent = 95`
- `[rs, eigvals, eigvecs] = pca(s, mode) => maxpercent = 95`
- `[rs, eigvals, eigvecs] = pca(s, mode, maxpercent)`

Input arguments:

- each row of data is one 'observation', e.g. the sample values of all channels in a multichannel measurement at one point in time
- `mode` can be one of the following : `'normalized'` (default), `'mean', 'raw'`
  - in mode `'normalized'` each column of data is centered by removing its mean and then normalized by dividing through its standard deviation before the covariance matrix is calculated
  - in mode `'mean'` only the mean of every column of data is removed
  - in mode `'raw'` no preprocessing is applied to data
- `maxpercent` gives the limit of the accumulated percentage of the resulting eigenvalues, default is 95 %

Principal component analysis of column orientated data set.

###
6.20.3.50 plosivity

Syntax:

- `rs = plosivity(s, blen) => flen=1 , thresh=0, windowtype = 'Rect'`
- `rs = plosivity(s, blen, flen) => thresh=0, windowtype = 'Rect'`
- `rs = plosivity(s, blen, flen, thresh) => windowtype = 'Rect'`
- `rs = plosivity(s, blen, flen, thresh, windowtype)`

Compute plosivity of a spectrogram. See also: `window` for list of possible window types.

###
6.20.3.51 plus

Syntax:

- `rs=plus(s, offset)`
- `rs=plus(s1, s2)`

Add two signals `s1` and `s2` or add a scalar value `offset` to `s`.

###
6.20.3.52 poincare

Syntax:

- `rs=poincare(s, ref)`

Compute Poincare-section of an embedded time series the result is a set of vector points with dimension `DIM-1`, when the input data set of vectors had dimension `DIM`. The projection is done orthogonal to the tangential vector at the vector with index.

###
6.20.3.53 power

Syntax:

- `power(s)`

Calculate squared magnitude of each sample.

###
6.20.3.54 predict

Syntax:

- `rs = predict(s, dim, delay, len) => nnr=1`
- `rs = predict(s, dim, delay, len, nnr) => mode=0`
- `rs = predict(s, dim, delay, len, nnr, mode)`

Input arguments:

- `dim` - dimension for time-delay reconstruction
- `delay` - delay time (in samples) for time-delay reconstruction
- `len` - length of prediction (number of output values)
- `nnr` - number of nearest neighbors to use (default is one)
- `step` - stepsize (in samples) (default is one)
- `mode`:
  - 0 = Output vectors are the mean of the images of the nearest neighbors
  - 1 = Output vectors are the distance weighted mean of the images of the nearest neighbors
  - 2 = Output vectors are calculated based on the local flow using the mean of the images of the neighbors
  - 3 = Output vectors are calculated based on the local flow using the weighted mean of the images of the neighbors

Local constant iterative prediction for scalar data, using fast nearest neighbor search. Four methods of computing the prediction output are possible.

###
6.20.3.55 predict2

Syntax:

- `rs = predict2(s, len, nnr, step, mode)`

Input arguments:

- `len` - length of prediction (number of output values)
- `nnr` - number of nearest neighbors to use (default is one)
- `step` - stepsize (in samples) (default is one)
- `mode`:
  - 0 = Output vectors are the mean of the images of the nearest neighbors
  - 1 = Output vectors are the distance weighted mean of the images of the nearest neighbors
  - 2 = Output vectors are calculated based on the local flow using the mean of the images of the neighbors
  - 3 = Output vectors are calculated based on the local flow using the weighted mean of the images of the neighbors

Local constant iterative prediction for phase space data (e.g. data stemming from a time delay reconstruction of a scalar time series), using fast nearest neighbor search. Four methods of computing the prediction output are possible.

###
6.20.3.56 rang

Syntax:

- `rs = rang(s)`

Transform scalar time series to rang values.

###
6.20.3.57 removeaxis

Syntax:

- `s = removeaxis(s, dim)`

Remove axis one of the current `xaxes`. No bound checking for `dim`.

###
6.20.3.58 return_time

Syntax:

- `rs = return_time(s, nnr, maxT) => past=1`
- `rs = return_time(s, nnr, maxT, past)`
- `rs = return_time(s, nnr, maxT, past, N)`

Input arguments:

- `nnr` - number of nearest neighbors
- `maxT` - maximal return time to consider
- `past` - a nearest neighbor is only valid if it is as least past timesteps away from the reference point past = 1 means: use all points but tt ref_point itself
- `N` - number of reference indices

Compute histogram of return times.

###
6.20.3.59 reverse

Syntax:

- `rs=reverse(s)`

Reverse signal along dimension 1.

###
6.20.3.60 rms

Syntax:

- `rs = rms(s)`

Calculate root mean square value for signal along dimension 1.

###
6.20.3.61 scale

Syntax:

- `scale(signal, factor)`

Scale signal by factor `f`.

###
6.20.3.62 scalogram

Syntax:

- `rs = scalogram(s) => scalemin=0.1`
- `rs = scalogram(s, scalemin) => scalemax=1`
- `rs = scalogram(s, scalemin, scalemax) => scalestep=0.1`
- `rs = scalogram(s, scalemin, scalemax, scalestep) => mlen=10`
- `rs = scalogram(s, scalemin, scalemax, scalestep, mlen)`

Scalogram of signal `s` using morlet wavelet. See also: `spec2`.

###
6.20.3.63 setaxis

Syntax:

- `s = setaxis(s, dim, achse)`

Change one of the current xaxes.

###
6.20.3.64 setunit

Syntax:

- `s = setunir(s, dim, u)`

Change unit of one of the current `xaxes`.

###
6.20.3.65 shift

Syntax:

- `s = shift(s, distance)` (dim=1)
- `s = shift(s, distance, dim)`

shift signal on axis No. dim by distance (measured in the unit of the axis) to the right

###
6.20.3.66 signal

Syntax:

- `s = signal(array)`

  creates a new signal object from a data array `array` the data inside the object can be retrieved with `x = data(s)`;

- `s = signal(array, achse1, achse2, ...)`

  creates a new signal object from a data array `array`, using `achse1` etc. as xachse entries

- `s = signal(array, unit1, unit2, ...)`

  creates a new signal object from a data array 'array', using unit1 etc. to create xachse objects

- `s = signal(array, samplerate1, samplerate2, ...)`

  creates a new signal object from a data array `array`, using as xunit 's' (second) and scalar `samplerate1` as samplerate(s)

A signal object contains signal data, that is a collection of real or complex valued samples. A signal can be one or multi-dimensional. The number of dimensions is the number of axes that are needed to describe the the data.

An example for an one-dimensional signal is a one-channel measurement (timeseries), or the power spectrum of a one-channel measurement. An example for a two-dimensional signal is a twelve-channel measurement, with one time axis and a 'channel' axis. Another example for a two-dimensional signal is a short time spectrogramm of a time series, where we have a time axis and a frequency axis.

Each axis can have a physical unit(e.g. 's' or 'Hz'), a starting point and a step value. E.g. if a time-series is sampled with 1000 Hz, beginning at 1 min 12 sec, the unit is 's', the starting point is 72 and the step value (delta) is 0.001.

But not only the axes have physical units, also the sample value themselve can have a unit, maybe 'V' or 'Pa', depending on what the sampled data represent (=> yunit)

All units are stored as objects of class 'unit', all axes are stored as objects of class 'achse' (this somewhat peculiar name was chosen because of conflicts with reserved matlab keywords 'axis' and 'axes', which otherwise would have been the first choice).

Example for creating a 2-dimensional signal with y-unit set to 'Volt', the first dimension's unit is 'second' (time), the second dimension's unit is 'n' (Channels).

Examples:

-      tmp = rand(100, 10);

       s = signal(tmp, unit('s'), unit('n'));
       s = setyunit(s, unit('V'));
       s = addcomment(s, 'Example signal with two dimensions')

- Loading from disk

       s = signal(filename)

  loads a previously stored signal object

- Importing from other file formats:

       ASCII: s = signal('data/spalte1.dat', 'ASCII')
       WAVE: s = signal('data/Sounds/hat.wav', 'WAVE')
       AU (SUN AUDIO): s = signal('data/Sounds/hat.au', 'AU')
       (old) NLD-Format : s = signal('test.nld', 'NLD')

###
6.20.3.67 spacing

- `v = spacing(s)` (dim=1)
- `v = spacing(s, dim)`

return spacing values for xaxis nr. dim

###
6.20.3.68 spec

Syntax:

- rs = spec(s)

compute power spectrum for real valued scalar signals. Multivariate signals are accepted but may produce unwanted results as only the spectrum of the first column is returned.

###
6.20.3.69 spec2

Syntax:

- `rs = spec2(s)`

Input Arguments:

- `fensterlen` - size of window (optional)
- `fenster` - window type (optional)
- `vorschub` - shift in samples (optional)

spectrogramm of signal s using short time fft

Examples:

    view(spec2(sine(10000, 1000, 8000), 512, 'Hanning'))

###
6.20.3.70 stts

Syntax:

- `rs = stts(s, I)` (J=0, K=1, L=1)
- `rs = stts(s, I, J)` (K=1, L=1)
- `rs = stts(s, I, J, K)` (L=1)
- `rs = stts(s, I, J, K, L)`

Input Arguments:

- `s` - input data set of N snapshots of length M, given as N by M matrix
- `I` - number of spatial neighbours
- `J` - number of temporal neighbours (in the past)
- `K` - spatial shift (= spatial delay)
- `L` - temporal delay

Spatiotemporal prediction conforming to U. Parlitz, NONLINEAR TIME-SERIES ANALYSIS Chapter 1.10.2.1.

###
6.20.3.71 sttserror

Syntax:

- `rs = sttserror(s1, s2)`

Input Arguments:

- `s1` - original signal
- `s2` - predicted signal

compute error function for prediction of spatial-temporal systems
see U. Parlitz `"`Nonlinear Time Series Analysis`"`, Section 1.10.2.2 Eq. 1.10

###
6.20.3.72 surrogate1

Syntax:

- `rs = surrogate1(s)`

create surrogate data for a scalar time series by randomizing phases of fourier spectrum
see : James Theiler et al.'Using Surrogate Data to Detect Nonlinearity in Time Series', APPENDIX : ALGORITHM I

###
6.20.3.73 surrogate2

Syntax:

- `rs = surrogate2(s)`

create surrogate data for a scalar time series
see : James Theiler et al.'Using Surrogate Data to Detect Nonlinearity in Time Series', APPENDIX : ALGORITHM II

###
6.20.3.74 surrogate3

Syntax:

- `rs = surrogate3(s)`

create surrogate data for a scalar time series by permuting samples randomly

###
6.20.3.75 surrogate_test

Syntax:

- `rs=surrogate_test(s, ntests, method,func)`

Input Arguments:

- `s` - has to be a real, scalar signal
- `ntests` - is the number of surrogate data sets to create
- `method` - method to generate surrogate data sets:
  - 1: surrogate1
  - 2: surrogate2
  - 3: surrogate3
- `func` - string with matlab-code, have to return a signal object with a scalar time series. The data to process is a signal object referred by the qualifier `s` (see example).

Output Arguments:

- `rs` is a signal object with a three dimensional time series. The first component is the result of the `func` function applied to the original data set `s`. The second component is the mean of the result of the `func` function applied to the `ntests` surrogate data sets. The third component is the standard deviation. There is a special `plothint` ('surrerrorbar') for the `view` function to show this result in the common way.

`surrogate_test` runs an automatic surrogate data test task. It generates `ntests` surrogate data sets an performs the `func` function to each set. `func` is a string with matlab-code who returns a signal `s` with a scalar time series.

Example:

    st = surrogate_test(s, 10, 1, 1, 'largelyap(embed(s,3,1,1), 128,20,10);');

###
6.20.3.76 swap

Syntax:

- `rs = swap(s)` (exchange dimension 1 and dimension 2)
- `rs = swap(s, dim1, dim2)`

Exchange signal's dimensions (and axes)

###
6.20.3.77 takens_estimator

Syntax:

- `D2 = takens_estimator2(s, n, range, past)`

Input Arguments:

- `n` - number of randomly chosen reference points (n == -1 means : use all points)
- `range` - maximal relative search radius (relative to attractor size) 0..1
- `past` - number of samples to exclude before and after each reference index

Takens estimator for correlation dimension

###
6.20.3.78 tc3

Syntax:

- `rs = tc3(s,tau,n,method)`

Input Arguments:

- `tau` - see explaination below
- `n` - number of surrogate data sets to generate
- `method` - method to generate the surrogate data sets:
  - 1: `surrogate1`
  - 2: `surrogate2`
  - 3: `surrogate3`

Output Arguments:

- `rs` is a row vector, returned as signal object. The first item is the value for the original data set `s`. The following `n` values are the values for the generated surrogates. There exist a special `plothint` ('surrbar') for the `view` function to show this kind of result in the common way.

This function calculates a special value for the original data set and the `n` generated surrogate data sets. The value is defined as followed:

In terms of surrogate data test this is a test statistics for higher order moments. The original `tc3` function is located under `utils/tc3.m` and use simple matlab vectors.

###
6.20.3.79 trend

Syntax:

- `rs = trend(s, len)`

trend correction
calculate moving average of width `len` (samples) for a scalar time series (`len` should be odd) and remove the result from the input signal

###
6.20.3.80 trev

Syntax:

- `rs = trev(s,tau,n,method)`

Input Arguments:

- `tau` - see explaination below
- `n` - number of surrogate data sets to generate
- `method` - method to generate the surrogate data sets:
  - 1: `surrogate1`
  - 2: `surrogate2`
  - 3: `surrogate3`

Output Arguments:

- `rs` is a row vector, returned as signal object. The first item is the value for the original data set `s`. The following `n` values are the values for the generated surrogates. There exist a special `plothint` ('surrbar') for the `view` function to show this kind of result in the common way.

This function calculates a special value for the original data set and the `n` generated surrogate data sets. The value is defined as followed:

In terms of surrogate data test this is a test statistics for time reversibility. The original `trev` function is located under `utils/trev.m` and use simple matlab vectors.

###
6.20.3.81 upsample

Syntax:

- `rs = upsample(s, factor, method)`

Input Arguments:

- `method` may be one of the following :
  - `'fft'`
  - `'spline'`
  - `'akima'`
  - `'nearest'`
  - `'linear'`
  - `'cubic'`
- `s` has be to sampled equidistantly for fft interpolation

Change sample rate of signal s by one-dimensional interpolation

###
6.20.3.82 view

Syntax:

- `view(signal)` (fontsize=12)
- `view(signal, fontsize)`
- `view(signal, fontsize, figurehandle)`

Signal viewer that decides from the signal's attributes which kind of plot to produce, using the signal's plothint entry to get a hint which kind of plot to produce
Possible plothints are:

- `'graph'`
- `'bar'`
- `'surrbar'`
- `'surrerrorbar'`
- `'points'`
- `'xyplot'`
- `'xypoints'`
- `'scatter'`
- `'3dcurve'`
- `'3dpoints'`
- `'spectrogram'`
- `'image'`
- `'multigraph'`
- `'multipoints'`
- `'subplotgraph'`

###
6.20.3.83 write

Syntax:

- `write(s, filename)` (writes in TSTOOL's own file format)
- `write(s, filename, 'ASCII')`
- `write(s, filename, 'WAV')` (RIFF WAVE FORMAT)
- `write(s, filename, 'AU')` (SUN AUDIO FORMAT)
- `write(s, filename, 'NLD')` (old NLD FORMAT)
- `write(s, filename, 'SIPP')` (si++ file format)

writes a signal object to file filename (uses matlab's file format)

Next: 6.21 Class description Up: 6.20 Class signal Previous: 6.20.2 Attributes Contents