analyze_fft
Perform FFT on vibration signals to reveal frequency components and detect machinery faults, returning dominant peaks and spectrum statistics for predictive maintenance.
Instructions
Perform FFT (Fast Fourier Transform) analysis on a stored signal.
FFT analysis converts the signal from time domain to frequency domain,
allowing identification of harmonic components and faults that manifest
at specific frequencies. Requires the signal loaded via load_signal()
first; the sampling rate comes from the stored signal metadata.
By default analyzes the LEADING 1.0-second segment (deterministic:
two identical calls return identical results). Set
segment_duration=None to analyze the entire signal, or pass
random_seed to sample a seeded random segment position instead.
Args:
ctx: MCP context. Unused — see this module's docstring on logging.
signal_id: ID of the stored signal (from load_signal).
max_frequency: Maximum frequency to analyze (default: Nyquist frequency)
segment_duration: Duration in seconds to analyze (default: leading
1.0 s). Set to None to analyze the full signal.
random_seed: Seed for random segment position (default: None =
deterministic leading segment).
Returns:
FFTResult with top peaks, dominant peak, and spectrum stats.
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 | ||
| random_seed | No | ||
| max_frequency | No | ||
| segment_duration | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top_peaks | Yes | Top spectral peaks sorted by magnitude | |
| total_bins | Yes | Total number of FFT bins computed | |
| num_samples | Yes | Number of analyzed samples | |
| rms_spectral | Yes | RMS of the magnitude spectrum | |
| freq_range_hz | Yes | [min_freq, max_freq] of the spectrum | |
| sampling_rate | Yes | Sampling frequency (Hz) | |
| peak_frequency | Yes | Dominant peak frequency (Hz) | |
| peak_magnitude | Yes | Dominant peak magnitude | |
| frequency_resolution | Yes | Frequency resolution (Hz) |