perda.plotting.fft_plotter#
- perda.plotting.fft_plotter.plot_fft_spectrum(frequencies, magnitudes, series_names, title=None, x_label='Frequency (Hz)', y_label='Magnitude', stacked=True, layout_config=LayoutConfig(width=1200, height=700, margin={'l': 70, 'r': 50, 't': 90, 'b': 70}, plot_bgcolor='white', title_x=0.5, title_xanchor='center', title_yanchor='top', grid_width_per_col=400, grid_height_per_row=350, grid_horizontal_spacing=0.08, grid_vertical_spacing=0.12, max_display_resolution=50), font_config=FontConfig(large=20, medium=14, small=10), fft_config=FFTPlotConfig(log_x=True, log_y=False, line_color='steelblue', height_single=500))[source]#
Plot one or more pre-computed FFT magnitude spectra.
- Parameters:
frequencies (list[NDArray[float64]]) – Frequency axis arrays, one per series.
magnitudes (list[NDArray[float64]]) – Magnitude arrays (same length as corresponding
frequenciesentry), one per series.series_names (list[str]) – Display labels for each series, used as subplot titles when
stacked=Trueand legend entries whenstacked=False.title (str | None, optional) – Overall figure title.
stacked (bool, optional) – If
True, render one subplot per series sharing the x-axis. IfFalse, overlay all series on a single plot. Default is True.layout_config (LayoutConfig, optional) – Figure dimensions and spacing.
font_config (FontConfig, optional) – Font sizes for plot elements.
fft_config (FFTPlotConfig, optional) – Axis scaling, trace color
x_label (str)
y_label (str)
- Return type:
go.Figure
Examples
>>> freqs, mags = compute_fft(di) >>> fig = plot_fft_spectrum([freqs], [mags], [di.label]) >>> fig.show()