Did I find the right examples for you? yes no      Crawl my project      Python Jobs

cogent.maths.period.auto_corr

All Samples(12)  |  Call(8)  |  Derive(0)  |  Import(4)

from numpy import arange, convolve, random, sin, pi, exp, array, zeros, float64
from cogent.util.unit_test import TestCase, main

from cogent.maths.period import ipdft, dft, auto_corr, hybrid, goertzel

def test_autocorr(self):
"""correctly compute autocorrelation"""
s = [1,1,1,1]
X, periods = auto_corr(s, llim=-3, ulim=None)
exp_X = array([1,2,3,4,3,2,1], dtype=float)
self.assertEqual(X, exp_X)

auto_x, auto_periods = auto_corr(self.sig, llim=2, ulim=50)
def test_hybrid_returns_all(self):
"""correctly returns hybrid, ipdft and autocorr statistics"""
ipdft_pwr, ipdft_prd = ipdft(self.sig, llim=2, ulim=50)
auto_x, auto_periods = auto_corr(self.sig, llim=2, ulim=50)
hybrid_x, hybrid_periods = hybrid(self.sig, llim=None, ulim=50)

ipdft_pwr, ipdft_prd = ipdft(self.sig, llim=10, ulim=10)
auto_x, auto_periods = auto_corr(self.sig, llim=10, ulim=10)
hybrid_x, hybrid_periods = hybrid(self.sig, llim=10, ulim=10)
hybrid_ipdft_autocorr_stats, hybrid_periods = hybrid(self.sig,

from numpy import arange, convolve, random, sin, pi, exp, array, zeros, float64
from cogent.util.unit_test import TestCase, main

from cogent.maths.period import ipdft, dft, auto_corr, hybrid, goertzel

def test_autocorr(self):
"""correctly compute autocorrelation"""
s = [1,1,1,1]
X, periods = auto_corr(s, llim=-3, ulim=None)
exp_X = array([1,2,3,4,3,2,1], dtype=float)
self.assertEqual(X, exp_X)

auto_x, auto_periods = auto_corr(self.sig, llim=2, ulim=50)
def test_hybrid_returns_all(self):
"""correctly returns hybrid, ipdft and autocorr statistics"""
ipdft_pwr, ipdft_prd = ipdft(self.sig, llim=2, ulim=50)
auto_x, auto_periods = auto_corr(self.sig, llim=2, ulim=50)
hybrid_x, hybrid_periods = hybrid(self.sig, llim=None, ulim=50)

ipdft_pwr, ipdft_prd = ipdft(self.sig, llim=10, ulim=10)
auto_x, auto_periods = auto_corr(self.sig, llim=10, ulim=10)
hybrid_x, hybrid_periods = hybrid(self.sig, llim=10, ulim=10)
hybrid_ipdft_autocorr_stats, hybrid_periods = hybrid(self.sig,

circular_indices, _seq_to_symbols, seq_to_symbols, blockwise_bootstrap, \
SeqToSymbols
from cogent.maths.period import ipdft, hybrid, auto_corr, Hybrid, Ipdft, \
AutoCorrelation