# RSKcorrecttau.m

**Arguments**

**Input**

-Required-

`RSK`

`channel`

: long name of channel to apply tau correction (e.g., 'Temperature', 'Dissolved O2')`tauResponse`

: sensor time constant of the channel in seconds.

-Optional-

`tauSmooth`

: smoothing time scale in seconds. Default is 0.`profile`

: [ ] (all profiles default)`direction`

: up, down or both, default is all directions available`visualize`

: show plot with original and processed data on specified profile(s)

**Output**

`RSK`

: Structure with corrected channel in place o measured channel.

Sensors require a finite time to reach equilibrium with the ambient environment under variable conditions. The adjustment process alters both the magnitude and phase of the true signal. The time response of a sensor is often characterized by a time constant, which is defined as the time it takes for the measured signal to reach 63.2% of the difference between the initial and final values after a step change.

`RSKcorrecttau`

applies the Fozdar et al. (1985; Eq. 3.15) algorithm to correct the phase and response of a measured signal to more accurately represent the true signal. The Fozdar expression is different from others because it includes a smoothing time constant to reduce the noise added by sharpening algorithms. When the smoothing time constant is set to zero (the default value in `RSKcorrecttau`

), the Fozdar algorithm reduces to the discrete form of a commonly-used model to correct for the thermal lag of a thermistor: $ T = T_m + \tau\frac{dT_m}{dt}$ where T_{m} is the measured temperature, T is the true temperature, and τ is the thermistor time constant (Fofonoff et al., 1974).

Example:

rsk = RSKcorrecttau(rsk,'channel','Dissolved O2','tauResponse',8,'direction','down','profile',1)

Below is an example showing how the Fozdar algorithm, with no smoothing time consant, enhances the response of a RBR*coda* T.ODO|standard (τ = 8s) data taken during a CTD profile. The CTD had an RBR*coda* T.ODO|fast (τ = 1s) to serve as a reference. The graph shows that the Fozdar algorithm, when applied to data from the standard response optode, does a good job of reconstructing the true dissolved oxygen profile by recovering both the phase and amplitude lost by its relatively long time constant. The standard deviation of the difference between standard and fast optode is greatly reduced.

Dissolved O |

The use of the Fozdar algorithm on RBR optode data is currently being studied at RBR, and more testing are needed to determine optimal value for parameter `tauSmooth` on sensors with different time constant. RBR is also planning to evaluate the use of other algorithms that have been tested on oxygen optode data, such as the "bilinear" filter (Bittig et al., 2014).