B = FreqTrans.Bartlett(tBinB, N + 1) Bmag = np.abs(B) Bmax = np.nanmax(Bmag) Bnorm_mag = Bmag / Bmax tBinBapprox = np.linspace(0.0, time_s[-1] / tBinWidth, 80) timeBapprox_s = tBinWidth * tBinBapprox Bapprox_mag = 10**-(2 / 5) * (1 / tBinBapprox)**2 fig = 2 fig = FreqTrans.PlotGainTemporal(t_s, PwwNListMean / PwwNListMean.max(), None, None, None, fig=fig, dB=False, linestyle='-', color='b', label='Null Estimate at Input') fig = FreqTrans.PlotGainTemporal(timeD_s, Dnorm_mag, None, None, None, fig=fig, dB=False, UncSide='Max', linestyle='-', color='r',
gainThLinNomMean = np.mean(np.abs(gainThLinNom_mag[:,iOut,iIn,:]), axis=-1) gainThLinUncMean = np.mean(np.abs(gainThLinUnc_mag[:,iOut,iIn,:]), axis=-1) gainThLinUncMin = np.mean(np.abs(gainThLinNom_mag[:,iOut,iIn,:]) - np.abs(gainThLinUnc_mag[:,iOut,iIn,:]), axis=-1) * ones gainThEstNomMean = np.mean(np.abs(gainThEstNom_mag[:,iOut,iIn,:]), axis=-1) gainThEstUncMean = np.mean(np.abs(gainThEstUnc_mag[:,iOut,iIn,:]), axis=-1) gainThEstUncMin = np.mean(np.abs(gainThEstNom_mag[:,iOut,iIn,:]) - np.abs(gainThEstUnc_mag[:,iOut,iIn,:]), axis=-1) cohEst = np.abs(CuzList[:,iOut,iIn,:]) cohEstMean = np.mean(cohEst, axis=-1) cohEstStd = np.std(cohEst, axis=-1) cohEstMin = np.min(cohEst, axis=-1) fig = None fig = FreqTrans.PlotGainTemporal(t_s, gainThLinNomMean, None, coher_nd = ones, gainUnc_mag = gainThLinUncMean, fig = fig, dB = False, linestyle='-', color='k', label = 'Linear' + ' [$u_' + str(iIn+1) + '$ to ' + '$z_' + str(iOut+1) + '$]') # fig = FreqTrans.PlotGainTemporal(t_s, gainThLinUncMin, None, fig = fig, dB = False, linestyle=':', color='k', label = 'Linear - Lower') fig = FreqTrans.PlotGainTemporal(t_s, gainThEstNomMean, None, coher_nd = cohEstMean, gainUnc_mag = gainThEstUncMean, fig = fig, dB = False, linestyle='-', color='b', label = 'Estimate' + ' [$u_' + str(iIn+1) + '$ to ' + '$z_' + str(iOut+1) + '$]') # fig = FreqTrans.PlotGainTemporal(t_s, gainThEstUncMin, None, coher_nd = cohEstMin, fig = fig, dB = False, linestyle=':', color='r', label = 'Estimate - Lower') ax = fig.get_axes() ax[0].set_ylabel("Gain [mag]") handles, labels = ax[0].get_legend_handles_labels() handles = [(handles[0], handles[2]), (handles[1], handles[3])] labels = [labels[0], labels[1]] ax[0].legend(handles, labels) # fig.set_size_inches([6.4,4.8]) if False:
# zSNRMin[zSNRMin < 0] = 0 cohEst = np.abs(TaEstCohHist[:, iOut, iIn, :]) cohEst[cohEst < 0] = 0 cohEst[cohEst > 1] = 1 cohEstMean = np.mean(cohEst, axis=-1) cohEstMin = np.min(cohEst, axis=-1) fig = None ones = np.ones_like(time_s) fig = FreqTrans.PlotGainTemporal(time_s, zSNRMean, None, None, zSNRMin, fig=fig, dB=True, UncSide='Min', linestyle='-', color='r', label='Estimate of Output') fig = FreqTrans.PlotGainTemporal(time_s, uSNRMean, None, None, uSNRMin, fig=fig, dB=True, UncSide='Min', linestyle='-', color='k',