Record Class WfdbSignal
java.lang.Object
java.lang.Record
com.framed.communicator.driver.protocol.mimic.WfdbSignal
- Record Components:
fileName- name of the.datfile holding this signal's samples (relative to the header), or"~"for a layout-header placeholder signalformat- WFDB storage format code (e.g.80,16,212)byteOffset- preamble length in bytes to skip at the start offileName(the+Ndecorator on the format field;0if absent)gain- ADC units per physical unit;0means uncalibratedbaseline- ADC value corresponding to a physical value of0units- physical unit string (e.g."mV","mmHg"); may benulldescription- human-readable signal name (e.g."II","PLETH","ABP")
public record WfdbSignal(String fileName, int format, int byteOffset, double gain, int baseline, String units, String description)
extends Record
The specification of a single signal, as declared on one signal-specification line of a
WFDB header file.
All fields are taken verbatim from the header; the physical value of a raw ADC sample is
recovered with toPhysical(int) using the WFDB convention
physical = (adc - baseline) / gain. A gain of 0 marks the signal as
uncalibrated: no physical unit is defined and the raw ADC value is passed through
unchanged (see uncalibrated()).
-
Constructor Summary
ConstructorsConstructorDescriptionWfdbSignal(String fileName, int format, int byteOffset, double gain, int baseline, String units, String description) Creates an instance of aWfdbSignalrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintbaseline()Returns the value of thebaselinerecord component.intReturns the value of thebyteOffsetrecord component.Returns the value of thedescriptionrecord component.final booleanIndicates whether some other object is "equal to" this one.fileName()Returns the value of thefileNamerecord component.intformat()Returns the value of theformatrecord component.doublegain()Returns the value of thegainrecord component.final inthashCode()Returns a hash code value for this object.doubletoPhysical(int adc) Converts a raw ADC sample to its physical value using(adc - baseline) / gain.final StringtoString()Returns a string representation of this record class.booleanWhether this signal is uncalibrated (WFDB gain0).units()Returns the value of theunitsrecord component.
-
Constructor Details
-
WfdbSignal
public WfdbSignal(String fileName, int format, int byteOffset, double gain, int baseline, String units, String description) Creates an instance of aWfdbSignalrecord class.- Parameters:
fileName- the value for thefileNamerecord componentformat- the value for theformatrecord componentbyteOffset- the value for thebyteOffsetrecord componentgain- the value for thegainrecord componentbaseline- the value for thebaselinerecord componentunits- the value for theunitsrecord componentdescription- the value for thedescriptionrecord component
-
-
Method Details
-
uncalibrated
public boolean uncalibrated()Whether this signal is uncalibrated (WFDB gain0). Uncalibrated signals carry no physical unit andtoPhysical(int)returns the raw ADC value.- Returns:
trueifgain()is0
-
toPhysical
public double toPhysical(int adc) Converts a raw ADC sample to its physical value using(adc - baseline) / gain.- Parameters:
adc- the raw (already format-decoded, sign-corrected) ADC sample value- Returns:
- the physical value, or the unchanged
adcwhenuncalibrated()
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
fileName
Returns the value of thefileNamerecord component.- Returns:
- the value of the
fileNamerecord component
-
format
public int format()Returns the value of theformatrecord component.- Returns:
- the value of the
formatrecord component
-
byteOffset
public int byteOffset()Returns the value of thebyteOffsetrecord component.- Returns:
- the value of the
byteOffsetrecord component
-
gain
public double gain()Returns the value of thegainrecord component.- Returns:
- the value of the
gainrecord component
-
baseline
public int baseline()Returns the value of thebaselinerecord component.- Returns:
- the value of the
baselinerecord component
-
units
Returns the value of theunitsrecord component.- Returns:
- the value of the
unitsrecord component
-
description
Returns the value of thedescriptionrecord component.- Returns:
- the value of the
descriptionrecord component
-
