Skip to content
Snippets Groups Projects
Commit fdd324dc authored by Erik Strand's avatar Erik Strand
Browse files

Generate a subset of samples

parent 5665812e
No related branches found
No related tags found
No related merge requests found
...@@ -46,3 +46,16 @@ if __name__ == "__main__": ...@@ -46,3 +46,16 @@ if __name__ == "__main__":
plt.plot(sample_times, recovered_sample_values) plt.plot(sample_times, recovered_sample_values)
plt.savefig("fig_c.png") plt.savefig("fig_c.png")
plt.close() plt.close()
# Part (d)
n_subsamples = 100
np.random.seed(7250147)
subset_indices = np.arange(n_samples)
np.random.shuffle(subset_indices)
subset_indices = subset_indices[:n_subsamples]
subset_indices = np.sort(subset_indices)
subset_sample_times = sample_times[subset_indices]
subset_sample_values = sample_values[subset_indices]
plt.plot(subset_sample_times, subset_sample_values)
plt.savefig("fig_d.png")
plt.close()
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment