-2

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

Palmen
  • 1
  • 2
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Jul 03 '22 at 20:11

1 Answers1

0

Its formatted by storing each of the following variables (i_f, i_t, i_Sxx to the outcome of the function spectrogram when (i_secs, fs=5000, return_onesided=False) is passed to it.

The question is really unclear though and I doubt that answer made it any clearer so please edit with a more specific question if you still have any