Method matrix/diff


  DIFF differentiates the data in a ltpda_container object.
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
 
  DESCRIPTION: DIFF differentiates the data in a ltpda_container object.
 
  CALL:        out = diff(in, pl);
 
  Note: this is just a wrapper of ao/diff. Each AO in the ltpda_container is passed
  to ao/diff with the input plist. 
  
  INPUTS:      in      -  input ltpda_container objects 
               pl      -  parameter list
 
  OUTPUTS:     out     -  output ltpda_container objects 
 
  Parameters Description
 
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
Method Details
Access public
Defining Class ltpda_container
Sealed 0
Static 0

Parameter Description

Default

no description
Key Default Value Options Description
diff
METHOD '3POINT'
  • 'DIFF'
  • '2POINT'
  • '3POINT'
  • '5POINT'
  • 'ORDER2'
  • 'ORDER2SMOOTH'
  • 'FILTER'
  • 'FPS'
The method to use. Choose between:
  • 'diff' - uses MATLAB's diff function. For 2D data, the last x sample is dropped.
  • '2POINT' - 2 point derivative computed as [y(i+1)-y(i)]./[x(i+1)-x(i)]
  • '3POINT' - 3 point derivative. Compute derivative dx at i as
    [y(i+1)-y(i-1)] / [x(i+1)-x(i-1)]
    For i==1, the output is computed as [y(2)-y(1)]/[x(2)-x(1)].
    The last sample is computed as [y(N)-y(N-1)]/[x(N)-x(N-1)]
  • '5POINT' - 5 point derivative. Compute derivative dx at i as
    [-y(i+2)+8*y(i+1)-8*y(i-1)+y(i-2)] / [3*(x(i+2)-x(i-2))]
    For i==1, the output is computed as [y(2)-y(1)]/[x(2)-x(1)]
    The last sample is computed as [y(N)-y(N-1)]/[x(N)-x(N-1)]
  • 'ORDER2' - Compute derivative using a 2nd order method
  • 'ORDER2SMOOTH' - Compute derivative using a 2nd order method
    with a parabolic fit to 5 consecutive samples
  • 'filter' - applies an IIR filter built from a single pole at the chosen frequency.
    The filter is applied forwards and backwards (filtfilt) to achieve the desired f^2
    response. This only works for time-series AOs.
    For this method, you can specify the pole frequency with an additional parameter 'F0' (see below):
  • 'FPS' - Calculates five points derivative using utils.math.fpsder.
    When calling with this option you may add also the parameters
    'ORDER' (see below) and 'COEFF' (see below)
F0 '1/Nsecs' none The pole frequency for the 'filter' method.
ORDER 'FIRST'
  • 'ZERO'
  • 'FIRST'
  • 'SECOND'
Derivative order.
This applys only to the cases where 'METHOD' is set to:
  • 'FPS'
  • 'DIFF'
  • '2POINT'
  • '3POINT'
  • '5POINT'
COEFF [] none Coefficient used for the derivation.
This applys only to the case where 'METHOD' is set to 'FPS'.
Refer to the fpsder help for further details

Example

plist('METHOD', '3POINT', 'F0', '1/Nsecs', 'ORDER', 'FIRST', 'COEFF', [[]])

back to top back to top

Some information of the method ltpda_container/diff are listed below:
Class name ltpda_container
Method name diff
Category Signal Processing
Package name ltpda
VCS Version 967b0eec0dece803a81af8ef54ad2f8c784b20b2
Min input args 1
Max input args -1
Min output args 1
Max output args -1
Can be used as modifier 0
Supported numeric types {'double'}




©LTP Team