标签:ted pyplot class eterm mat body state 序列 imshow
【持续更新】
matplotlib.pyplot
is a state-based interface to matplotlib. It provides a MATLAB-like way of plotting.
画图。常用:
import matplotlib.pyplot as plt
直接输入原始数据,可以画频谱图。
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)
input parameters |
x | 1-D array or sequence 数组或序列 |
Fs | scalar 标量. The default value is 2. | |
window | callable or ndarray | |
sides | {‘default‘, ‘onesided‘, ‘twosided‘} | |
pad_to | 执行TTF填充的点数,默认none,此时等于NFFT。 | |
NFFT | FFT点数,2的指数最好,默认值256。不能被用作zero padding。可以用pad_to代替。 | |
detrend | {‘none‘, ‘mean‘, ‘linear‘} or callable, default ‘none‘ | |
scale_by_freq |
{bool, optional}. The default is True for MATLAB compatibility. The parameters detrend and scale_by_freq do only apply when mode is set to ‘psd’. |
|
mode | {‘default‘, ‘psd‘, ‘magnitude‘, ‘angle‘, ‘phase‘}. Default is ‘psd‘. | |
scale | {‘default‘, ‘linear‘, ‘dB‘} | |
cmap | A matplotlib.colors.Colormap instance; if None, use default determined by rc |
|
xextent | None or (xmin, xmax) |
output parameters |
spectrum | 2-D array. Columns are the periodograms of successive segments. |
freqs | 1-D array. The frequencies corresponding to the rows in spectrum. | |
t | 1-D array. The times corresponding to midpoints of segments (i.e., the columns in spectrum). | |
im | instance of class AxesImage . The image created by imshow containing the 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).
https://matplotlib.org/tutorials/colors/colormaps.html
标签:ted pyplot class eterm mat body state 序列 imshow
原文地址:https://www.cnblogs.com/ytxwzqin/p/12072028.html