前言
本文为matplotlib.pyplot.specgram官网介绍及部分翻译,仅为学习方便保存整理使用。
matplotlib.pyplot.specgram
matplotlib.pyplot.specgram(x, NFFT=None, Fs=None, Fc=None, detrend=None, window=None, noverlap=None, cmap=None, xextent=None, pad_to=None, sides=None, scale_by_freq=None, mode=None, scale=None, vmin=None, vmax=None, *, data=None, **kwargs)
Plot a spectrogram.
Compute and plot a spectrogram of data in x. Data are split into NFFT length segments and the spectrum of each section is computed. The windowing function window is applied to each segment, and the amount of overlap of each segment is specified with noverlap. The spectrogram is plotted as a colormap (using imshow).
计算并绘制x中数据的频谱图。将数据分为 NFFT个长度段,并计算每个部分的频谱。窗口功能窗口应用于每个片段,并且每个片段的重叠量用noverlap指定。频谱图被绘制为颜色图(使用imshow)。
Parameters
x:1-D array or sequence
Array or sequence containing the data.
一维数组或序列
包含数据的数组或序列。
Fs:float, default: 2
The sampling frequency (samples per time unit). It is used to calculate the Fourier frequencies, freqs, in cycles per time unit.
浮点数,默认值:2
采样频率(每个时间单位采样)。它用于以每个时间单位的周期计算傅立叶频率freqs。
window:callable or ndarray, default: window_hanning
A function or a vector of length NFFT. To create window vectors see window_hanning, window_none, numpy.blackman, numpy.hamming, numpy.bartlett, scipy