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")
# Add other type of episode for a more complete example (this episode does
# not have any physiological meaning)
HRVData <- AddEpisodes(HRVData,InitTimes=c(4500),Durations=c(1000),
Tags="Other", Values = 1)
# Calculating heart rate signal:
HRVData <- BuildNIHR(HRVData)
# Filtering heart rate signal:
HRVData <- FilterNIHR(HRVData)
# Interpolating heart rate signal:
HRVData = InterpolateNIHR(HRVData)
# Calculating and Plotting Spectrogram
spctr <- PlotSpectrogram(HRVData, size = 120, shift = 10, sizesp = 1024,
freqRange=c(0,0.14), color.palette = topo.colors)
spctr <- PlotSpectrogram(HRVData,size=120, shift=60, Tags="all",
ylim=c(0,0.1),
showLegend=T,
eplim = c(0,0.06),
epColorPalette=c("skyblue","white"),
showEpLegend = T,
epLegendCoords = c(15000,0.08),
ymark=c(0.001,0.002))
}
Run the code above in your browser using DataLab