fix test_sigproc

This commit is contained in:
Roman Zeyde
2014-07-06 17:52:07 +03:00
committed by Roman Zeyde
parent a982e38b74
commit ca5f3f18fa

View File

@@ -1,8 +1,6 @@
import sigproc import sigproc
import itertools import itertools
import common import common
import show
import pylab
import numpy as np import numpy as np
def test_qam(): def test_qam():
@@ -15,10 +13,10 @@ def test_qam():
def test_drift(): def test_drift():
fc = 10e3 fc = 10e3
f = fc * (1 + 50e-6) df = 1.23
f = fc + df
x = np.cos(2 * np.pi * f / common.Fs * np.arange(common.Fs)) x = np.cos(2 * np.pi * f / common.Fs * np.arange(common.Fs))
S = sigproc.extract_symbols(x, fc) S = sigproc.extract_symbols(x, fc)
S = np.array(list(S)) S = np.array(list(S))
print 1e6 * sigproc.drift(S) / (fc * common.Tsym) df_ = sigproc.drift(S) / common.Tsym
show.constellation(S, 'carrier') assert abs(df - df_) < 1e-5, (df, df_)
pylab.show()