本文整理匯總了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')