stft
Compute a short-time Fourier transform from a signal and sample rate to return a magnitude spectrogram, saving the matrix or rendering a PNG when needed.
Instructions
Compute a short-time Fourier transform and return the magnitude spectrogram.
The full magnitude matrix is saved as .npz when it exceeds 100 x 100 cells.
``save_spectrogram`` additionally renders a PNG with matplotlib (Agg).
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"signal": "<signal>",
"sample_rate": "<sample_rate>"
},
"name": "stft"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| signal | Yes | ||
| window | No | hann | |
| nperseg | No | ||
| filename | No | ||
| noverlap | No | ||
| sample_rate | Yes | ||
| save_spectrogram | No |