EEG frequence and noise estemation

1 回表示 (過去 30 日間)
Haya AKKAD
Haya AKKAD 2023 年 4 月 23 日
編集済み: chicken vector 2023 年 4 月 23 日
Hello
I have noised EEG signal stored in this txt file.
I need to get the estimated frequency for the signal and the noise frequency
I am trying this code bellow
x=load('5.txt');
y = fft(x);
PS = abs(y).^2;
N = length(x);
fs = 500;
freq = (1:N/2)*fs/N;
plot(freq,PS);
but I got error:
Error using plot
Vectors must be the same length.
Error in untitled (line 7)
plot(freq,PS);
Thanks

回答 (1 件)

chicken vector
chicken vector 2023 年 4 月 23 日
編集済み: chicken vector 2023 年 4 月 23 日
Look at fft documentation:
x=load('5.txt');
y = fft(x);
PS = abs(y).^2;
N = length(x);
fs = 500;
% From documentation:
L = length(x);
P2 = abs(Y/L);
freq = P2(1:L/2+1);
freq(2:end-1) = 2*freq(2:end-1);
plot(freq,PS);

カテゴリ

Help Center および File ExchangeEEG/MEG/ECoG についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by