when i try to run ''N =length(EEGsig);'' i am getting this ''Undefined function or variable 'EEGsig'.'' error... please help me how to solve this problem
2 次查看(过去 30 天)
显示 更早的评论
fs = 512
T = 1/fs;
N =length(EEGsig); ls = size(EEGsig);
tx =[0:length(EEGsig)-1]/fs;
fx = fs*(0:N/2-1)/N;
x= EEGsig;
sd = 0.1;
normal_noise = sd*randn(1, N);
noisy_EEGsig = x + normal_noise;
figure();
subplot(4,1,1);
grid on;
plot(tx, x);
xlabel('Time [s]');
ylabel('Amplitude');
title('Original signal');
subplot(4,1,2);
grid on;
plot(tx,normal_noise);
xlabel('Time [s]');
ylabel('Amplitude');
title('Noise');
subplot(4,1,3);
grid on;
plot(tx, noisy_EEGsig);
xlabel('Time [s]');
ylabel('Amplitude');
title('Original signal + Noise');
subplot(4,1,4);
d = designfilt('bandstopiir', 'FilterOrder', 2, 'HalfPowerFrequency1', 59, 'HalfPowerFrequency2', 61, 'DesignMethod', 'butter', 'SampleRate', fs);
fvtool(d,'fs',fs)
buttLoop = filtfilt(d, noisy_EEGsig);
plot(t, noisy_EEGsig,t,buttLoop)
ylabel('Voltage (V)')
xlabel('Time (s)')
title('filtered signal')
legend('Unfiltered','Filtered')
grid
0 个评论
采纳的回答
Walter Roberson
2018-2-25
There is no Mathworks function or built-in data set by that name. You need to load some eeg data from somewhere and assign it to that variable.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 EEG/MEG/ECoG 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!