Skip to content

← diagnostics package

ComputeImpedance

Compute per-channel impedance for EEG data having an impedance carrier wave.

Currently EEG devices from CGX (Cognionics) are supported, though any device that uses a square wave to compute impedance should work. This node expects to receive raw EEG data having only a Space (channels) and Time axes. Mean impedance is computed over the incoming Packet (in a streaming pipeline this might be a few samples, in an "offline" pipeline, this would be the entire file/session.) Therefore, the outgoing Packet with impedance values will have a Time axis with a single sample (a "singleton" axis) that corresponds to the median timepoint of the incoming data. The impedance values are output through the impedance port, in the form of a Packet with a Space axis and a singleton Time axis. If there are multiple incoming EEG streams with impedance the 'impedance' packet will contain one stream of values for each incoming EEG stream, and given the same name. It is assumed that AssignChannelLocations is placed before this node to remove any non-EEG channels from being computed. Once the buffer (equal to window_length) is full, impedance is recomputed (for window_length) with each incoming sample. Impedance values are expressed in kOhms. Higher values typically indicate poor contact between the electrode and scalp. Good/bad thresholds will vary by device (see your device's documentation for details), but values below 1000 kO would generally be considered good, while those above 5000 kO would be considered bad. Note however that impedance values at or very close to zero (0) may indicate that the reference channel is not connected, or an electrode is not in contact with the body at all. The node can automatically detect and optionally remove the 125Hz impedance carrier wave that is embedded in the EEG signal. This square wave signal is used to compute channel impedance and can be removed without affecting the underlying EEG signal using a four-point moving average filter. Version 1.3.0

Ports/Properties

data

Data from a CGX device that includes an impedance signal.

verbose name
Data
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
INOUT

impedance

Output, a packet containing the impedance values.

verbose name
Impedance
default value
None
port type
DataPort
value type
Packet (can be None)
data direction
OUT

device

EEG headset model used. If Auto, the node will check the stream properties for a "device" property.

verbose name
Device
default value
Auto
port type
EnumPort
value type
str (can be None)

window_length

Window length, in samples, over which the impedance value is computed. Minimum should be 500 to ensure proper computation.

verbose name
Window Length
default value
500
port type
IntPort
value type
int (can be None)

perform_offset_check

When true, the offset of the signal power is computed for each channel, and channels with an abnormally high offset (indicating the electrode is not touching the head) will have their impedance value set to 0 (typically indicating no/invalid impedance data). This should usually be set to True, but you can set to False to see the actual impedance values for such channels (bearing in mind that such low values may not be a reliable indicator of channel signal quality.)

verbose name
Perform Offset Check
default value
True
port type
BoolPort
value type
bool (can be None)

data_passthrough_threshold

Number of channels that can have an impedance value of 0 (high offset), beyond which the data packet will be set to None (so the EEG data will not be passed through). Set to 0 or None to pass data through without this check.

verbose name
Data Passthrough Threshold
default value
7
port type
IntPort
value type
int (can be None)

remove_carrier_wave

Remove the impedance carrier wave (square wave at 125Hz) inserted into the signal by the device and used to compute the channel impedance.

verbose name
Remove Carrier Wave
default value
False
port type
BoolPort
value type
bool (can be None)

auto_detect_carrier

Automatically detect if the impedance carrier wave is present in the signal before attempting to compute impedance.

verbose name
Auto Detect Carrier
default value
True
port type
BoolPort
value type
bool (can be None)

target_freq

Target frequency of the impedance carrier wave (in Hz). This is the frequency at which the impedance carrier wave is expected to be found in the EEG signal. Leave empty to auto detect.

verbose name
Target Freq
default value
None
port type
FloatPort
value type
float (can be None)

verbose

Print impedance values to log stream.

verbose name
Verbose
default value
False
port type
BoolPort
value type
bool (can be None)

set_breakpoint

Set a breakpoint on this node. If this is enabled, your debugger (if one is attached) will trigger a breakpoint.

verbose name
Set Breakpoint (Debug Only)
default value
False
port type
BoolPort
value type
bool (can be None)

metadata

User-definable meta-data associated with the node. Usually reserved for technical purposes.

verbose name
Metadata
default value
{}
port type
DictPort
value type
dict (can be None)