Noise filters in the live plot path (see ../filters.ts for the pipeline).
One LiveChannelFilter per plotted channel with filters on sits between
ingestScan and the channel buffer (see drainChannelQueue). It runs every sample
through the causal pipeline and gives each point two more fields: unfiltered (the
calibrated value) and filtered; value, which the plot and the trigger read, is
one or the other depending on the channel's Filtered / Raw switch. The raw volts
stay in raw.
The despike stage needs w - 1 samples after a sample before it can finish it, so
points leave the filter w - 1 samples late (4 samples, 2 ms, at 2 kHz; none at
rates where despike does not run). Every point still comes out exactly once, in
order, with its own timestamp; the last w - 1 points of a batch come out with the
next batch. Gap markers keep their place in the sequence.
Timeline rules, matching the stream's:
A gap of up to MAX_FILLED_GAP_SAMPLES missing samples is filtered through
as NaN; a longer one flushes the held points and restarts the despike window and
the high-/low-pass filters, keeping the templates in phase (same run, so the sample
count is known from the timestamps).
A new run (the batch sequence goes back while time goes forward) flushes the held
points and starts every filter over, templates included.
A buffer reset (timeline jumped back) drops the held points and starts over.
Noise filters in the live plot path (see
../filters.tsfor the pipeline).One LiveChannelFilter per plotted channel with filters on sits between
ingestScanand the channel buffer (seedrainChannelQueue). It runs every sample through the causal pipeline and gives each point two more fields:unfiltered(the calibrated value) andfiltered;value, which the plot and the trigger read, is one or the other depending on the channel's Filtered / Raw switch. The raw volts stay inraw.The despike stage needs
w - 1samples after a sample before it can finish it, so points leave the filterw - 1samples late (4 samples, 2 ms, at 2 kHz; none at rates where despike does not run). Every point still comes out exactly once, in order, with its own timestamp; the lastw - 1points of a batch come out with the next batch. Gap markers keep their place in the sequence.Timeline rules, matching the stream's:
NaN; a longer one flushes the held points and restarts the despike window and the high-/low-pass filters, keeping the templates in phase (same run, so the sample count is known from the timestamps).