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

32 Ansichten (letzte 30 Tage)
MOUSTADRANE am 19 Mai 2024 um 12:27
Beantwortet: Manikanta Aditya am 20 Mai 2024 um 3:48
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 KommentareKeine anzeigenKeine ausblenden
Manikanta Aditya am 19 Mai 2024 um 15:05
% 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);
MOUSTADRANE am 19 Mai 2024 um 15:52
Thank you very much, it s help full !

Melden Sie sich an, um zu kommentieren.

### Akzeptierte Antwort

Manikanta Aditya am 20 Mai 2024 um 3:48
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.
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu EEG/MEG/ECoG finden Sie in Help Center und File Exchange

### Community Treasure Hunt

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

Start Hunting!

Translated by