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 (최근 30일)
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')

답변 (2개)

Walter Roberson
Walter Roberson 2017년 9월 23일
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

댓글을 달려면 로그인하십시오.


vijaya kumar
vijaya kumar 2019년 1월 8일
try this
t=(0:nu-1)/Fs;

카테고리

Help CenterFile Exchange에서 EEG/MEG/ECoG에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by