plot_spectrum
Generate interactive FFT spectrum plots with automatic peak detection to identify frequency peaks and harmonics from vibration signals for machinery fault diagnosis.
Instructions
Generate interactive FFT spectrum plot with automatic peak detection.
Creates an interactive HTML plot showing the frequency spectrum up to Nyquist frequency (Fs/2).
Automatically identifies and labels the most significant peaks. If rotation frequency is provided,
identifies harmonics as 1x, 2x, 3x RPM.
Args:
signal_file: Name of the CSV file in data/signals/
sampling_rate: Sampling frequency in Hz (default: 10000)
freq_range: [min_freq, max_freq] to limit the plot range (default: [0, Fs/2])
num_peaks: Number of peaks to identify and label (default: 10)
min_peak_distance: Minimum distance between peaks in Hz (default: 1.0)
rotation_freq: Rotation frequency in Hz for RPM harmonic labeling (optional)
title: Custom plot title (optional)
ctx: MCP context for progress/logging
Returns:
Path to generated HTML file with peak information
Example:
plot_spectrum(
"bearing_signal.csv",
sampling_rate=10000,
rotation_freq=25.0, # 1500 RPM = 25 Hz
num_peaks=15
)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| signal_file | Yes | ||
| sampling_rate | No | ||
| freq_range | No | ||
| num_peaks | No | ||
| min_peak_distance | No | ||
| rotation_freq | No | ||
| title | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |