find.peaks {RespirAnalyzer}R Documentation

Function to find the peak-to-peak intervals of a respiratory signal.

Description

function to find the peak-to-peak intervals of a respiratory signal.

Usage

find.peaks(
  y,
  Fs,
  lowpass = TRUE,
  freq = 1,
  MovingAv = FALSE,
  W = FALSE,
  filter = TRUE,
  threshold = 0.2
)

Arguments

y

a numeric vector, with respiratory data for a regularly spaced time series..

Fs

a positive value. sampling frequency of airflow signal.

lowpass

logical. Whether to use low-pass filtering to preprocess the airflow signal.

freq

an optional values. Cut-off frequency of low-pass filter. The default value is 1.

MovingAv

logical.Whether to use Moving Average to preprocess the airflow signal.

W

an optional values. the windows of Moving Average. The default value is equal to the sampling frequency Fs.

filter

logical.Whether to filter the points of peaks.

threshold

an optional value. A threshold is the minimum height difference between the wave crest and wave trough. The default value is 0.2.

Value

a dataframe for the information of peaks. "PeakIndex" is the position of the peaks and "PeakHeight" is the height of the peaks

References

Zhang T, Dong X, Chen C, Wang D, Zhang XD. RespirAnalyzer: an R package for continuous monitoring of respiratory signals.

Examples

data("TestData") # load Data from TestData dataset
Fs=50 ## sampling frequency is 50Hz
Peaks <- find.peaks(Data[,2],Fs,lowpass=TRUE,freq=1,MovingAv=FALSE,
                    W=FALSE,filter=TRUE,threshold=0.05)
Peaks



[Package RespirAnalyzer version 1.0.2 Index]