def fbeamformers(): bb = BeamformerBase(freq_data=f, steer=st, r_diag=True, cached=False) be = BeamformerEig(freq_data=f, steer=st, r_diag=True, n=54, cached=False) #frequency beamformers to test bbase = BeamformerBase(freq_data=f, steer=st, r_diag=True, cached=False) bc = BeamformerCapon(freq_data=f, steer=st, cached=False) beig = BeamformerEig(freq_data=f, steer=st, r_diag=True, n=54, cached=False) bm = BeamformerMusic(freq_data=f, steer=st, n=6, cached=False) bd = BeamformerDamas(beamformer=bb, n_iter=10, cached=False) bdp = BeamformerDamasPlus(beamformer=bb, n_iter=100, cached=False) bo = BeamformerOrth(beamformer=be, eva_list=list(range(38, 54)), cached=False) bs = BeamformerCleansc(freq_data=f, steer=st, r_diag=True, cached=False) bcmf = BeamformerCMF(freq_data=f, steer=st, method='LassoLarsBIC', cached=False) bl = BeamformerClean(beamformer=bb, n_iter=10, cached=False) bf = BeamformerFunctional(freq_data=f, steer=st, r_diag=False, gamma=3, cached=False) bgib = BeamformerGIB(freq_data=f, steer=st, method='LassoLars', n=2, cached=False) return (bbase, bc, beig, bm, bl, bo, bs, bd, bcmf, bf, bdp, bgib)
window='Hanning', overlap='50%', block_size=128, #FFT-parameters ind_low=8, ind_high=16) #to save computational effort, only # frequencies with indices 8..15 are used #=============================================================================== # different beamformers in frequency domain #=============================================================================== bb = BeamformerBase(freq_data=f, grid=g, mpos=m, r_diag=True, c=346.04) bc = BeamformerCapon(freq_data=f, grid=g, mpos=m, c=346.04, cached=False) be = BeamformerEig(freq_data=f, grid=g, mpos=m, r_diag=True, c=346.04, n=54) bm = BeamformerMusic(freq_data=f, grid=g, mpos=m, c=346.04, n=6) bd = BeamformerDamas(beamformer=bb, n_iter=100) bo = BeamformerOrth(beamformer=be, eva_list=list(range(38, 54))) bs = BeamformerCleansc(freq_data=f, grid=g, mpos=m, r_diag=True, c=346.04) bcmf = BeamformerCMF(freq_data=f, grid=g, mpos=m, c=346.04, \ method='LassoLarsBIC') bl = BeamformerClean(beamformer=bb, n_iter=100) bf = BeamformerFunctional(freq_data=f, grid=g, mpos=m, r_diag=False, c=346.04, \ gamma=4) #=============================================================================== # plot result maps for different beamformers in frequency domain #=============================================================================== figure(1, (10, 6)) i1 = 1 #no of subplot for b in (bb, bc, be, bm, bl, bo, bs, bd, bcmf, bf): subplot(3, 4, i1) i1 += 1
st = SteeringVector(grid=g, mics=m, env=env) f = PowerSpectra( time_data=t1, window='Hanning', overlap='50%', block_size=128, #FFT-parameters cached=False) #cached = False bb = BeamformerBase(freq_data=f, steer=st, r_diag=True, cached=False) bc = BeamformerCapon(freq_data=f, steer=st, cached=False) be = BeamformerEig(freq_data=f, steer=st, r_diag=True, n=54, cached=False) bm = BeamformerMusic(freq_data=f, steer=st, n=6, cached=False) bd = BeamformerDamas(beamformer=bb, n_iter=100, cached=False) bdp = BeamformerDamasPlus(beamformer=bb, n_iter=100, cached=False) bo = BeamformerOrth(beamformer=be, eva_list=list(range(38, 54)), cached=False) bs = BeamformerCleansc(freq_data=f, steer=st, r_diag=True, cached=False) bcmf = BeamformerCMF(freq_data=f, steer=st, method='LassoLarsBIC', cached=False) bl = BeamformerClean(beamformer=bb, n_iter=100, cached=False) bf = BeamformerFunctional(freq_data=f, steer=st, r_diag=False, gamma=4, cached=False) bgib = BeamformerGIB(freq_data=f, steer=st, method='LassoLars', n=10,
bcsc4Full = BeamformerCleansc(freq_data=f, grid=g, mpos=m, r_diag=False, c=346.04, steer='true location') Lbcsc1Rem = L_p(bcsc1Rem.synthetic(4000, 1)) Lbcsc2Rem = L_p(bcsc2Rem.synthetic(4000, 1)) Lbcsc3Rem = L_p(bcsc3Rem.synthetic(4000, 1)) Lbcsc4Rem = L_p(bcsc4Rem.synthetic(4000, 1)) Lbcsc1Full = L_p(bcsc1Full.synthetic(4000, 1)) Lbcsc2Full = L_p(bcsc2Full.synthetic(4000, 1)) Lbcsc3Full = L_p(bcsc3Full.synthetic(4000, 1)) Lbcsc4Full = L_p(bcsc4Full.synthetic(4000, 1)) bort1Rem = BeamformerOrth(beamformer=be1Rem, eva_list=list(range(4, 8))) bort2Rem = BeamformerOrth(beamformer=be2Rem, eva_list=list(range(4, 8))) bort3Rem = BeamformerOrth(beamformer=be3Rem, eva_list=list(range(4, 8))) bort4Rem = BeamformerOrth(beamformer=be4Rem, eva_list=list(range(4, 8))) bort1Full = BeamformerOrth(beamformer=be1Full, eva_list=list(range(4, 8))) bort2Full = BeamformerOrth(beamformer=be2Full, eva_list=list(range(4, 8))) bort3Full = BeamformerOrth(beamformer=be3Full, eva_list=list(range(4, 8))) bort4Full = BeamformerOrth(beamformer=be4Full, eva_list=list(range(4, 8))) Lbort1Rem = L_p(bort1Rem.synthetic(4000, 1)) Lbort2Rem = L_p(bort2Rem.synthetic(4000, 1)) Lbort3Rem = L_p(bort3Rem.synthetic(4000, 1)) Lbort4Rem = L_p(bort4Rem.synthetic(4000, 1)) Lbort1Full = L_p(bort1Full.synthetic(4000, 1)) Lbort2Full = L_p(bort2Full.synthetic(4000, 1)) Lbort3Full = L_p(bort3Full.synthetic(4000, 1)) Lbort4Full = L_p(bort4Full.synthetic(4000, 1))
bcsc3Rem = BeamformerCleansc(freq_data=f, grid=g, mpos=m, r_diag=True, c=346.04, steer='true level') bcsc4Rem = BeamformerCleansc(freq_data=f, grid=g, mpos=m, r_diag=True, c=346.04, steer='true location') bcsc1Full = BeamformerCleansc(freq_data=f, grid=g, mpos=m, r_diag=False, c=346.04, steer='classic') bcsc2Full = BeamformerCleansc(freq_data=f, grid=g, mpos=m, r_diag=False, c=346.04, steer='inverse') bcsc3Full = BeamformerCleansc(freq_data=f, grid=g, mpos=m, r_diag=False, c=346.04, steer='true level') bcsc4Full = BeamformerCleansc(freq_data=f, grid=g, mpos=m, r_diag=False, c=346.04, steer='true location') Lbcsc1Rem = L_p(bcsc1Rem.synthetic(4000,1)) Lbcsc2Rem = L_p(bcsc2Rem.synthetic(4000,1)) Lbcsc3Rem = L_p(bcsc3Rem.synthetic(4000,1)) Lbcsc4Rem = L_p(bcsc4Rem.synthetic(4000,1)) Lbcsc1Full = L_p(bcsc1Full.synthetic(4000,1)) Lbcsc2Full = L_p(bcsc2Full.synthetic(4000,1)) Lbcsc3Full = L_p(bcsc3Full.synthetic(4000,1)) Lbcsc4Full = L_p(bcsc4Full.synthetic(4000,1)) bort1Rem = BeamformerOrth(beamformer=be1Rem, eva_list=list(range(4,8))) bort2Rem = BeamformerOrth(beamformer=be2Rem, eva_list=list(range(4,8))) bort3Rem = BeamformerOrth(beamformer=be3Rem, eva_list=list(range(4,8))) bort4Rem = BeamformerOrth(beamformer=be4Rem, eva_list=list(range(4,8))) bort1Full = BeamformerOrth(beamformer=be1Full, eva_list=list(range(4,8))) bort2Full = BeamformerOrth(beamformer=be2Full, eva_list=list(range(4,8))) bort3Full = BeamformerOrth(beamformer=be3Full, eva_list=list(range(4,8))) bort4Full = BeamformerOrth(beamformer=be4Full, eva_list=list(range(4,8))) Lbort1Rem = L_p(bort1Rem.synthetic(4000,1)) Lbort2Rem = L_p(bort2Rem.synthetic(4000,1)) Lbort3Rem = L_p(bort3Rem.synthetic(4000,1)) Lbort4Rem = L_p(bort4Rem.synthetic(4000,1)) Lbort1Full = L_p(bort1Full.synthetic(4000,1)) Lbort2Full = L_p(bort2Full.synthetic(4000,1)) Lbort3Full = L_p(bort3Full.synthetic(4000,1)) Lbort4Full = L_p(bort4Full.synthetic(4000,1))
# "SlotJet.plane item assignment": (SlotJet(), "obj.plane[0] = 1."), "SlotJet.plane array assignment": (SlotJet(), "obj.plane = array((1., 0., 0.))"), # "OpenJet.origin item assignment": (OpenJet(), "obj.origin[0] = 1."), "OpenJet.origin array assignment": (OpenJet(), "obj.origin = array((1., 0., 0.))"), # "RotatingFlow.origin item assignment": (RotatingFlow(), "obj.origin[0] = 1."), "RotatingFlow.origin array assignment": (RotatingFlow(), "obj.origin = array((1., 0., 0.))"), #fbeamform.py # "SteeringVector.ref item assignment": (SteeringVector(), "obj.ref[0] = 1."), "SteeringVector.ref array assignment": (SteeringVector(), "obj.ref = array((1., 1., 1.))"), # "BeamformerOrth.eva_list item assignment": (BeamformerOrth(eva_list=array((0, 1))), "obj.eva_list[0] = 2"), "BeamformerOrth.eva_list array assignment": (BeamformerOrth(eva_list=array((0, 1))), "obj.eva_list = array((2))"), #grids.py "MergeGrid.grids item assignment": (MergeGrid(grids=[RectGrid()]), "obj.grids[0] = RectGrid()"), "MergeGrid.grids list assignment": (MergeGrid(), "obj.grids = [RectGrid()]"), # signals.py # "FiltWNoiseGenerator.ar item assignment": (FiltWNoiseGenerator(ar=[1.,2.,3.]), "obj.ar[0] = 0."), "FiltWNoiseGenerator.ar array assignment": (FiltWNoiseGenerator(ar=[1., 2., 3.]), "obj.ar = array((0., 0., 0.))"), # "FiltWNoiseGenerator.ma item assignment": (FiltWNoiseGenerator(ma=[1.,2.,3.]), "obj.ma[0] = 0."), "FiltWNoiseGenerator.mar array assignment": (FiltWNoiseGenerator(ma=[1., 2., 3.]), "obj.ma = array((0., 0., 0.))"), #sources.py "MaskedTimeSamples.invalid_channels item assignment": (MaskedTimeSamples(invalid_channels=[1]), "obj.invalid_channels[0] = 0"),
# eigenvalues and eigenvectors, if only the matrix is needed then class # PowerSpectra can be used instead #=============================================================================== f = EigSpectra( time_data=t1, window='Hanning', overlap='50%', block_size=128, #FFT-parameters ind_low=4, ind_high=15) #to save computational effort, only # frequencies with index 1-30 are used #=============================================================================== # different beamformers in frequency domain #=============================================================================== # first, some simple delay and sum beamformers, # but with different steering vector types #=============================================================================== bb0 = BeamformerBase(freq_data=f, grid=g, mpos=m, r_diag=True, c=346.04, \ steer='true level', cached = False) # this is the default bs0 = BeamformerCleansc(freq_data=f, grid=g, mpos=m, r_diag=True, c=346.04, \ steer='true level', cached=False, n=200) be0 = BeamformerEig(freq_data=f, grid=g, mpos=m, r_diag=True, c=346.04, n=-1, \ steer='true level', cached=False) bo0 = BeamformerOrth(beamformer=be0, eva_list=range(38, 54), cached=False) from time import time ti = time() map = bs0.result[:] print time() - ti, g.size