An array is not random data, it is the wave data of your stereo sound, and 44100 is the sampling frequency. use the following code to build the left channel wave:
import scipy.io.wavfile as wavfile import numpy as np import pylab as pl rate, data = wavfile.read('FILE.wav') t = np.arange(len(data[:,0]))*1.0/rate pl.plot(t, data[:,0]) pl.show()
To get the frequency and amplitude of the wave, do FFT. Following the code graph, the power of each frequency bin:
p = 20*np.log10(np.abs(np.fft.rfft(data[:2048, 0]))) f = np.linspace(0, rate/2.0, len(p)) pl.plot(f, p) pl.xlabel("Frequency(Hz)") pl.ylabel("Power(dB)") pl.show()
source share