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 日

0 投票

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 件)

カテゴリ

Community Treasure Hunt

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

Start Hunting!

Translated by