Audio Generation
%matplotlib inline
from pylab import *
from IPython.display import AudioFs = 8000.0
Len = 5
t = linspace(0,Len,Fs*Len)
f1 = 442.0
f2 = 440.0
signal = sin(2*pi*f1*t) + sin(2*pi*f2*t)
Audio(data=signal, rate=Fs)freqs = t*Fs/Len # a list of frequencies, in Hertz
fsig = abs(fft(signal)) # Fourier transform of the signal
plot(freqs,fsig) # amplitude versus frequencyLast updated