Created
October 2, 2010 15:21
-
-
Save gilesc/607717 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from numpy import argmax | |
| from scipy import arange | |
| from scipy.io import wavfile | |
| from scipy.fftpack import fftfreq, rfft, fftshift | |
| import pylab | |
| sample_rate, signal = wavfile.read("goodnight.wav") | |
| N = len(signal) | |
| Fs = sample_rate | |
| Ts = 1./Fs | |
| freq_step = Fs/N | |
| Y = fftshift(rfft(signal)) | |
| freq = freq_step * arange(-N/2,N/2) | |
| pylab.plot(freq, abs(Y)) | |
| pylab.show() | |
| print Y |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment