mirror of
https://github.com/romanz/amodem.git
synced 2026-02-07 01:18:02 +08:00
scripts: rename existing filenames
This commit is contained in:
27
scripts/plot.py
Executable file
27
scripts/plot.py
Executable file
@@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env python
|
||||
import pylab
|
||||
import numpy as np
|
||||
|
||||
|
||||
def spectrogram(t, x, Fs, NFFT=256):
|
||||
ax1 = pylab.subplot(211)
|
||||
pylab.plot(t, x)
|
||||
|
||||
pylab.subplot(212, sharex=ax1)
|
||||
pylab.specgram(x, NFFT=NFFT, Fs=Fs, noverlap=NFFT/2,
|
||||
cmap=pylab.cm.gist_heat)
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
from amodem import common
|
||||
from amodem.config import Configuration
|
||||
config = Configuration()
|
||||
|
||||
for fname in sys.argv[1:]:
|
||||
x = common.load(open(fname, 'rb'))
|
||||
t = np.arange(len(x)) * config.Ts
|
||||
pylab.figure()
|
||||
pylab.title(fname)
|
||||
spectrogram(t, x, config.Fs)
|
||||
|
||||
pylab.show()
|
||||
Reference in New Issue
Block a user