if (FALSE) {
# Read file "a03" from the physionet apnea-ecg database
library(RHRV)
HRVData <- CreateHRVData()
HRVData <- LoadBeatWFDB(HRVData,RecordName="test_files/WFDB/a03")
HRVData <- LoadApneaWFDB(HRVData,RecordName="test_files/WFDB/a03")
# Calculating heart rate signal:
HRVData <- BuildNIHR(HRVData)
# Filtering heart rate signal:
HRVData <- FilterNIHR(HRVData)
# Interpolating heart rate signal:
HRVData = InterpolateNIHR(HRVData)
HRVData = CreateFreqAnalysis(HRVData)
HRVData = CalculatePowerBand(HRVData, indexFreqAnalysis = 1,
size = 300, shift = 60, sizesp = 1024)
layout(matrix(1:4, nrow = 2))
PlotSinglePowerBand(HRVData, 1, "VLF", Tags = "APNEA", epColorPalette = "red",
epLegendCoords = c(2000,7500))
PlotSinglePowerBand(HRVData, 1, "LF", Tags = "APNEA", epColorPalette = "red",
eplim = c(0,6000),
markEpisodes = F, showEpLegend = FALSE)
PlotSinglePowerBand(HRVData, 1, "HF", Tags = "APNEA", epColorPalette = "red",
epLegendCoords = c(2000,1700))
PlotSinglePowerBand(HRVData, 1, "LF/HF", Tags = "APNEA", epColorPalette = "red",
eplim = c(0,20),
markEpisodes = F, showEpLegend = FALSE)
# Reset layout
par(mfrow = c(1,1))
}
Run the code above in your browser using DataLab