Generate ground truth and testing data.
(n_trials, j_extent)
| 29 | |
| 30 | |
| 31 | def get_data(n_trials, j_extent): |
| 32 | """Generate ground truth and testing data.""" |
| 33 | ground_truth = np.tile(single_trial, n_trials) |
| 34 | my_shape = n_trials, 1, 600 |
| 35 | random_data = rng.random_sample(my_shape) |
| 36 | rand_ints = rng.randint(-j_extent, j_extent, n_trials) |
| 37 | jittered_data = np.array([np.roll(single_trial, i) for i in rand_ints]) |
| 38 | data = np.concatenate( |
| 39 | [ |
| 40 | ground_truth.reshape(my_shape), |
| 41 | jittered_data.reshape(my_shape), |
| 42 | random_data.reshape(my_shape), |
| 43 | ], |
| 44 | 1, |
| 45 | ) |
| 46 | |
| 47 | assert data.shape == (n_trials, 3, 600) |
| 48 | return data |
| 49 | |
| 50 | |
| 51 | # vary extent of jittering --> creates phaselocks at the borders if |