prCorr: Correct for depth attenuation of a water surface height...

Description Usage Arguments Value References Examples

View source: R/prCorr.R

Description

Bottom-mounted pressure transducers suffer from pressure signal attenuation when attempting to estimate surface wave heights. This function corrected water surface height time series based on the depth of the water column and height of the sensor above the bottom.

Usage

1
prCorr(pt, Fs, zpt, M = 512, CorrLim = c(0.05, 0.33), plot = FALSE)

Arguments

pt

A vector of water surface heights (units of meters usually).

Fs

Sampling frequency (units of Hz). Normally 4Hz for an OWHL logger.

zpt

Height of the pressure sensor above the seabed (units of meters).

M

Length of time series segments that will be used in the detrending and attenuation correction operations. 512 samples is the default, should be an even number.

CorrLim

[min max] frequency for attenuation correction (Hz, optional, default [0.05 0.33]).

Value

A vector of the depth-corrected surface heights (units of meters usually). Any original trend in the input data (such as tide change) is present in the output data. The returned surface height fluctuations will typically be more extreme than the raw input surface heights.

References

Original MATLAB function by Urs Neumeier http://neumeier.perso.ch/matlab/waves.html Modified from the Pcorr3.m function written by T. Mason, SOC, January 1997

Each segment of pt will be linearly detrended, corrected for attenuation, and the linear trend will be added back to the returned data.

Examples

1
2
3
4
5
6
7
data(wavedata)
corrected = prCorr(wavedata$SurfaceHeightRaw.m, Fs = 4, zpt = 0.1)
# Plot the results
plot(x = wavedata$DateTime, y = corrected, type = 'l', 
 ylab='Surface Height, m', xlab = 'Time')
lines(x = wavedata$DateTime, y = wavedata$SurfaceHeightRaw.m, col = 'red')
legend('topleft',legend=c('Corrected','Raw'),col=c('black','red'),lwd = 2)

millerlp/oceanwaves documentation built on Sept. 22, 2018, 5:34 a.m.