Skip to content

Instantly share code, notes, and snippets.

@jarkkojs
Created October 30, 2020 11:56
Show Gist options
  • Save jarkkojs/f71fde4a28121b5745776cb261ac16ad to your computer and use it in GitHub Desktop.
Save jarkkojs/f71fde4a28121b5745776cb261ac16ad to your computer and use it in GitHub Desktop.
from matplotlib import pyplot as plt
from matplotlib import style
from scipy import signal
import numpy as np
FREQUENCY = 440 # A3
RATE = 44100
DURATION = 2 # seconds
NR_SAMPLES = DURATION * RATE
times = np.linspace(0, 0.1, NR_SAMPLES, endpoint = False)
sig = np.sin(2 * np.pi * FREQUENCY * times)
plt.plot(sig)
plt.show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment