pyFDN.plot_spectrogram#
- pyFDN.plot_spectrogram(ir, fs, *, nperseg=1024, noverlap=None, window='blackman', xlim=(None, None), ylim=(None, None), dynamic_range=80.0, title='Spectrogram', xlabel='Time [s]', ylabel='Frequency [Hz]', height=500, colorscale='Viridis')[source]#
Plot spectrogram of a 1-D signal as a Matplotlib image.
Uses the same default parameters as the Poletti example: Blackman window, 1024-point segments, 75% overlap, log y-axis, dB magnitude.
- Parameters:
ir (
ArrayLike) – Time-domain signal (e.g. one channel of an impulse response).fs (
float) – Sample rate in Hz (for axis labels and frequency scale).nperseg (
int) – Length of each segment for the STFT. Default 1024.noverlap (
int|None) – Number of overlapping samples. Default nperseg // 4 * 3 (75% overlap).window (
str|tuple[Any,...]) – Window name or (name, param). Default “blackman”.xlim (
tuple[float|None,float|None]) – Time axis limits in seconds. Use None for auto.ylim (
tuple[float|None,float|None]) – Frequency axis limits in Hz. Use None for auto (ymax defaults to fs/2).dynamic_range (
float|None) – Color (magnitude) range in dB below the peak of the displayed spectrogram. Default 80. Use None for Plotly’s auto scaling.xlabel (
str) – Axis labels.ylabel (
str) – Axis labels.height (
int) – Figure height in pixels.colorscale (
str) – Colormap name (lowercased to a Matplotlib colormap). Default “Viridis”.
- Returns:
fig
- Return type: