I am trying to plot the frequency spectrum of a wav file, but it seems like frequency spectrum always matches the time domain signal, with the following code.
import matplotlib.pyplot as plt
import numpy as np
def plot(data):
plt.plot(data, color='steelblue')
plt.figure()
plt.show()
rate, wav_data = wavfile.read("audio_self/on/on.wav")
plot(wav_data)
plot(np.abs(np.fft.fft(wav_data)))
Am I doing something wrong?
Best Answer
If you want two separate a stereo track to left and right channels and then take a separate graph of each, it would be a lot more accurate of a reading unless you put the track in mono like Frank Zalkow says. This is how to separate the stereo track into left and right channels:
I hope this helps.