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.
Usage
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)Arguments
- record_name
A
charactervector of record line information- number_of_channels
An
integerdescribing number of signals- frequency
A
numericvalue of sampling frequency, 250 Hz default- samples
An
integerfor the number of samples- start_time
The
POSIXcttime of recording, with miliseconds included. For example,strptime(start_time, "%Y-%m-%d %H:%M%:%OSn")where as described inbase::strptime()- ADC_saturation
An
integerrepresenting ADC saturation- file_name
A
characterfor the signal specific information- storage_format
An
integerof the bits for the storage format, 16-bit default- ADC_gain
An
integerof ADC gain, default of 200- ADC_baseline
An
integerof ADC baseline, defaults to ADC_zero- ADC_units
A
characterto describe ADC units, "mV" is default- ADC_resolution
An
integerfor ADC resolution, default is 12- ADC_zero
An
integerfor ADC zero, defaults to 0- initial_value
An
integerfor the initial value, defaults to ADC_zero value- checksum
An
integerthat serves as the checksum- blocksize
An
integerof the block size- label
A
characterdescription of the signal- info_strings
A
listof 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).- additional_gain
A
numericAdditional gain, defaults to 1.0- low_pass
An
integerLow pass filter- high_pass
An
integerHigh pass filter- color
A
characterColor as hexadecimal format, defaults to black- scale
An
integerScale- x
A
data.tableobject that serves as the header table
Value
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.
Details
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().
Header file structure
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-bitADC 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.