MCPcopy Create free account
hub / github.com/ddbourgin/numpy-ml / test_dct

Function test_dct

numpy_ml/tests/test_preprocessing.py:119–132  ·  view source on GitHub ↗
(N=15)

Source from the content-addressed store, hash-verified

117
118
119def test_dct(N=15):
120 np.random.seed(12345)
121
122 i = 0
123 while i < N:
124 N = np.random.randint(2, 100)
125 signal = np.random.rand(N)
126 ortho = bool(np.random.randint(2))
127 mine = DCT(signal, orthonormal=ortho)
128 theirs = dct(signal, norm="ortho" if ortho else None)
129
130 np.testing.assert_almost_equal(mine, theirs)
131 print("PASSED")
132 i += 1
133
134
135def test_dft(N=15):

Callers

nothing calls this directly

Calls 1

DCTFunction · 0.90

Tested by

no test coverage detected