frd: Frequency Domain Data

frdR Documentation

Frequency Domain Data

Description

Define the frd object and associated methods.

Usage

frd(x, ...)

## Default S3 method:
frd(
  x,
  f,
  fu = c("Hz", "rad/s", "normalized"),
  fs = 1,
  type = c("spectrum", "cross-spectrum", "phase", "coherence"),
  yscale = c("linear", "log", "dB"),
  ...
)

## S3 method for class 'frd'
npts(object)

## S3 method for class 'frd'
ns(object)

## S3 method for class 'frd'
fs(object)

fu(object)

## S3 method for class 'frd'
fu(object)

type(object)

## S3 method for class 'frd'
type(object)

yscale(object)

## S3 method for class 'frd'
yscale(object)

## S3 method for class 'frd'
print(x, ...)

## S3 method for class 'frd'
plot(
  x,
  sensors = setdiff(colnames(x), "f"),
  yscale = c("linear", "log", "dB"),
  xlim = c(0, fs(x)/2),
  ylim = NULL,
  ...
)

Arguments

x

object

...

additional arguments passed to functions

f

vector of frequencies

fu

frequency units, Hz (default), rad/s, or normalized

fs

sampling frequency (default: 1)

type

type of data; one of 'spectrum', 'cross-spectrum', 'phase', 'coherence'

yscale

scale of the data, one of 'linear', 'log', 'dB'

object

object

sensors

Numeric. Sensors to plot (default 1:ns)

xlim

Numeric. Lower and upper limits of plot X-axis (default: 0,10)

ylim

Numeric. Lower and upper limits of plot Y-axis (default: -50,50)

Details

The frd object can be used to store frequency domain data. A frd object is a numeric matrix with at least a column named f containing the frequencies, one or more data columns (usually named), and the following attributes:

fs

sampling frequency

fu

frequency units

ns

number of signals, (columns of the matrix)

npts

the number of data points/samples (rows of the matrix)

type

type of data: spectrum, cross-spectrum, phase, coherence

yscale

Y-scale of the data: linear, log, dB

Methods exist to print, summarize, and plot the data.

Value

A frd object, a numeric matrix with attributes fs, ns, npts, type, and yscale. If the input matrix does not have column names, the columns will be named S1 ... Snpts.

Author(s)

Geert van Boxtel, G.J.M.vanBoxtel@gmail.com

Examples

# coming up
f <- 1

# coming up


gjmvanboxtel/eegr documentation built on May 20, 2023, 4:26 a.m.