analyze_signal_trend
Screen a signal recording for significant feature trend and degradation onset using per-segment analysis and baseline comparison.
Instructions
Within-recording screening: feature trend + degradation onset.
THE unified screening tool: feature trend AND degradation
onset in one call. Segments a single recording
(seconds of data), extracts the requested feature per segment,
tests whether the per-segment values show a statistically
significant trend (slope p < 0.05), and detects the first segment
AFTER the baseline window (first half of the series) whose value
exceeds baseline mean + onset_threshold_sigma standard deviations.
Onset inside the baseline window cannot be detected (the baseline
defines "normal"). Requires the signal loaded via load_signal()
first; the sampling rate comes from the stored signal metadata.
This is a SCREENING tool, not a prognosis: a trend inside seconds
of signal says whether the recording is stationary, not how long
the machine will live. For Remaining Useful Life, collect repeated
measurements over days/weeks (one recording per session) and pass
them to estimate_rul — this tool returns the per-segment feature
series so each recording can be reduced to one measurement point.
Args:
ctx: MCP context for user communication.
signal_id: ID of the stored signal (from load_signal).
feature_name: Time-domain feature to analyze (default: "rms").
segment_duration: Duration of each segment in seconds.
overlap_ratio: Overlap between segments (0-1).
onset_threshold_sigma: Baseline standard deviations above the
baseline mean that trigger onset detection (default: 3.0).
Returns:
TrendAnalysisResult with slope, direction (p-value based),
fit quality, the (truncated) per-segment feature series, and
the onset-detection outcome (onset_detected,
onset_segment_index, onset_time_s, baseline_segments).
Raises:
ValueError: If the signal_id is not loaded, or the stored
signal has no sampling rate.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| signal_id | Yes | ||
| feature_name | No | rms | |
| overlap_ratio | No | ||
| segment_duration | No | ||
| onset_threshold_sigma | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| slope | Yes | Trend slope in feature units per second (within the recording) | |
| p_value | No | Two-sided p-value of the slope (None when not computable) | |
| intercept | Yes | Trend intercept | |
| r_squared | Yes | R-squared goodness of fit of the linear trend | |
| feature_name | Yes | Feature analyzed | |
| num_segments | Yes | Number of segments analyzed | |
| onset_time_s | No | Center time (s) of the onset segment within the recording | |
| analysis_scope | Yes | Always 'within_recording_screening': this trend spans seconds of one recording, not the machine's life | |
| feature_series | Yes | Per-segment feature values (evenly subsampled to at most 50 points). One recording yields ONE point for estimate_rul (e.g. the recording's overall feature value) — accumulate recordings over time to build its input series. | |
| onset_detected | Yes | Whether a degradation onset was detected after the baseline window (first value exceeding baseline mean + onset_threshold_sigma * std) | |
| segment_times_s | Yes | Segment center times in seconds for feature_series (same subsampling) | |
| trend_direction | Yes | increasing, decreasing, or stable — based on the slope significance test (p < 0.05), not on an R-squared cutoff | |
| series_truncated | Yes | True when feature_series was subsampled to the 50-point cap | |
| baseline_segments | Yes | Number of leading segments used as the baseline window. Onset is only searched AFTER this window; degradation starting inside the baseline cannot be detected by this method. | |
| onset_segment_index | No | Segment index where degradation starts (always >= baseline_segments); None when no onset detected | |
| onset_threshold_sigma | Yes | Baseline standard deviations used as the onset trigger |