Facebook
From Hafsteinn Fannar, 5 Years ago, written in Python.
This paste is a reply to Untitled from Innocent Crow - view diff
Embed
Download Paste or View Raw
Hits: 377
  1. # The former example could not handle files that contain signals with different sampling rates.
  2. import pyedflib
  3. import numpy as np
  4. import matplotlib.pyplot as plt
  5. f = pyedflib.EdfReader("n7.edf")
  6. n = f.signals_in_file
  7. signal_labels = f.getSignalLabels()
  8. sigbufs = []
  9. for i in np.arange(n):
  10.      sigbufs.append(f.readSignal(i))
  11. print (sigbufs)
  12. print(signal_labels)
  13. signal = []
  14. for i in range(0,len(sigbufs)):
  15.         print(sigbufs[i])
  16.         signal[0:90000]=sigbufs[i][10000:100000]
  17.         plt.plot(signal)
  18.         plt.show()