Skip to content

Commit

Permalink
restructure Python SFF demo
Browse files Browse the repository at this point in the history
  • Loading branch information
swharden committed Jul 25, 2020
1 parent 3ea73cc commit 65116e7
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 36 deletions.
Binary file removed dev/sff/complex.sff
Binary file not shown.
Binary file modified dev/sff/hal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified dev/sff/halMel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
24 changes: 24 additions & 0 deletions dev/sff/sffDemo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import os
import matplotlib.pyplot as plt
import numpy as np
import sffLib

def plotSFF(filePath, show = False):

sf = sffLib.SpectrogramFile(filePath)

# rotate values for display as a pseudocolor mesh
rotatedValues = np.rot90(sf.values, 1)[::-1]
plt.pcolormesh(rotatedValues)

plt.colorbar()
plt.title(f"{filePath} Spectrogram")
plt.savefig(filePath.replace(".sff", ".png"))
if show:
plt.show()

if __name__ == "__main__":
plotSFF("hal.sff")
plotSFF("halMel.sff")


14 changes: 0 additions & 14 deletions dev/sff/sffDemoComplex.py

This file was deleted.

22 changes: 0 additions & 22 deletions dev/sff/sffDemoSimple.py

This file was deleted.

0 comments on commit 65116e7

Please sign in to comment.