本文整理汇总了Python中matplotlib.mlab.specgram方法的典型用法代码示例。如果您正苦于以下问题:Python mlab.specgram方法的具体用法?Python mlab.specgram怎么用?Python mlab.specgram使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在模块matplotlib.mlab的用法示例。

在下文中一共展示了mlab.specgram方法的18个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_specgram_auto

​点赞 7

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_auto(self):

freqs = self.freqs_specgram

spec, fsp, t = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides)

specm = np.mean(spec, axis=1)

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])

# since we are using a single freq, all time slices

# should be about the same

if np.abs(spec.max()) != 0:

assert_allclose(np.diff(spec, axis=1).max()/np.abs(spec.max()), 0,

atol=1e-02)

self.check_freqs(specm, freqs, fsp, self.fstims)

开发者ID:miloharper,项目名称:neural-network-animation,代码行数:24,

示例2: test_specgram_default

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_default(self):

freqs = self.freqs_specgram

spec, fsp, t = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='default')

specm = np.mean(spec, axis=1)

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])

# since we are using a single freq, all time slices

# should be about the same

if np.abs(spec.max()) != 0:

assert_allclose(np.diff(spec, axis=1).max()/np.abs(spec.max()), 0,

atol=1e-02)

self.check_freqs(specm, freqs, fsp, self.fstims)

开发者ID:miloharper,项目名称:neural-network-animation,代码行数:25,

示例3: test_specgram_psd

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_psd(self):

freqs = self.freqs_specgram

spec, fsp, t = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='psd')

specm = np.mean(spec, axis=1)

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])

# since we are using a single freq, all time slices

# should be about the same

if np.abs(spec.max()) != 0:

assert_allclose(np.diff(spec, axis=1).max()/np.abs(spec.max()), 0,

atol=1e-02)

self.check_freqs(specm, freqs, fsp, self.fstims)

开发者ID:miloharper,项目名称:neural-network-animation,代码行数:24,

示例4: test_specgram_complex

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_complex(self):

freqs = self.freqs_specgram

spec, fsp, t = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='complex')

specm = np.mean(np.abs(spec), axis=1)

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])

self.check_freqs(specm, freqs, fsp, self.fstims)

开发者ID:miloharper,项目名称:neural-network-animation,代码行数:19,

示例5: test_specgram_magnitude

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_magnitude(self):

freqs = self.freqs_specgram

spec, fsp, t = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='magnitude')

specm = np.mean(spec, axis=1)

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])

# since we are using a single freq, all time slices

# should be about the same

if np.abs(spec.max()) != 0:

assert_allclose(np.diff(spec, axis=1).max()/np.abs(spec.max()), 0,

atol=1e-02)

self.check_freqs(specm, freqs, fsp, self.fstims)

开发者ID:miloharper,项目名称:neural-network-animation,代码行数:23,

示例6: test_specgram_phase

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_phase(self):

freqs = self.freqs_specgram

spec, fsp, t = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='phase')

specm = np.mean(spec, axis=1)

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,代码行数:18,

示例7: test_specgram_auto_default_equal

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_auto_default_equal(self):

'''test that mlab.specgram without mode and with mode 'default' and

'psd' are all the same'''

freqs = self.freqs_specgram

speca, freqspeca, ta = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides)

specb, freqspecb, tb = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='default')

assert_array_equal(speca, specb)

assert_array_equal(freqspeca, freqspecb)

assert_array_equal(ta, tb)

开发者ID:miloharper,项目名称:neural-network-animation,代码行数:22,

示例8: test_specgram_auto_psd_equal

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_auto_psd_equal(self):

'''test that mlab.specgram without mode and with mode 'default' and

'psd' are all the same'''

freqs = self.freqs_specgram

speca, freqspeca, ta = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides)

specc, freqspecc, tc = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='psd')

assert_array_equal(speca, specc)

assert_array_equal(freqspeca, freqspecc)

assert_array_equal(ta, tc)

开发者ID:miloharper,项目名称:neural-network-animation,代码行数:22,

示例9: test_specgram_complex_mag_equivalent

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_complex_mag_equivalent(self):

freqs = self.freqs_specgram

specc, freqspecc, tc = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='complex')

specm, freqspecm, tm = mlab.specgram(x=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_array_equal(freqspecc, freqspecm)

assert_array_equal(tc, tm)

assert_allclose(np.abs(specc), specm, atol=1e-06)

开发者ID:miloharper,项目名称:neural-network-animation,代码行数:22,

示例10: test_specgram_complex_angle_equivalent

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_complex_angle_equivalent(self):

freqs = self.freqs_specgram

specc, freqspecc, tc = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='complex')

speca, freqspeca, ta = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='angle')

assert_array_equal(freqspecc, freqspeca)

assert_array_equal(tc, ta)

assert_allclose(np.angle(specc), speca, atol=1e-06)

开发者ID:miloharper,项目名称:neural-network-animation,代码行数:22,

示例11: test_specgram_angle_phase_equivalent

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_angle_phase_equivalent(self):

freqs = self.freqs_specgram

speca, freqspeca, ta = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='angle')

specp, freqspecp, tp = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='phase')

assert_array_equal(freqspeca, freqspecp)

assert_array_equal(ta, tp)

assert_allclose(np.unwrap(speca, axis=0), specp,

atol=1e-06)

开发者ID:miloharper,项目名称:neural-network-animation,代码行数:23,

示例12: test_specgram_auto

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_auto(self):

freqs = self.freqs_specgram

spec, fsp, t = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides)

specm = np.mean(spec, axis=1)

assert_allclose(fsp, freqs, atol=1e-06)

assert_allclose(t, self.t_specgram, atol=1e-06)

assert spec.shape[0] == freqs.shape[0]

assert spec.shape[1] == self.t_specgram.shape[0]

# since we are using a single freq, all time slices

# should be about the same

if np.abs(spec.max()) != 0:

assert_allclose(np.diff(spec, axis=1).max()/np.abs(spec.max()), 0,

atol=1e-02)

self.check_freqs(specm, freqs, fsp, self.fstims)

开发者ID:holzschu,项目名称:python3_ios,代码行数:24,

示例13: test_specgram_default

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_default(self):

freqs = self.freqs_specgram

spec, fsp, t = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='default')

specm = np.mean(spec, axis=1)

assert_allclose(fsp, freqs, atol=1e-06)

assert_allclose(t, self.t_specgram, atol=1e-06)

assert spec.shape[0] == freqs.shape[0]

assert spec.shape[1] == self.t_specgram.shape[0]

# since we are using a single freq, all time slices

# should be about the same

if np.abs(spec.max()) != 0:

assert_allclose(np.diff(spec, axis=1).max()/np.abs(spec.max()), 0,

atol=1e-02)

self.check_freqs(specm, freqs, fsp, self.fstims)

开发者ID:holzschu,项目名称:python3_ios,代码行数:25,

示例14: test_specgram_psd

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_psd(self):

freqs = self.freqs_specgram

spec, fsp, t = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='psd')

specm = np.mean(spec, axis=1)

assert_allclose(fsp, freqs, atol=1e-06)

assert_allclose(t, self.t_specgram, atol=1e-06)

assert spec.shape[0] == freqs.shape[0]

assert spec.shape[1] == self.t_specgram.shape[0]

# since we are using a single freq, all time slices

# should be about the same

if np.abs(spec.max()) != 0:

assert_allclose(np.diff(spec, axis=1).max()/np.abs(spec.max()), 0,

atol=1e-02)

self.check_freqs(specm, freqs, fsp, self.fstims)

开发者ID:holzschu,项目名称:python3_ios,代码行数:24,

示例15: test_specgram_complex

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_complex(self):

freqs = self.freqs_specgram

spec, fsp, t = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='complex')

specm = np.mean(np.abs(spec), axis=1)

assert_allclose(fsp, freqs, atol=1e-06)

assert_allclose(t, self.t_specgram, atol=1e-06)

assert spec.shape[0] == freqs.shape[0]

assert spec.shape[1] == self.t_specgram.shape[0]

self.check_freqs(specm, freqs, fsp, self.fstims)

开发者ID:holzschu,项目名称:python3_ios,代码行数:19,

示例16: test_specgram_magnitude

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_magnitude(self):

freqs = self.freqs_specgram

spec, fsp, t = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='magnitude')

specm = np.mean(spec, axis=1)

assert_allclose(fsp, freqs, atol=1e-06)

assert_allclose(t, self.t_specgram, atol=1e-06)

assert spec.shape[0] == freqs.shape[0]

assert spec.shape[1] == self.t_specgram.shape[0]

# since we are using a single freq, all time slices

# should be about the same

if np.abs(spec.max()) != 0:

assert_allclose(np.diff(spec, axis=1).max()/np.abs(spec.max()), 0,

atol=1e-02)

self.check_freqs(specm, freqs, fsp, self.fstims)

开发者ID:holzschu,项目名称:python3_ios,代码行数:23,

示例17: test_specgram_phase

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_phase(self):

freqs = self.freqs_specgram

spec, fsp, t = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='phase')

specm = np.mean(spec, axis=1)

assert_allclose(fsp, freqs, atol=1e-06)

assert_allclose(t, self.t_specgram, atol=1e-06)

assert spec.shape[0] == freqs.shape[0]

assert spec.shape[1] == self.t_specgram.shape[0]

开发者ID:holzschu,项目名称:python3_ios,代码行数:18,

示例18: test_specgram_complex_phase_equivalent

​点赞 6

# 需要导入模块: from matplotlib import mlab [as 别名]

# 或者: from matplotlib.mlab import specgram [as 别名]

def test_specgram_complex_phase_equivalent(self):

freqs = self.freqs_specgram

specc, freqspecc, tc = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='complex')

specp, freqspecp, tp = mlab.specgram(x=self.y,

NFFT=self.NFFT_specgram,

Fs=self.Fs,

noverlap=self.nover_specgram,

pad_to=self.pad_to_specgram,

sides=self.sides,

mode='phase')

assert_array_equal(freqspecc, freqspecp)

assert_array_equal(tc, tp)

assert_allclose(np.unwrap(np.angle(specc), axis=0), specp,

atol=1e-06)

开发者ID:holzschu,项目名称:python3_ios,代码行数:23,

注:本文中的matplotlib.mlab.specgram方法示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。

python的mag模块_Python mlab.specgram方法代码示例相关推荐

  1. python安装mlab库_Python mlab.normpdf方法代码示例

    本文整理汇总了Python中matplotlib.mlab.normpdf方法的典型用法代码示例.如果您正苦于以下问题:Python mlab.normpdf方法的具体用法?Python mlab.n ...

  2. python session模块_Python backend.set_session方法代码示例

    本文整理汇总了Python中keras.backend.set_session方法的典型用法代码示例.如果您正苦于以下问题:Python backend.set_session方法的具体用法?Pyth ...

  3. python gc模块_Python gc.collect方法代码示例

    本文整理汇总了Python中gc.collect方法的典型用法代码示例.如果您正苦于以下问题:Python gc.collect方法的具体用法?Python gc.collect怎么用?Python ...

  4. python连接redis哨兵_Python redis.sentinel方法代码示例

    本文整理汇总了Python中redis.sentinel方法的典型用法代码示例.如果您正苦于以下问题:Python redis.sentinel方法的具体用法?Python redis.sentine ...

  5. python程序异常实例_Python werkzeug.exceptions方法代码示例

    本文整理汇总了Python中werkzeug.exceptions方法的典型用法代码示例.如果您正苦于以下问题:Python werkzeug.exceptions方法的具体用法?Python wer ...

  6. python中geometry用法_Python geometry.Point方法代码示例

    本文整理汇总了Python中shapely.geometry.Point方法的典型用法代码示例.如果您正苦于以下问题:Python geometry.Point方法的具体用法?Python geome ...

  7. python re 简单实例_Python re.search方法代码示例

    本文整理汇总了Python中re.search方法的典型用法代码示例.如果您正苦于以下问题:Python re.search方法的具体用法?Python re.search怎么用?Python re. ...

  8. python中config命令_Python config.config方法代码示例

    本文整理汇总了Python中config.config方法的典型用法代码示例.如果您正苦于以下问题:Python config.config方法的具体用法?Python config.config怎么 ...

  9. python中fact用法_Python covariance.EllipticEnvelope方法代码示例

    本文整理汇总了Python中sklearn.covariance.EllipticEnvelope方法的典型用法代码示例.如果您正苦于以下问题:Python covariance.EllipticEn ...

最新文章

  1. 2022-2028年中国可生物降解农用薄膜产业竞争现状及投资决策建议报告
  2. 提高班第三周周记(中秋第二天)
  3. 如何在Ubuntu 20.04上设置Python虚拟环境
  4. 几个常见的 slice 错误
  5. SLF4JLoggerContext cannot be cast to LoggerContext
  6. 产品经理常犯的七大错误
  7. 去重 属性_赛尔原创@EMNLP2020|开放域对话系统的属性一致性识别
  8. 使用Github官方提供的gitignore过滤Git提交的文件
  9. Windows 8 Directx 开发学习笔记(三)摄像机设置及控制正方体旋转
  10. python通用数据库连接_python-sqlalchemy 使用学习记录之基础连接数据库安装接篇...
  11. js使用xlsx读取excel文件
  12. java中的BigDecimal类型
  13. ps中基色 混合色 结果色是什么
  14. 飞天云动港交所上市:市值39亿港元 成港股元宇宙第一股
  15. 爬取QQ空间说说日志、好友个人信息并进行加密
  16. 水桶平分 java,JAVA路线
  17. 软件测试面试题:所有的软件缺陷都能修复吗?所有的软件缺陷都要修复吗?
  18. 江苏凤凰职教计算机教案,2017年江苏省职业学校教学大赛方案
  19. 矩阵理论——内积空间
  20. 跨专业考浙大计算机考研难度,0基础跨专业计算机考研经验-2013浙大

热门文章

  1. 安装UEFI+GPT系统手记
  2. ArcGIS导入坐标点文件创建面状图层
  3. 逻辑地址空间和物理地址空间
  4. Kafka Rebalance机制
  5. 从电影《雄狮少年》看CG技术(二)
  6. QT--从textEdit中获取数据
  7. day06-14-stream中间操作
  8. VMware Workstation 在此主机上不支持嵌套虚拟化。报错一秒解决
  9. 【Kafka Connect】
  10. 3.4 主存储器与CPU的连接