PERFORMING FFT on EEG SIGNAL USING MATLAB

2020-07-29 23:31发布

问题:

i have acquired a 5 minutes raw eeg from NEXUS 10 mark 2 equipment and it is giving me output in the matlab as 1 x 76800 row vector. as i understand , the sampling frequency choosen is 256 hz , hence it is giving me total 76800 sampling points. no wat i m perfoming N point FFT on this raw eeg signal. since N can only be power of 2 i am EXTRACTING 65536(2 ^16) SAMPLING POINTS FROM RAW EGG i.e. from 76800 points i have taken 65536. now i am not able to perform fft on the this vector (65536 sampling points) please anybody can guide..as i am a beginner.. i have tried dis so far

       x=raw(1,1:65536); %raw eeg contain 76800 points , 65536 points are taken 
                         from this
       N=length(x);
       fs=256;
        ts=1/fs;
        tmax=(N-1)*ts;
        t=0:ts:tmax;
        plot(t,x);  % plot time domain

        f=-fs/2:fs/(N-1):fs/2;
        fftval=fft(x);                                                              
        plot(f,ffval); % plot freq domain

i do not know whether the steps followed are right or not.....m not able to understand from many post in stackoverflow i have gone through..please help..I DONT WANT TO USE EEGLAB AS GIVEN IN MANY POSTS.PLEASE HELP

回答1:

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


回答2:

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.



标签: matlab fft dft