import numpy as np;
import matplotlib.pyplot as plt;
plt.rcParams.update({"text.usetex":True});
%config InlineBackend.figure_format = "svg"
import scipy.io.wavfile as sw
sam, d = sw.read("horn.wav");
#tf = 9;
#print(sam)
#d1 = d[:tf*sam];
t = np.arange(np.size(d))*1/sam;
plt.plot(t, d);
plt.title("audio of a moving sound source")
plt.xlabel("time");
plt.ylabel("waveform")
#plt.figure(figsize=(10,8))
plt.specgram(np.abs(d), Fs = sam, cmap='jet');
#plt.yscale("log")