I have EEG data for around 15000 samples. 512 samples per second. Data is in array format. If I plot that data in Matlab then it has samples per second on x-axis and amplitude on Y-axis. I want to extract the data of specific frequency range say 8 Hz to 15 Hz from that data. How to extract specific frequency range from the signal?
Thanks in Advance!
First off, I would STRONGLY RECOMMEND going through EEGLab's, Fieldtrip's, or some other EEG toolbox's tutorials before doing any serious analysis. Just taking the frequency component of a raw EEG signal is rather useless unless the set is preprocessed (re-referenced, artifacts removed, etc) correctly. Additionally going through these tutorials will provide context for how you actually want to manipulate your signal.
For example, "extract data of specific frequency range" is probably a misrepresentation of what you actually want to gather from your data. Going through one of the linked tutorials will show you which analyses you want to perform and provide you with accessible and advanced tools to do so (i.e. you won't have to tailor general MATLAB functions to EEG data).
If you are performing a just-for-fun/exploratory analysis I've provided some example methods for manipulating/analyzing an EEG signal in the frequency domain.
Raw Signal
Bandpass Filter
In this analysis you're basically removing any contributions to the signal below a low-frequency threshold and above a high-frequency threshold.
or eegfilt.m
Power-spectral density estimates (PSD)
Intuitively, this shows the mean contribution of specific frequency range to the signal (i.e. if we have a pure 10 Hz wave we'd have a flat line with a single peak at 10 Hz). This is a pretty good way to quantify signal contributions in the frequency domain. This post is an excellent summary/contextualization of how to interpret a PSD in the context of neural data.
Time-frequency PSD spectrum
Similar to the previous analysis but now we're looking at the magnitude over the time AND frequency domain.
or timefreq.m