时频顺序

原文

Standards or deviants or substracted waveforms?

In the context of ERSP, this raises the question of whether one should compare the ERSP associated with standards and that with deviants, or first subtract the waveforms and then consider the ERSP. Does it make a difference, and if so, which is preferable?

condition1---standard

make a waveform

D = 2; %signal duration 2s
S = 1000; % sampling rate, i.e. N points pt sec used to represent sine wave
F = [10 25 34]; % 4 frequencies in Hz
w = 2*pi*F; % convert frequencies to radians
P = [0 0 0 ]; % 4 corresponding phases
T = 1/S; % sampling period, i.e. for this e.g. points at 1 ms intervals
t = [T:T:D]; % time vector %corrected from previous version on 12 Jul 2010
%t=t(1:length(t)-1); % takes off extra point arising from starting at zero
nfreqs=length(F); % N frequencies in the complex
A=ones(nfreqs,length(t)); %amplitudes initialised at one
A(1,500:570)=2; %boost of increased amplitude at each time pt
A(2,700:900)=2;
A(3,950:970)=2;
% Add all sine waves together to give composite
for thispt=1:2000
for thisfreq=1:nfreqs
mysig(thisfreq,thispt) =A(thisfreq,thispt)*sin(w(thisfreq)*t(thispt));
end
end
mystan=sum(mysig,1);
b=normrnd(0,.5,2000);
mystan=mystan+b(1,:);

ERSP

figure;[ersp,itc,powbase,times,freqs]=...
newtimef( mystan,2000,[-500 1500],1000,cyc,'erspmax',20,'plotitc','off');
title('Standard');
erspstan=ersp;

condition2---dev

make a waveform

D = 2; %signal duration 2s
S = 1000; % sampling rate, i.e. N points pt sec used to represent sine wave
F = [10 25 34]; % 4 frequencies in Hz
w = 2*pi*F; % convert frequencies to radians
P = [0 0 0 ]; % 4 corresponding phases
T = 1/S; % sampling period, i.e. for this e.g. points at 1 ms intervals
t = [T:T:D]; % time vector %corrected from previous version on 12 Jul 2010
nfreqs=length(F); % N frequencies in the complex
A(1,850:1050)=3; %boost of increased amplitude for freq 1
A(2,1100:1200)=3;
A(3,1350:1400)=3;
for thispt=1:2000
for thisfreq=1:nfreqs
mysig(thisfreq,thispt) =A(thisfreq,thispt)*sin(w(thisfreq)*t(thispt));
end
end
mydev=sum(mysig,1);
b=normrnd(0,.5,2000);
mydev=mydev+b(2,:);

ERSP

figure;[ersp,itc,powbase,times,freqs]=...
newtimef( mystan,2000,[-500 1500],1000,cyc,'erspmax',20,'plotitc','off');
title('Standard');
erspsdev=ersp;

Standard-Deviant

plot

t=t-.5; %subtract 500 ms to indicate baseline is negative
figure; plot(t,mystan);hold
plot(t,mydev,'color','r');
legend({'standard','deviant'})
xlabel('Time (seconds)');
ylabel('Amplitude');

TF on difference waveform (substraction)

myMM=mydev-mystan
figure;[ersp,itc,powbase,times,freqs]=...
newtimef( myMM,2000,[-500 1500],1000,cyc,'erspmax',20,'plotitc','off');
title('tf on mydev-mystan');

Plot ERSP differences

erspdiff=erspdev-erspstan
figure;imagesc(erspdiff,[-20 20])
set(gca,'YDir','normal')
colormap jet
colorbar;
title('Subtracted ERSP');

This simulation suggests that it may be preferable when considering difference waveforms to first subtract the waveforms and then conduct time-frequency analysis, as opposed to conducting time-frequency analysis on each waveform and then subtracting the resulting ERSP.

Last updated