Skip to content

Instantly share code, notes, and snippets.

@netsatsawat
Created June 19, 2020 12:21
Show Gist options
  • Select an option

  • Save netsatsawat/228f1d7e94b159ce1f2512a3f4a67b2d to your computer and use it in GitHub Desktop.

Select an option

Save netsatsawat/228f1d7e94b159ce1f2512a3f4a67b2d to your computer and use it in GitHub Desktop.
import numpy as np
import matplotlib.pyplot as plt
start_tm, end_tm = 0, 2
signal1 = 12 # frequency of the wave
smpl_freq = 32 * signal1 # sampling frequency with oversampling factor=32
smpl_intv = 1 / smpl_freq # intervals time points are sampled
tm = np.arange(start_tm, end_tm, smpl_intv)
ampl1 = np.sin(2 * np.pi * signal1 * tm) # generate sine wave
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment