read.edf.signals: Reads a selected EDF or EDF+ file and returns all signals...

View source: R/read.edf.signals.R

read.edf.signalsR Documentation

Reads a selected EDF or EDF+ file and returns all signals data

Description

The function reads a selected EDF or EDF+ file. Also resampling can be done (upsampling or downsampling).

Usage

read.edf.signals(
  file,
  resampling = FALSE,
  f.new = NULL,
  from = NULL,
  to = NULL,
  verbose = FALSE
)

Arguments

file

The path to the EDF / EDF+ file to be read.

resampling

If TRUE the frequency of all signals will be upsampling or downsampling, depending on the actual sampling rate of subsequent channel.

f.new

A new frequency (used for upsampling or downsampling).

from

Loading a signal from (given as a second).

to

Loading a signal to (given as a second).

verbose

Flag to print out progress information.

Details

If resampling=TRUE, the frequency of all signals will be upsampled or downsampled, depending on the actual sampling rate of the individual channels and the set value of the f.new parameter. The EDF standard assumes that each channel can be sampled at a different rate. Therefore, it may happen that some channels are upsampled and others are downsampled. The function does not provide the functionality to independently change the sampling rate for each channel.

Value

A list is returned with: 1) data frame with all signals stored in the given edf file, 2) complete result returned by the edf::read.edf() function, 3) sampling rate of the data after possible resampling (upsampled or downsampled), 4) time stamps of the data after possible resampling (upsampled or downsampled).

Examples

file <- system.file("extdata", "EEG.edf", package = "MatchingPursuit")
sigs1  <- read.edf.signals(file, resampling = FALSE)

lapply(sigs1, class)
sigs1$sampling.rate

sigs2 <- read.edf.signals(file, resampling = TRUE, f.new = 128, verbose = TRUE)

lapply(sigs2, class)
sigs2$sampling.rate


MatchingPursuit documentation built on April 9, 2026, 9:08 a.m.