AO built-in models


Built-in Analysis Object models provide a convenient way to add parametric contructors to the ao class. This is best explained with an example.

One of the supplied built-in models is called 'whitenoise'. To see how to build this model, do

    >> help ao_model_whitenoise    

All ao model files are called ao_model_<model_name>.

In this case, the help shows:

 ao_model_whitenoise constructs a known white-noise time-series
  DESCRIPTION: ao_model_whitenoise constructs a known white-noise time-series.
  CALL:     mdl = ao(plist('built-in', 'whitenoise'), pl);
            pl - a parameter list of additional parameters (see below)
            mdl - an AO object representing the time-series of the signal
    Model Information

To build this model, use the following constructor:

    a = ao(plist('built-in', 'whitenoise', 'sigma', 2, 'nsecs', 100, 'fs', 10))
----------- ao 01: WN -----------
       name: WN
       data: (0,0.260207192213954) (0.1,-1.01369469442225) (0.2,-2.1763634062959) (0.3,1.00632778971068) (0.4,0.523897003913847) ...
             -------- tsdata [x, y] --------
                  x:  [1000 1], double
                  y:  [1000 1], double
                 dx:  [0 0], double
                 dy:  [0 0], double
             xunits:  [s]
                  fs:  10
               nsecs:  100
                  t0:  1970-01-01 00:00:00.000 UTC
       hist: ao / ao / 16e0daa2fa98962d9797b84643a3057270bb3fcb
       UUID: 6330334d-b5fc-4a12-a335-c2ae194d9420

The special thing about this model, is that it always generates noise from the same seed, thus providing a reproducible data series.

Available models

To see a list of the currently available built-in models, you can use the ao class static method, getBuiltInModels:

  >> ao.getBuiltInModels

This returns a cell-array with two columns: the first columns contains the model names; the second column descriptions of the models.

Adding new models

The available ao models are determined by looking through a set of directories for all M-files with names like ao_model_<model_name>. The directories to be searched depend on the installed extension modules. For more details, see the section on LTPDA Extension Modules.

It is recommended to use the above 'whitenoise' model as an example when building your own models.

To inspect the code for this model, just edit it:

  >> edit ao_model_whitenoise

©LTP Team