- Delta: 0.5–4 Hz
- Beta: 13–30 Hz
- Gamma: 30–100 Hz
How can i susstract a gamma wavelenght from a eeg signal ??
3 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
This is my code and i need to sustract either of the 5 types of waves theta, gamma, delta, beta %Procesare semnal EEG - 8 canale %Am ales un singur canal % =xlsread('C:\Users\Hell\Desktop\pptrm\tema2rm'); y1= xlsread('C:\Users\Hell\Desktop\pptrm\tema2rm\dap.xls'); y1 = y1(:,2); fs = 500;% Frecventa de esantionare (Hz) N = length(y1); T = 1/fs; % T reprezinta perioada de esantionare in secunde ls = size(y1); %% marime fs2 = 1/ N;% gasirea frecventei t = (0 : N-1) /fs; %timpul t1 = (0 : N-1) *T;%t = (0:1:length(y1)-1)/fs; % perioada de esantionare Nyquist = fs/2; %criteriul Nyquist figure; plot(t,y1,'b'); title ('Semnal EEG intr-o criza epileptica') xlabel ('time (sec)') ylabel ('Amplitute (uv)') grid on; figure; y1inainte = y1(5:400); N1 = length(y1inainte);%nr esantioane tinainte = (0 : N1-1) /fs; subplot (3,1,1); plot(tinainte,y1inainte,'b'); title ('Semnal EEG inainte de criza epileptica') xlabel ('time (sec)') ylabel ('Amplitute (uv)') grid on; y1intimp = y1(800:1100); N2 = length(y1intimp);% nr esantioane tintimp = (0 : N2-1) /fs; %figure; subplot (3,1,2); plot(tintimp,y1intimp,'b'); title ('Semnal in timpul crizei epileptice ') xlabel ('time (sec)') ylabel ('Amplitute (uv)') grid on;
y1dupa = y1(1100:1600 ); N3 = length(y1dupa); tdupa = (0 : N3-1) /fs; %figure; subplot (3,1,3); plot(tdupa, y1dupa,'b'); title ('Semnal dupa criza epileptica ') xlabel ('time (sec)') ylabel ('Amplitute (uv)') grid on;
%%Transformata Fourier:
%%se calculeaza TFD cu FFT
X = fftshift(fft(y1));% se deplaseaza spectru pentru a avea originea la mijlocul reprezentarii
X1= fftshift(fft(y1inainte));
X2= fftshift(fft(y1intimp));
X3= fftshift(fft(y1dupa));
%%Specificatii frecvente:
dF = fs/N; % Hz
f = -fs/2:dF:fs/2-dF; % Hz
%%Specificatii frecvente:
dF1 = fs/N1; % Hz
f1 = -fs/2:dF1:fs/2-dF1; % Hz
%%Specificatii frecvente:
dF2 = fs/N2; % Hz
f2 = -fs/2:dF2:fs/2-dF2; % Hz
%%Specificatii frecvente:
dF3 = fs/N3; % Hz
f3 = -fs/2:dF3:fs/2-dF3; % Hz
%%Plot spectru:
figure;
subplot (2,2,1);
plot(f,abs(X)/N);
xlabel('Frectventa (Hz)');
title('Magnitudinea rasp. original');
%%Plot spectru: Inainte de crize epileptice
%figure;
subplot (2,2,2);
plot(f1,abs(X1)/N1);
xlabel('Frecventa (Hz)');
title('Magnitudinea rasp inainte de crize');
%%Plot spectru: In timpul crizelor epileptice
%figure;
subplot (2,2,3);
plot(f2,abs(X2)/N2);
xlabel('Frecventa (Hz)');
title('Magnitudinea rasp in timpul crizelor');
%%Plot spectru: Dupa crizele epileptice
%figure;
subplot (2,2,4);
plot(f3,abs(X3)/N3);
xlabel('Frecventa (Hz)');
title('Magnitudinea rasp.dupa crize epileptice');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
ff=[0 0.1 0.11 0.15 0.16 1]; %filtru trece banda
af=[ 0 0 1 1 0 0 ];
nf=100; % dimensiunea filtrului
b=firpm(nf, ff, af); % coeficientii filtrului
ytb=filter(b,1,X); % iesirea filtrului
figure subplot(2,1,1); plot_t(T,ytb); subplot(2,1,2); plot_S(T,ytb);
0 comentarios
Respuestas (1)
Sameer
el 16 de Mayo de 2025
To remove one of the main EEG wave types (like theta, gamma, delta, or beta) from your signal, you can use a band-stop filter for that frequency range.
For example, to remove the theta band (4–8 Hz):
fs = 500; % Sampling frequency (Hz)
order = 100; % Filter order
% Theta band (4-8 Hz) normalized
theta_low = 4 / (fs/2);
theta_high = 8 / (fs/2);
% Design band-stop filter
b = fir1(order, [theta_low theta_high], 'stop');
% Filter the EEG signal
y1_no_theta = filtfilt(b, 1, y1);
% Plot result
plot(y1_no_theta);
title('EEG after Theta (4-8 Hz) Removal');
Change the frequency range for delta, beta, or gamma as needed.
This will subtract (remove) the chosen frequency band from your EEG signal.
Hope this helps!
0 comentarios
Ver también
Categorías
Más información sobre EEG/MEG/ECoG en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!