Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # beat frequencies
- import numpy as np
- import matplotlib.pyplot as plt
- from math import pi
- f = [101,103,106];
- Ns = 8*1024
- t = np.linspace(0,2,Ns);
- a = np.zeros((Ns),'double')
- for fi in f:
- a = a + np.cos(2*pi*fi*t)
- plt.figure(figsize=(10,5))
- plt.plot(t, a)
- plt.title('three frequencies beating')
- plt.xlabel('time (s)')
- plt.ylabel('amplitude')
- plt.show()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement