(N=15)
| 194 | |
| 195 | |
| 196 | def test_framing(N=15): |
| 197 | np.random.seed(12345) |
| 198 | |
| 199 | i = 0 |
| 200 | while i < N: |
| 201 | N = np.random.randint(500, 100000) |
| 202 | window_len = np.random.randint(10, 100) |
| 203 | stride_len = np.random.randint(1, 50) |
| 204 | signal = np.random.rand(N) |
| 205 | |
| 206 | mine = to_frames(signal, window_len, stride_len, writeable=False) |
| 207 | theirs = frame(signal, frame_length=window_len, hop_length=stride_len).T |
| 208 | |
| 209 | assert len(mine) == len(theirs), "len(mine) = {}, len(theirs) = {}".format( |
| 210 | len(mine), len(theirs) |
| 211 | ) |
| 212 | np.testing.assert_almost_equal(mine, theirs) |
| 213 | print("PASSED") |
| 214 | i += 1 |
| 215 | |
| 216 | |
| 217 | def test_dft_bins(N=15): |
nothing calls this directly
no test coverage detected