Data Lab node
Signal Compare
Two Signals side by side, channel by channel: A − B as a Signal (B is resampled onto A’s rate, both end now), the RMS error, Pearson r, the mean ratio A/B, and the lag (ms, positive = A leads) at which the two correlate best, searched up to Max Lag. Before/after a filter, left vs right, a sensor against its prediction.
Inputs
| Port | Type | Default |
|---|---|---|
| Signal AThe reference; the output keeps A’s rate, unit and labels. | structure | — |
| Signal BWhat is compared to A; resampled onto A’s rate if theirs differ. Channels are paired in order. | structure | — |
| Max LagHow far (ms) the lag search looks in both directions. | float | 200 |
| Update RateHow many times per second the analysis is recomputed (default 30); 0 = every frame. Lower rates save CPU on long windows — a moved parameter always recomputes at once. | float | 30 |
Outputs
| Port | Type |
|---|---|
| Difference | structure |
| Latest | float |
| RMSE | float |
| Pearson | float |
| Lag | float |
| Lag Correlation | float |
| Ratio | float |
How It Works
Signal Compare puts two Signals side by side, channel by channel. B is resampled onto A's rate and both are aligned to end now, so the comparison is apples to apples.
It reports: Difference (A − B) as a Signal you can plot, the RMSE, the Pearson correlation coefficient, the mean Ratio A/B, and — the interesting one — the Lag in milliseconds at which the two correlate best, searched up to Max Lag, with positive meaning A leads. Lag Correlation is how good that best match actually was.
Use Cases
- Before and after a filter — Cable the raw and the filtered window in and see exactly what the filter removed.
- Who leads? — Two sensors, or two EEG channels: the Lag output says which one moves first and by how long.
- Left against right — Stereo or hemispheric asymmetry as one number.
- Prediction against reality — A model's output versus the measurement, with RMSE as the score.
- Calibration — Ratio tells you the gain between two sensors measuring the same thing.
Tips
- Pearson ignores scale and offset; RMSE does not. Use both — they answer different questions.
- A high Lag Correlation is what makes a Lag trustworthy. A confident lag with a weak correlation means nothing.
- Set Max Lag from what is physically plausible; a wide search finds spurious matches.
- Band-pass both signals first when you care about the timing of one rhythm rather than of everything.
- The Difference Signal keeps A's unit, so it plots correctly beside the originals.
Open Signal Compare in the interactive catalog →
Signal Compare is one of 381 nodes in Grafit Pro.
Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.