Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

frequency spectrum using matlab

Status
Not open for further replies.

thasneem1

Newbie level 1
Newbie level 1
Joined
Oct 20, 2010
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,289
how to get frequency spectrum of EEG signal using matlab?abs(fft(x)) is not giving good plot
 

What specifically is wrong?
 
  • Like
Reactions: akra

    akra

    Points: 2
    Helpful Answer Positive Rating
    V

    Points: 2
    Helpful Answer Positive Rating
I have EEG data sets with each data set of 257 samples.I need to perform DFT/FFT of the data.Can any one tell me the code for this in MALAB?
 

    V

    Points: 2
    Helpful Answer Positive Rating
If by the plot does not look "good" you mean it is split and spread out its because the FFT is not centered. Use abs(fftshift(fft(x))) instead to get a centered plot.


*Edit: the order which you use fftshift does matter, it should be used after you take the fft.
 
Last edited:

In my view you need to have couple of more samples to be presents for ECG to see the good frequecy correlation....or you do one thing there is function for resample the sequece....for 257 samples you will get frequency resoltion of only 128 on either side with one zero-frequecy component.... fftshift is good to view the data....but to get more accurate frequency contribution....it better to have more samples such that.... there will be good frequency resolution....

Good Luck
 

Look for "spectrum" command... works really good for me.

% s7 is my data array
% fs is the sample frequency

fs = 10000;
t = 0: 1/fs : (length(s7) - 1) / fs;

[ P, F ] = spectrum(s7, 4096, 0, hanning(4096), fs);

plot( F, P );

I hope it can help you

Iuri~
 

    V

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top