lowpassFilter {lowpassFilter} | R Documentation |
Lowpass filtering
Description
Creates a lowpass filter.
Usage
lowpassFilter(type = c("bessel"), param, sr = 1, len = NULL, shift = 0.5)
## S3 method for class 'lowpassFilter'
print(x, ...)
Arguments
type |
a string specifying the type of the filter, currently only Bessel filters are supported |
param |
a |
sr |
a single numeric giving the sampling rate |
len |
a single integer giving the filter length of the truncated and digitised filter, see Value for more details. By default ( |
shift |
a single numeric between |
x |
the object |
... |
for generic methods only |
Value
An object of class
lowpassFilter
, i.e. a list
that contains
"type"
,"param"
,"sr"
,"len"
the corresponding arguments
"kernfun"
the kernel function of the filter, obtained as the Laplace transform of the corresponding transfer function
"stepfun"
the step-response of the filter, i.e. the antiderivative of the filter kernel
"acfun"
the autocorrelation function, i.e. the convolution of the filter kernel with itself
"acAntiderivative"
the antiderivative of the autocorrelation function
"truncatedKernfun"
the kernel function of the at
len / sr
truncated filter, i.e.kernfun
truncated and rescaled such that the new kernel still integrates to1
"truncatedStepfun"
the step-response of the at
len / sr
truncated filter, i.e. the antiderivative of the kernel of the truncated filter"truncatedAcfun"
the autocorrelation function of the at
len / sr
truncated filter, i.e. the convolution of the kernel of the truncated filter with itself"truncatedAcAntiderivative"
the antiderivative of the autocorrelation function of the at
len / sr
truncated filter"kern"
the digitised filter kernel normalised to one, i.e.
kernfun((0:len + shift) / sr) / sum(kernfun((0:len + shift) / sr))
"step"
the digitised step-response of the filter, i.e.
stepfun((0:len + shift) / sr)
"acf"
the discrete autocorrelation, i.e.
acfun(0:len / sr)
"jump"
the last index of the left half of the filter, i.e.
min(which(ret$step >= 0.5)) - 1L
, it indicates how much a jump is shifted in time by a convolution of the signal with the digitised kernel of the lowpassfilter; if all values are below0.5
,len
is returned with awarning
"number"
for developers; an integer indicating the type of the filter
"list"
for developers; a list containing precomputed quantities to recreate the filter in C++
References
Pein, F., Bartsch, A., Steinem, C., and Munk, A. (2020) Heterogeneous idealization of ion channel recordings - Open channel noise. Submitted.
Pein, F., Tecuapetla-Gómez, I., Schütte, O., Steinem, C., Munk, A. (2018) Fully-automatic multiresolution idealization for filtered ion channel recordings: flickering event detection. IEEE Trans. Nanobioscience, 17(3):300-320.
Pein, F. (2017) Heterogeneous Multiscale Change-Point Inference and its Application to Ion Channel Recordings. PhD thesis, Georg-August-Universität Göttingen. http://hdl.handle.net/11858/00-1735-0000-002E-E34A-7.
Hotz, T., Schütte, O., Sieling, H., Polupanow, T., Diederichsen, U., Steinem, C., and Munk, A. (2013) Idealizing ion channel recordings by a jump segmentation multiresolution filter. IEEE Trans. Nanobioscience, 12(4):376-386.
See Also
Examples
filter <- lowpassFilter(type = "bessel", param = list(pole = 4L, cutoff = 1e3 / 1e4),
sr = 1e4)
# filter kernel, truncated version
plot(filter$kernfun, xlim = c(0, 20 / filter$sr))
t <- seq(0, 20 / filter$sr, 0.01 / filter$sr)
# truncated version looks very similar
lines(t, filter$truncatedKernfun(t), col = "red")
# filter$len (== 11) is chosen automatically
# this ensures that filter$acf < 1e-3 for this lag and at all larger lags
plot(filter$acfun, xlim = c(0, 20 / filter$sr), ylim = c(-0.003, 0.003))
abline(h = 0.001, lty = "22")
abline(h = -0.001, lty = "22")
abline(v = (filter$len - 1L) / filter$sr, col = "grey")
abline(v = filter$len / filter$sr, col = "red")
# filter with sr == 1
filter <- lowpassFilter(type = "bessel", param = list(pole = 4L, cutoff = 1e3 / 1e4))
# filter kernel and its truncated version
plot(filter$kernfun, xlim = c(0, 20 / filter$sr))
t <- seq(0, 20 / filter$sr, 0.01 / filter$sr)
# truncated version looks very similar
lines(t, filter$truncatedKernfun(t), col = "red")
# digitised filter
points((0:filter$len + 0.5) / filter$sr, filter$kern, col = "red", pch = 16)
# without a shift
filter <- lowpassFilter(type = "bessel", param = list(pole = 4L, cutoff = 1e3 / 1e4),
shift = 0)
# filter$kern starts with zero
points(0:filter$len / filter$sr, filter$kern, col = "blue", pch = 16)
# much shorter filter
filter <- lowpassFilter(type = "bessel", param = list(pole = 4L, cutoff = 1e3 / 1e4),
len = 4L)
points((0:filter$len + 0.5) / filter$sr, filter$kern, col = "darkgreen", pch = 16)