x = xtemp
                    else:
                        x = np.concatenate((x, xtemp), axis=1)
                else:
                    continue

        params = dict(Fs=4096.0, fpass=[5, 600], tapers=[1, 1], pad=1,
                      Npairs=2000, itc=1)
        nPerDraw = 400
        nDraws = 100

        print 'Running Pairwise Spectrum Estimation'
        (pS, f) = spectral.mtpspec(x, params, verbose='DEBUG')

        print 'Running Raw Spectrum Estimation'
        (Sraw, f) = spectral.mtspecraw(x, params, verbose=True)

        print 'Running Mean Spectrum Estimation'
        (S, N, f) = spectral.mtspec(x, params, verbose=True)

        print 'Running CPCA PLV Estimation'
        (cplv, f) = spectral.mtcpca(x, params, verbose=True)

        # print 'Running CPCA Power Estimation'
        # (cpow, f) = spectral.mtcspec(x, params, verbose=True)

        # Saving Results
        res = dict(pS=pS, cplv=cplv, Sraw=Sraw, f=f, S=S, N=N)
        # res = dict(cpow = cpow, f = f)
        save_name = subj + condstem + '.mat'
Beispiel #2
0
    # plt.figure()
    # plt.plot(t,ITD_nfs.T,color= mcolors.CSS4_COLORS['grey'])
    # plt.plot(t,ITD_Ht,color='k')
    # plt.xlim([0,Keep_H])
    # plt.title('Ht ITD')

    #%% Calculate Hf
    params = {'Fs': fs, 'tapers': [1.5, 2], 'fpass': [0, 40]}
    IAC_getHf = IAC_Ht[:int(np.round(Keep_H * fs))]
    IAC_getHf = IAC_getHf.reshape([1, IAC_getHf.size])

    ITD_getHF = ITD_Ht[:int(np.round(Keep_H * fs))]
    ITD_getHF = ITD_getHF.reshape([1, ITD_getHF.size])

    out_IAC = mtspecraw(IAC_getHf, params)
    out_ITD = mtspecraw(ITD_getHF, params)
    IAC_Hf = out_IAC[0]
    ITD_Hf = out_ITD[0]
    f1 = out_IAC[1]

    #%% Compute Hf noise floors

    #!!!!!!!!!!!!!!!!!!!!!!!!!! Commenting out for now - 02/02/20201

    # NF_Hfs_IAC = np.zeros([Num_noiseFloors,IAC_Hf.size])
    # NF_Hfs_ITD = np.zeros([Num_noiseFloors,ITD_Hf.size])
    # for j in range(0,Num_noiseFloors):
    #     NF_getHf_IAC = IAC_nfs[j,:int(np.round(Keep_H*fs))]
    #     NF_getHf_IAC = NF_getHf_IAC.reshape([1,NF_getHf_IAC.size])
    #     NF_getHf_ITD = ITD_nfs[j,:int(np.round(Keep_H*fs))]