Clear Filters
Clear Filters

How to define line code to block Frequency EEG based on specific range?

2 views (last 30 days)
I am new on mathalab and programmation, I am loocking for a base script to lock specific range of EEG frequency.
I would like :
to create a script able to detect the frequency from 0 to 20 Hz.
to block some of this frquency.
Thank you for help.
  2 Comments
Manikanta Aditya
Manikanta Aditya on 19 May 2024
Just as a starting point of help you can refer this:
% Assuming 'eegData' is your EEG data and 'Fs' is the sampling frequency
eegData = ...;
Fs = ...;
% Design a bandpass filter that passes frequencies between 0 and 20 Hz
d = designfilt('bandpassiir', 'FilterOrder', 20, ...
'HalfPowerFrequency1', 0, 'HalfPowerFrequency2', 20, ...
'SampleRate', Fs);
% Apply the filter to the EEG data
filteredEegData = filtfilt(d, eegData);

Sign in to comment.

Accepted Answer

Manikanta Aditya
Manikanta Aditya on 20 May 2024
Refer this code as a starting point:
% Assuming 'eegData' is your EEG data and 'Fs' is the sampling frequency
eegData = ...;
Fs = ...;
% Design a bandpass filter that passes frequencies between 0 and 20 Hz
d = designfilt('bandpassiir', 'FilterOrder', 20, ...
'HalfPowerFrequency1', 0, 'HalfPowerFrequency2', 20, ...
'SampleRate', Fs);
% Apply the filter to the EEG data
filteredEegData = filtfilt(d, eegData);
I hope this helps.

More Answers (0)

Categories

Find more on EEG/MEG/ECoG in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!