Question about splitting an edf instance

I’m going to do a power spectrum analysis.

How do I split the rawEDF instance loaded from the mne to see band power every 30 second epoch?

code like

raw[0:3000]

Take a look at make_fixed_length_epochs().

Richard

Thanks. I have an additional question. To use the mne, load the edf file first. Then select the channel. By the way, since the instances are different in this process, I need to convert to numpy or mne.io.BaseRaw to apply to other functions, but if I want to do 30 seconds epoch, what should I do?

You can just pass the BaseRaw instance to make_fixed_length_epochs().

No, I mean the opposite. Either make it BaseRaw or numpy.

I really don’t know what you’re asking for. Please take the time to thoroughly explain what exactly you wish to do.

What I want to do is very simple. The edf file loads the entire epoch in the mne. However, for partial analysis, it must be split into 30 seconds epoch. It is necessary to convert it into a numpy array or BaseRaw instance.So what I’m asking is what to do with the Epoch function.

If you read a raw EDF file, you already have a Raw object …

That’s right. So how do I deal with getting “the raw” to a numpy array to use a different API to analyze it by epoch?

Simply use make_fixed_length_epochs() and then the get_data() method of the resulting epochs.

1 Like