this is my first time extracting eeg signal.for practising only beta wave is taken.after running my code there doesn't show any curve though no error is found.M1 is declared as variable help me to find the problem

1 visualización (últimos 30 días)
load S001R01_edfm.mat;% loading data
Ts=2;% sampling period
Fs=500;%sampling frequency
[N,nu]=size(M1);%obtain size of data
t=(1:N)*Ts;%generates time vector
%%Raw Signal Analysis
figure()
title('EEG Wave Patterns')
subplot (2,1,1),plot(t,M1)
grid on;
xlabel('Time(s)')
ylabel('Amplitude')
title('Raw EEG Signal')
xlim([0 (1600)])
%BETA BANDPASS FILTER (12-30)
Fs = 500; % Sampling Frequency
Fstop1 = 11.5; % First Stopband Frequency
Fpass1 = 12; % First Passband Frequency
Fpass2 = 30; % Second Passband Frequency
Fstop2 = 30.5; % Second Stopband Frequency
Dstop1 = 0.0001; % First Stopband Attenuation
Dpass = 0.057501127785; % Passband Ripple
Dstop2 = 0.0001; % Second Stopband Attenuation
dens = 20; % Density Factor
% Calculate the order from the parameters using FIRPMORD.
[N, Fo, Ao, W] = firpmord([Fstop1 Fpass1 Fpass2 Fstop2]/(Fs/2), [0 1 ...
0], [Dstop1 Dpass Dstop2]);
% Calculate the coefficients using the FIRPM function
b4 = firpm(N, Fo, Ao, W, {dens});
Hd4 = dfilt.dffir(b4);
x4=filter(Hd4,M1);
subplot(2,1,2), plot(t,x4)
grid on;
xlabel('Time(s)')
ylabel('Amplitude')
title('BETA Waves')
xlim([0 (1600)])
title('waveform for BETA band')

Respuestas (2)

Walter Roberson
Walter Roberson el 23 de Sept. de 2017
Your code
t=(1:N)*Ts;%generates time vector
is not right: it does not take into account the sampling frequency. More likely to be right would be
t = (0:N-1) / Fs;
  3 comentarios

Iniciar sesión para comentar.


vijaya kumar
vijaya kumar el 8 de En. de 2019
try this
t=(0:nu-1)/Fs;

Categorías

Más información sobre EEG/MEG/ECoG en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by