當前位置: 首頁>>代碼示例>>Python>>正文


Python mlab._spectral_helper方法代碼示例

本文整理匯總了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') 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:6,代碼來源:test_mlab.py

示例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') 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:6,代碼來源:test_mlab.py

示例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') 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:6,代碼來源:test_mlab.py

示例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') 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:6,代碼來源:test_mlab.py

示例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') 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:6,代碼來源:test_mlab.py

示例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) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:6,代碼來源:test_mlab.py

示例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) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:6,代碼來源:test_mlab.py

示例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)) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:6,代碼來源:test_mlab.py

示例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]) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:17,代碼來源:test_mlab.py

示例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]) 
開發者ID:miloharper,項目名稱:neural-network-animation,代碼行數:17,代碼來源:test_mlab.py

示例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') 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:6,代碼來源:test_mlab.py

示例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') 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:6,代碼來源:test_mlab.py

示例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') 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:6,代碼來源:test_mlab.py

示例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') 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:6,代碼來源:test_mlab.py

示例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') 
開發者ID:holzschu,項目名稱:python3_ios,代碼行數:6,代碼來源:test_mlab.py


注:本文中的matplotlib.mlab._spectral_helper方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。