header_table() modifies the data.table class to work with
header data. The header data is read in from a similar format as to that of
WFDB files and should be compatible/interchangeable when writing out to disk.
The details extensively cover the type of data that is input. Generally, this
function is called by read_*_header() functions and will generally not be
called by the end-user.
header_table(
record_name = character(),
number_of_channels = integer(),
frequency = 250,
samples = integer(),
start_time = strptime(Sys.time(), "%Y-%m-%d %H:%M:%OSn"),
ADC_saturation = integer(),
file_name = character(),
storage_format = 16L,
ADC_gain = 200L,
ADC_baseline = ADC_zero,
ADC_units = "mV",
ADC_resolution = 12L,
ADC_zero = 0L,
initial_value = ADC_zero,
checksum = 0L,
blocksize = 0L,
label = character(),
info_strings = list(),
additional_gain = 1,
low_pass = integer(),
high_pass = integer(),
color = "#000000",
scale = integer()
)is_header_table(x)
A header_table object that is an extension of the data.table
class. This contains an adaptation of the function arguments, allowing for compatibility with the WFDB class.
A character vector of record line information
An integer describing number of signals
A numeric value of sampling frequency, 250 Hz default
An integer for the number of samples
The POSIXct time of recording, with miliseconds included.
For example, strptime(start_time, "%Y-%m-%d %H:%M%:%OSn") where as
described in base::strptime()
An integer representing ADC saturation
A character for the signal specific information
An integer of the bits for the storage format, 16-bit
default
An integer of ADC gain, default of 200
An integer of ADC baseline, defaults to ADC_zero
A character to describe ADC units, "mV" is default
An integer for ADC resolution, default is 12
An integer for ADC zero, defaults to 0
An integer for the initial value, defaults to
ADC_zero value
An integer that serves as the checksum
An integer of the block size
A character description of the signal
A list of strings that will be written as an appendix
to the header file, usually containing information about the channels,
(e.g. list of colors, extra labels, etc).
A numeric Additional gain, defaults to 1.0
An integer Low pass filter
An integer High pass filter
A character Color as hexadecimal format, defaults to black
An integer Scale
A data.table object that serves as the header table
There are three components to the header file:
Record line that contains the following information, in the order documented, however pieces may be missing based on different parameters. From left to right...
Record name
Number of signals: represents number of segments/channels
Sampling frequency (optional)
Number of samples (optional)
Time: in HH:MM:SS format (optional)
Date: in DD/MM/YYYY (optional)
Signal specification lines contains specifications for individual signals, and there must be as many signal lines as there are reported by the above record line. From left to right....
File name: usually *.dat
Format integer: represents storage type, e.g. 8-bit or 16-bit
ADC gain: ADC units per physical unit (optional)
Baseline: corresponds to 0 physical units, sep = '*(0)" (optional)
Units: with '/' as a field separator e.g '*/mV' (optional)
ADC resolution integer: bits, usually 8 or 16 (optional)
ADC zero: represents middle of ADC input range (optional)
Initial value (optional)
Checksum (optional)
Block size (optional)
Description: text or label information (optional)
Info strings are unstructured lines that contains information about the record. Usually are descriptive. Starts with initial '#' without preceding white space at beginning of line.
The header_table object is relatively complex in that it directly
deals with properties of the signal, and allows compatibility with WFDB
files and other raw header files for other signal objects. It can be written
out using write_wfdb().