PERFORMING FFT on EEG SIGNAL USING MATLAB

倖福魔咒の 提交于 2019-12-04 19:38:32

I think the code could be like this:

load('eeg_4m.mat')
fs=2048;
x=val(1,:);
N=length(x);
ts=1/fs;
tmax=(N-1)*ts;
t=0:ts:tmax;
plot(t,x);  % plot time domain

nfft = 2^( nextpow2(length(x)) );
df = fs/nfft;
f = 0:df:fs/2;
X = fft(x,nfft);
X = X(1:nfft/2+1);
figure; plot(f,abs(X)); axis([0,50,0,10e6]); % plot freq domain

768000 is a perfectly good FFT size. It factorizes over small primes: 2^11 * 3 * 5^3

On my laptop this takes about 15ms.

It is a somewhat common misconception that FFTs can only be powers of 2. This is not true of a mixed radix FFT.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!