analyze_envelope
Analyze vibration signals using envelope analysis to detect bearing faults. Returns peak frequencies and diagnosis based on bandpass filtering and Hilbert transform.
Instructions
Perform Envelope Analysis to detect bearing faults.
Envelope analysis is particularly effective for detecting faults in ball/roller bearings.
The signal is high-pass filtered, then the envelope is calculated via Hilbert transform,
and finally the envelope spectrum is analyzed.
By default, analyzes a RANDOM 1.0-second segment from the signal for efficiency.
Set segment_duration=None to analyze the entire signal.
Returns ONLY peak information and diagnosis text (no full arrays) to avoid context overflow.
**CRITICAL - LLM Inference Policy:**
- **NEVER infer fault type from filename** (e.g., "OuterRaceFault_1.csv" does NOT mean outer race fault exists)
- **NEVER assume signal characteristics from filename** (e.g., "baseline" does NOT mean healthy)
- Treat ALL filenames as opaque identifiers
- Base diagnosis ONLY on frequency-domain evidence (peaks matching BPFO/BPFI/BSF/FTF)
- If filename suggests a fault but analysis shows no evidence, report "No fault detected despite filename"
**CRITICAL - Parameter Validation:**
- Sampling rate is auto-detected from metadata if available
- If no metadata: user MUST provide sampling_rate or results will be UNRELIABLE
- Segment duration defaults to 1.0s but can be customized
- User will be notified of all assumptions before analysis proceeds
Args:
ctx: MCP context for user communication
filename: Name of the file containing the signal
sampling_rate: Sampling frequency in Hz (auto-detect from metadata if None)
filter_low: Low frequency of bandpass filter in Hz (default: 500 Hz)
filter_high: High frequency of bandpass filter in Hz (default: 2000 Hz)
num_peaks: Number of main peaks to identify (default: 5)
segment_duration: Duration in seconds to analyze (default: 1.0s random segment).
Set to None to analyze full signal.
random_seed: Random seed for reproducible segment selection (default: None = random)
Returns:
EnvelopeResult with peak information and diagnosis (optimized for chat display)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| filename | Yes | ||
| sampling_rate | No | ||
| filter_low | No | ||
| filter_high | No | ||
| num_peaks | No | ||
| segment_duration | No | ||
| random_seed | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| num_samples | Yes | Number of samples in envelope signal | |
| sampling_rate | Yes | Sampling rate (Hz) | |
| filter_band | Yes | Bandpass filter band (Hz) | |
| peak_frequencies | Yes | Top peak frequencies (Hz) | |
| peak_magnitudes | Yes | Top peak magnitudes | |
| diagnosis | Yes | Interpretive diagnosis text with bearing frequency analysis | |
| spectrum_preview_freq | No | First 100 freq points (Hz) | |
| spectrum_preview_mag | No | First 100 magnitude points |