Built-in Analysis Object Models


Introduction

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:        a = ao(plist('built-in', 'whitenoise'), pl);
 
  INPUTS:
               pl - a parameter list of additional parameters (see below)
  
  PARAMETERS:  
               'sigma' - standard deviation of the noise. [default: 1]
               'nsecs' - number of seconds [s] of data. [default: 1]
               'fs'    - sample rate [Hz] for the white noise. [default: 10]
 
 
  VERSION:     $Id: builtin_models_ao_content.html,v 1.3 2011/04/04 10:39:35 hewitson Exp $
 
  HISTORY:     29-10-08 M Hewitson
                  Creation
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

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
description:  
       data: (0,0.260207192213954) (0.1,-1.01369469442225) (0.2,-2.1763634062959) (0.3,1.00632778971068) (0.4,0.523897003913847) ...
             -------- tsdata 01 ------------
              
                 fs:  10
                  x:  [1000 1], double
                  y:  [1000 1], double
             xunits:  [s]
             yunits:  [V]
              nsecs:  100
                 t0:  1970-01-01 00:00:00.000
             -------------------------------
              
       hist:  ao / ao / $Id: builtin_models_ao_content.html,v 1.3 2011/04/04 10:39:35 hewitson Exp $-->$Id: builtin_models_ao_content.html,v 1.3 2011/04/04 10:39:35 hewitson Exp $
  mfilename:  
mdlfilename:  
---------------------------------

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.

You can also do

    >> ao(plist('built-in', ''))

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