-
sdr.plot.periodogram(x: ArrayLike, sample_rate: float | None =
None, window: str | ArrayLike ='hann', length: int | None =None, overlap: int | None =None, fft: int | None =None, detrend: 'constant' | 'linear' | False =False, average: 'mean' | 'median' ='mean', x_axis: 'auto' | 'one-sided' | 'two-sided' | 'log' ='auto', y_axis: 'linear' | 'log' ='log', ax: plt.Axes | None =None, **kwargs) Plots the estimated power spectral density \(P_{xx}\) of a time-domain signal \(x[n]\) using Welch’s method.
Note
This function uses
scipy.signal.welch()to estimate the power spectral density of the time-domain signal.- Parameters:¶
- x: ArrayLike¶
The time-domain signal \(x[n]\).
- sample_rate: float | None =
None¶ The sample rate \(f_s\) of the signal in samples/s. If
None, the x-axis will be labeled as “Normalized Frequency”.- window: str | ArrayLike =
'hann'¶ The windowing function to use. This can be a string or a vector of length
length.- length: int | None =
None¶ The length of each segment in samples. If
None, the length is set to 256.- overlap: int | None =
None¶ The number of samples to overlap between segments. If
None, the overlap is set tolength // 2.- fft: int | None =
None¶ The number of points to use in the FFT. If
None, the FFT length is set tolength.- detrend: 'constant' | 'linear' | False =
False¶ The type of detrending to apply. Options are to remove the mean or a linear trend from each segment.
- average: 'mean' | 'median' =
'mean'¶ The type of averaging to use. Options are to average the periodograms using the mean or median.
- x_axis: 'auto' | 'one-sided' | 'two-sided' | 'log' =
'auto'¶ The x-axis scaling. Options are to display a one-sided spectrum, a two-sided spectrum, or one-sided spectrum with a logarithmic frequency axis. The default is
"auto"which selects"one-sided"for real-valued signals and"two-sided"for complex-valued signals.- y_axis: 'linear' | 'log' =
'log'¶ The y-axis scaling. Options are to display a linear or logarithmic power spectral density.
- ax: plt.Axes | None =
None¶ The axis to plot on. If
None, the current axis is used.- **kwargs¶
Additional keyword arguments to pass to
matplotlib.pyplot.plot().