Filter löschen
Filter löschen

Time axis in spectrogram for event relatd data

4 Ansichten (letzte 30 Tage)
Kim
Kim am 21 Okt. 2013
Kommentiert: Kim am 22 Okt. 2013
I have EEG data that is event related so the data times actually go from -500 to 1500 ms with fs=256. I would like to create a spectrogram of the epochs with the time axis labeled correctly but just can't seem to figure it out. Any help very welcome. Thanks Kim

Akzeptierte Antwort

Jeremy
Jeremy am 21 Okt. 2013
Here is some lines I've used to set up a spectrogram with more control on how it is created. You should be able to use tStart to get what you need.
tStart=150; %seconds
fs=1000; %Hz
nfft=fs/binWidth; %samples
overlap = 50;%
fLimit=400; %Hz
T = 0:1/fs:2;
X = chirp(T,100,1,200,'q');
[~, f,t,P]=spectrogram(X,hann(nfft),nfft/(100/overlap),nfft,fs);
f(f>fLimit)=[];
t=t+tStart;
P=10*log10(P(1:length(f),:)');
sf=surf(f,t,P,'edgecolor','none');
view(0,90);
axis tight;
  1 Kommentar
Kim
Kim am 22 Okt. 2013
Jeremy Thanks so much I will try this and let you know

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu EEG/MEG/ECoG finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by