The Neurophysiological Biomarker Toolbox (NBT)



n:m Synchronization Indices in NBT with surrogate data

Use as surrogate data white noise filtered as the original signals.

function [n m] = nbt_n_m_surrogate_detection(phase1,phase2,phase1rand,phase2rand)
t0 = 5;
j = 1;
for i=t0+1:length(phase1)-t0
    phase1w = phase1(i-t0:i+t0);
    phase2w = phase2(i-t0:i+t0);
            g = 1;
            for n = 1:2;
                for m = 1:2;
                [index1nm,index2nm,index3nm] = nbt_n_m_detection(phase1w,phase2w,n,m);
                values(g,:) = [index1nm index2nm];
                ind(g,:) =[n m];
                g = g+1;
                end
            end
            I1(j,:) = values(:,1);
            I2(j,:) = values(:,2);          
            j = j+1;
end
% % --- detect n:m surrogate
j = 1;
for i=t0+1:length(phase1)-t0
    phase1w = phase1rand(i-t0:i+t0);
    phase2w = phase2rand(i-t0:i+t0);
            g = 1;
            for nR = 1:2
                for mR = 1:2
                [index1nmR,index2nmR,index3nmR] = nbt_n_m_detection(phase1w,phase2w,n,m);
                valuesR(g,:) = [index1nmR index2nmR];
                indR(g,:) =[nR mR];
                g = g+1;
                end
            end
            I1R(j,:) = valuesR(:,1);
            I2R(j,:) = valuesR(:,2);         
            j = j+1;
end
perc1R = prctile(I1R,95,1);
perc2R = prctile(I2R,95,1);
for i = 1:4
    max1(i) = max(I1(:,i)-perc1R(i));
    if max1(i) <0
        max1(i) = 0;
    end
    max2(i) = max(I2(:,i)-perc2R(i));
    if max1(i) <0
        max1(i) = 0;
    end
end
% sum of the index: the maximum will give n m values
sumInd = max1 +max2;
[sumIndmax indMax] = max(sumInd);
n = ind(indMax,1);
m = ind(indMax,2);
tutorial/phase_locking_value/nbt_n_m_surrogate_detection.txt · Last modified: 2012/01/10 14:45 by Giusi Schiavone
The NBTwiki platform - version 2.8 - 9 May 2013
Copyright (C) 2008-2015