EEG analysis note
  • 前言
  • Preprocessing notes
  • 有用的链接
  • 基线
  • 时间频率分析 基础
  • make waves
  • FFT
  • Matlab FFT ref
  • ERSP
  • FFT vs. Morlet
  • Pad ratio
  • 时频顺序
  • std_ersp还是newtimef
  • eeglab的PLOT
  • eeglab的统计模块
  • 小波
Powered by GitBook
On this page

Was this helpful?

FFT

Previousmake wavesNextMatlab FFT ref

Last updated 5 years ago

Was this helpful?

Fourier transform

The Discrete Fourier Transform (FFT) is a method that takes a complex waveform and decomposes it into a set of component sine waves. There's a clear explanation of Matlab's FFT transform here: The FFT requires a dataset that is 2N elements long, i.e. 2, 4, 8, 16, 32, etc., so the transform uses the value of N that is closest to the signal length you have (NFFT). This is computed below for illustration, but not used.

%-----------------------------------------------------------------------
% do_FFT.m
%-----------------------------------------------------------------------
% assumes you have already created mysig.
L = length(mysig);
myFFT = fft(mysig,S);
myFFT=myFFT/L; %scale the output to 1
freq = S/2*linspace(0,1,S/2);%create a range with all frequency values
% Plot single-sided amplitude spectrum.
figure; 
stem(freq,abs(myFFT(1:length(freq))));
xlabel('Frequency (Hz)');
ylabel('Amplitude ');

If you look at the myFFT variable, you will see it has a real and imaginary part. These correspond to the amplitude and phase of the signal. We select just the real part by using the abs() command.

原文