The mat file contains the following:
data: [15×3000000 double]
data_length_sec: 600
sampling_frequency: 5000
channels: {1×15 cell}
This is the code to run:
preictal_tst = 'Patient_1/Patient_1_preictal_segment_0001.mat'
preictal_data = scipy.io.loadmat(preictal_tst)
preictal_array = preictal_data['preictal_segment_1'][0][0][0]
l = list(range(10000))
for i in l[::5000]:
print('Preictal')
i_secs = preictal_array[0][i:i+5000]
print(i_secs)
i_f, i_t, i_Sxx = spectrogram(i_secs, fs=5000, return_onesided=False)
print(i_f)
print(i_t)
print(i_Sxx)
i_SS = np.log1p(i_Sxx)
print(i_SS)
plt.imshow(i_SS[:] / np.max(i_SS), cmap='gray')
plt.show()
In the link is the image of how the signal looks like https://i.stack.imgur.com/PSZSe.jpg