(N=15)
| 133 | |
| 134 | |
| 135 | def test_dft(N=15): |
| 136 | np.random.seed(12345) |
| 137 | |
| 138 | i = 0 |
| 139 | while i < N: |
| 140 | N = np.random.randint(2, 100) |
| 141 | signal = np.random.rand(N) |
| 142 | mine = DFT(signal) |
| 143 | theirs = np.fft.rfft(signal) |
| 144 | |
| 145 | np.testing.assert_almost_equal(mine.real, theirs.real) |
| 146 | print("PASSED") |
| 147 | i += 1 |
| 148 | |
| 149 | |
| 150 | def test_mfcc(N=1): |