fft function error while extracting EEG signals in EDF file

2 views (last 30 days)
I want to extract different waves in EEG signals and quantilize their absolute power. However, some errors impeded my way of further exploration.
[header,data] = edfread("preprocessedEEG.edf");
S = data;
y=fft(S);
Then, an error came as "Error using fft Invalid data type. First argument must be double, single, int8, uint8, int16, uint16, int32, uint32, or logical."
Totally have no idea of the error. Is that because of my EDF file had some "NaN" data? or I just misused the fft function? How can I move on my analysing? I really need your help.

Accepted Answer

Star Strider
Star Strider on 12 Aug 2022
According to the edfread documentation, the ‘data’ are the first output, not the second.
The assignments should probably be:
[data,header] = edfread("preprocessedEEG.edf");
instead. (I cannot test this since I do not have the file.)
.
  25 Comments
Jessica
Jessica on 22 Aug 2022
Thanks, Strider! It really helps! The different windowed fft figures are as follow. And I decide to adopt hann/hanning window since it is reccommended by many people and articles.

Sign in to comment.

More Answers (0)

Products


Release

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!