How to denoise raw EEG data with MATLAB?
Mostrar comentarios más antiguos
I made the program which would filter out the noise from raw EEG data, however, I could not implement the code. Could you please tell me what is wrong with this program? The program is down below.
function OutputEEG = MyEEGFilter(InputEEG,fs)
fs=SampleRate;
lowEnd = 3; % Hz
highEnd = 70; % Hz
filterOrder = 2; % Filter order (e.g., 2 for a second-order Butterworth filter). Try other values too
[b, a] = butter(filterOrder, [lowEnd highEnd]/(fs/2)); % Generate filter coefficients
d = designfilt('bandstopiir','FilterOrder',8, ...
'HalfPowerFrequency1',49,'HalfPowerFrequency2',51, ...
'DesignMethod','butter','SampleRate',fs);
InputEEG=double(InputEEG);
Foutput(1,:) = filtfilt(d,InputEEG(1,:));
Foutput(1,:) = filtfilt(b,a,Foutput(1,:));
end
3 comentarios
Nick
el 11 de Nov. de 2018
Could you specify what errors you are getting? My first guess would be that your error is "output variable OutputEEG was not assigned"?
I assumed this as OutputEEG was not assigned anywhere (maybe you wanted Foutput to be OutputEEG? If that is the case just change one of the variable names and it should give an output). If you were getting another error or problem. Please specify the problem a bit more
ABCDEEG
el 12 de Nov. de 2018
Nick
el 13 de Nov. de 2018
Did you put your function in a seperate .m file? You cannot call a function straight from the command window, that could be the cause of this new error.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre EEG/MEG/ECoG en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!