matplotlib.pyplot.
magnitude_spectrum
(x, Fs=None, Fc=None, window=None, pad_to=None, sides=None, scale=None, *, data=None, **kwargs)[source]¶Plot the magnitude spectrum.
Call signature:
magnitude_spectrum(x, Fs=2, Fc=0, window=mlab.window_hanning,
pad_to=None, sides='default', **kwargs)
Compute the magnitude spectrum of x. Data is padded to a length of pad_to and the windowing function window is applied to the signal.
Parameters: | x : 1-D array or sequence
Fs : scalar
window : callable or ndarray
sides : {'default', 'onesided', 'twosided'}
pad_to : int
scale : {'default', 'linear', 'dB'}
Fc : int
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Returns: | spectrum : 1-D array
freqs : 1-D array
line : a
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Other Parameters: | **kwargs :
|
See also
psd()
psd()
plots the power spectral density.`.angle_spectrum()
angle_spectrum()
plots the angles of the corresponding frequencies.phase_spectrum()
phase_spectrum()
plots the phase (unwrapped angle) of the corresponding frequencies.specgram()
specgram()
can plot the magnitude spectrum of segments within the signal in a colormap.Notes
Note
In addition to the above described arguments, this function can take a data keyword argument. If such a data argument is given, the following arguments are replaced by data[<arg>]:
Objects passed as data must support item access (data[<arg>]
) and
membership test (<arg> in data
).