Help understanding FFT plot

조회 수: 2 (최근 30일)
Laura Moylan
Laura Moylan 2016년 8월 13일
댓글: Star Strider 2016년 8월 17일
Hello, I'm hoping someone might be able to help me understand what my plot means. I need to conduct an FFT and PSD for some EEG data. The sample rate is 512 and I am currently using 2 seconds worth of data. I have been given the following code
subplot (2,1,1); plot (F4, 'k'); title ('Original F4 Signal')
duration =2;
samples = 1024; %sample rate 1024Hz for all patients except Patient 2 (512Hz)
samplingInterval = duration/samples;
bandwidth = 70;
time = linspace (0, duration, samples);
freq = linspace (-bandwidth, bandwidth, 1024);
% freq = linspace (-1.0e3, 1.0e3, 500);alternative baseline
fourierSpace = fftshift(ifft(F4));
subplot (2,1,2); plot (freq, abs(fourierSpace),'k'); title ('frequency')
I set the bandwidth at 70 as the high frequency filter was 70 during recording. F4 is simply the name of the channel that I am analysing. All other information in the code is as it was given to me.
When I run the code on the data the plot looks like this:
The PSD code I've been given is
% For EEG
t = linspace (0, 2, 1024);
x = F4;
h = spectrum.periodogram('Rectangular');% Or Blackman-Harris
%h = spectrum.periodogram('Blackman-Harris');% Or Rectangular
hopts = psdopts(h,x); % Default options based on the signal x
set(hopts,'Fs',1/(t(2)-t(1)),'SpectrumType','twosided','CenterDC',true);
psd(h,x,hopts)
The plot comes out like this:
If anyone can help me shed a little light on what all of this means I'd be eternally grateful! Apologies for such basic questions.... I'm very new to this!

채택된 답변

Star Strider
Star Strider 2016년 8월 13일
I would use a one-sided fft as in the documentation (link), and not do the fftshift. Displaying a two-sided fft does not give you any more information, and actually makes the information you have more difficult to interpret.
I have no comments on the PSD section of the code. It looks correct to me.
  댓글 수: 2
Laura Moylan
Laura Moylan 2016년 8월 17일
Thank you
Star Strider
Star Strider 2016년 8월 17일
My pleasure.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by