Created
February 14, 2016 08:57
-
-
Save mitallast/9938f2572ef42a762889 to your computer and use it in GitHub Desktop.
Prints impulse response from wav file format (like a reverb or guitar cab IR)
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 scikits.audiolab import Sndfile | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| import scipy.signal | |
| f = Sndfile('impulse.wav', 'r') | |
| data = np.array(f.read_frames(f.nframes), dtype=np.float64) | |
| f.close() | |
| fs = f.samplerate | |
| N = int(f.nframes) | |
| w, h = scipy.signal.freqz(data, a=1, worN=N) | |
| plt.semilogx((fs * 0.5 / np.pi) * w, abs(h)) | |
| plt.show() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment