本文整理汇总了Python中matplotlib.mlab._spectral_helper方法的典型用法代码示例。如果您正苦于以下问题:Python mlab._spectral_helper方法的具体用法?Python mlab._spectral_helper怎么用?Python mlab._spectral_helper使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类matplotlib.mlab
的用法示例。
在下文中一共展示了mlab._spectral_helper方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_spectral_helper_raises_complex_same_data
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_raises_complex_same_data(self):
# test that mode 'complex' cannot be used if x is not y
assert_raises(ValueError, mlab._spectral_helper,
x=self.y, y=self.y+1, mode='complex')
示例2: test_spectral_helper_raises_magnitude_same_data
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_raises_magnitude_same_data(self):
# test that mode 'magnitude' cannot be used if x is not y
assert_raises(ValueError, mlab._spectral_helper,
x=self.y, y=self.y+1, mode='magnitude')
示例3: test_spectral_helper_raises_angle_same_data
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_raises_angle_same_data(self):
# test that mode 'angle' cannot be used if x is not y
assert_raises(ValueError, mlab._spectral_helper,
x=self.y, y=self.y+1, mode='angle')
示例4: test_spectral_helper_raises_phase_same_data
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_raises_phase_same_data(self):
# test that mode 'phase' cannot be used if x is not y
assert_raises(ValueError, mlab._spectral_helper,
x=self.y, y=self.y+1, mode='phase')
示例5: test_spectral_helper_raises_unknown_mode
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_raises_unknown_mode(self):
# test that unknown value for mode cannot be used
assert_raises(ValueError, mlab._spectral_helper,
x=self.y, mode='spam')
示例6: test_spectral_helper_raises_noverlap_gt_NFFT
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_raises_noverlap_gt_NFFT(self):
# test that noverlap cannot be larger than NFFT
assert_raises(ValueError, mlab._spectral_helper,
x=self.y, y=self.y, NFFT=10, noverlap=20)
示例7: test_spectral_helper_raises_noverlap_eq_NFFT
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_raises_noverlap_eq_NFFT(self):
# test that noverlap cannot be equal to NFFT
assert_raises(ValueError, mlab._spectral_helper,
x=self.y, NFFT=10, noverlap=10)
示例8: test_spectral_helper_raises_winlen_ne_NFFT
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_raises_winlen_ne_NFFT(self):
# test that the window length cannot be different from NFFT
assert_raises(ValueError, mlab._spectral_helper,
x=self.y, y=self.y, NFFT=10, window=np.ones(9))
示例9: test_spectral_helper_psd
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_psd(self):
freqs = self.freqs_density
spec, fsp, t = mlab._spectral_helper(x=self.y, y=self.y,
NFFT=self.NFFT_density,
Fs=self.Fs,
noverlap=self.nover_density,
pad_to=self.pad_to_density,
sides=self.sides,
mode='psd')
assert_allclose(fsp, freqs, atol=1e-06)
assert_allclose(t, self.t_density, atol=1e-06)
assert_equal(spec.shape[0], freqs.shape[0])
assert_equal(spec.shape[1], self.t_specgram.shape[0])
示例10: test_spectral_helper_magnitude_specgram
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_magnitude_specgram(self):
freqs = self.freqs_specgram
spec, fsp, t = mlab._spectral_helper(x=self.y, y=self.y,
NFFT=self.NFFT_specgram,
Fs=self.Fs,
noverlap=self.nover_specgram,
pad_to=self.pad_to_specgram,
sides=self.sides,
mode='magnitude')
assert_allclose(fsp, freqs, atol=1e-06)
assert_allclose(t, self.t_specgram, atol=1e-06)
assert_equal(spec.shape[0], freqs.shape[0])
assert_equal(spec.shape[1], self.t_specgram.shape[0])
示例11: test_spectral_helper_raises_complex_same_data
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_raises_complex_same_data(self):
# test that mode 'complex' cannot be used if x is not y
with pytest.raises(ValueError):
mlab._spectral_helper(x=self.y, y=self.y+1, mode='complex')
示例12: test_spectral_helper_raises_magnitude_same_data
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_raises_magnitude_same_data(self):
# test that mode 'magnitude' cannot be used if x is not y
with pytest.raises(ValueError):
mlab._spectral_helper(x=self.y, y=self.y+1, mode='magnitude')
示例13: test_spectral_helper_raises_angle_same_data
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_raises_angle_same_data(self):
# test that mode 'angle' cannot be used if x is not y
with pytest.raises(ValueError):
mlab._spectral_helper(x=self.y, y=self.y+1, mode='angle')
示例14: test_spectral_helper_raises_phase_same_data
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_raises_phase_same_data(self):
# test that mode 'phase' cannot be used if x is not y
with pytest.raises(ValueError):
mlab._spectral_helper(x=self.y, y=self.y+1, mode='phase')
示例15: test_spectral_helper_raises_unknown_mode
# 需要导入模块: from matplotlib import mlab [as 别名]
# 或者: from matplotlib.mlab import _spectral_helper [as 别名]
def test_spectral_helper_raises_unknown_mode(self):
# test that unknown value for mode cannot be used
with pytest.raises(ValueError):
mlab._spectral_helper(x=self.y, mode='spam')