Advertisement
Guest User

Untitled

a guest
Dec 4th, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. # beat frequencies
  2. import numpy as np
  3. import matplotlib.pyplot as plt
  4. from math import pi
  5.  
  6. f = [101,103,106];
  7. Ns = 8*1024
  8. t = np.linspace(0,2,Ns);
  9. a = np.zeros((Ns),'double')
  10. for fi in f:
  11. a = a + np.cos(2*pi*fi*t)
  12.  
  13. plt.figure(figsize=(10,5))
  14. plt.plot(t, a)
  15. plt.title('three frequencies beating')
  16. plt.xlabel('time (s)')
  17. plt.ylabel('amplitude')
  18. plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement