参数
x——输入的信号fs——采样率,默认$2\pi$,正数标量t——时间,向量,或者是datetime类型duration类型的数据,或者表示每个样本之间差值type——用什么方式计算,可选是'power'(default) |'spectrogram'|'persistence'
以下是要写出名字的参数:
FrequencyLimits——频带限制默认;[0 fs/2] 二元向量
FrequencyResolution— Frequency resolution bandwidth频率分辨率实数标量,不能和时间分辨率一起指定。
Leakage— Spectral leakage 泄漏量默认0.5
MinThreshold— Lower bound for nonzero values 非零值的下限默认
-InfNumPowerBins— Number of power bins for persistence spectrum默认256
OverlapPercent— Overlap between adjoining segments 重叠率[0,100)
Reassign— Reassignment option 重新分配??默认 false
TimeResolution时间分辨率TwoSided— Two-sided spectral estimate
Spectrogram Computation spectrogram的计算
To compute the time-dependent spectrum of a nonstationary signal, pspectrum divides the signal into overlapping segments, windows each segment with a Kaiser window, computes the short-time Fourier transform, and then concatenates the transforms to form a matrix. For more information, see Spectrogram Computation with Signal Processing Toolbox.
A nonstationary signal is a signal whose frequency content changes with time. The spectrogram of a nonstationary signal is an estimate of the time evolution of its frequency content. To construct the spectrogram of a nonstationary signal, pspectrum follows these steps:
Divide the signal into equal-length segments. The segments must be short enough that the frequency content of the signal does not change appreciably within a segment. The segments may or may not overlap.
Window each segment and compute its spectrum to get the short-time Fourier transform.
Use the segment spectra to construct the spectrogram:
- If called with output arguments, concatenate the spectra to form a matrix.
- If called with no output arguments, display the power of each spectrum in decibels segment by segment. Depict the magnitudes side-by-side as an image with magnitude-dependent colormap.

