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)
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 map = b.synthetic(cfreq, 1) mx = L_p(map.max()) imshow(L_p(map.T), origin='lower',
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, cached=False) class acoular_test(unittest.TestCase): #test if microfon positions are correct
psf64 = PointSpreadFunction(grid=g, mpos=m, c=346.04, precision='float64') psf64Res = psf64.psf[:] bb32 = BeamformerBase(freq_data=f, grid=g, mpos=m, r_diag=True, c=346.04, precision='float32') bb32Res = bb32.synthetic(cfreq,1) bb64 = BeamformerBase(freq_data=f, grid=g, mpos=m, r_diag=True, c=346.04, precision='float64') bb64Res = bb64.synthetic(cfreq,1) bf = BeamformerFunctional(freq_data=f, grid=g, mpos=m, r_diag=False, c=346.04, gamma = 60, precision='float32') bfRes = bf.synthetic(cfreq,1) # 32 Bit PSF precision bd3232 = BeamformerDamas(beamformer=bb32, n_iter=100, psf_precision='float32') bd3232Res = bd3232.synthetic(cfreq,1) bc3232 = BeamformerClean(beamformer=bb32, psf_precision='float32') bc3232Res = bc3232.synthetic(cfreq,1) bdp3232 = BeamformerDamasPlus(beamformer=bb32, n_iter=100, psf_precision='float32') bdp3232Res = bdp3232.synthetic(cfreq,1) #64 Bit bd3264 = BeamformerDamas(beamformer=bb32, n_iter=100, psf_precision='float64') bd3264Res = bd3264.synthetic(cfreq,1) bc3264 = BeamformerClean(beamformer=bb32, psf_precision='float64') bc3264Res = bc3264.synthetic(cfreq,1) bdp3264 = BeamformerDamasPlus(beamformer=bb32, n_iter=100, psf_precision='float64') bdp3264Res = bdp3264.synthetic(cfreq,1) # 32 Bit PSF precision bd6432 = BeamformerDamas(beamformer=bb64, n_iter=100, psf_precision='float32') bd6432Res = bd6432.synthetic(cfreq,1)
## ## #psfFull = PointSpreadFunction(grid=g, mpos=m, calcmode='full') ## #LPsfFull = L_p(psfFull.psf[:]) ## ## #all_bf = (LPsfFull,) ##============================================================================== psf1 = PointSpreadFunction(grid=g, mpos=m, c=346.04, steer='classic') psf2 = PointSpreadFunction(grid=g, mpos=m, c=346.04, steer='inverse') psf3 = PointSpreadFunction(grid=g, mpos=m, c=346.04, steer='true level') psf4 = PointSpreadFunction(grid=g, mpos=m, c=346.04, steer='true location') Lpsf1 = L_p(psf1.psf[:]) Lpsf2 = L_p(psf2.psf[:]) Lpsf3 = L_p(psf3.psf[:]) Lpsf4 = L_p(psf4.psf[:]) bcpsf1Rem = BeamformerClean(beamformer=bb1Rem) bcpsf2Rem = BeamformerClean(beamformer=bb2Rem) bcpsf3Rem = BeamformerClean(beamformer=bb3Rem) bcpsf4Rem = BeamformerClean(beamformer=bb4Rem) bcpsf1Full = BeamformerClean(beamformer=bb1Full) bcpsf2Full = BeamformerClean(beamformer=bb2Full) bcpsf3Full = BeamformerClean(beamformer=bb3Full) bcpsf4Full = BeamformerClean(beamformer=bb4Full) Lbcpsf1Rem = L_p(bcpsf1Rem.synthetic(4000, 1)) Lbcpsf2Rem = L_p(bcpsf2Rem.synthetic(4000, 1)) Lbcpsf3Rem = L_p(bcpsf3Rem.synthetic(4000, 1)) Lbcpsf4Rem = L_p(bcpsf4Rem.synthetic(4000, 1)) Lbcpsf1Full = L_p(bcpsf1Full.synthetic(4000, 1)) Lbcpsf2Full = L_p(bcpsf2Full.synthetic(4000, 1)) Lbcpsf3Full = L_p(bcpsf3Full.synthetic(4000, 1)) Lbcpsf4Full = L_p(bcpsf4Full.synthetic(4000, 1))
## ## #psfFull = PointSpreadFunction(grid=g, mpos=m, calcmode='full') ## #LPsfFull = L_p(psfFull.psf[:]) ## ## #all_bf = (LPsfFull,) ##============================================================================== psf1 = PointSpreadFunction(grid=g, mpos=m, c=346.04, steer='classic') psf2 = PointSpreadFunction(grid=g, mpos=m, c=346.04, steer='inverse') psf3 = PointSpreadFunction(grid=g, mpos=m, c=346.04, steer='true level') psf4 = PointSpreadFunction(grid=g, mpos=m, c=346.04, steer='true location') Lpsf1 = L_p(psf1.psf[:]) Lpsf2 = L_p(psf2.psf[:]) Lpsf3 = L_p(psf3.psf[:]) Lpsf4 = L_p(psf4.psf[:]) bcpsf1Rem = BeamformerClean(beamformer=bb1Rem) bcpsf2Rem = BeamformerClean(beamformer=bb2Rem) bcpsf3Rem = BeamformerClean(beamformer=bb3Rem) bcpsf4Rem = BeamformerClean(beamformer=bb4Rem) bcpsf1Full = BeamformerClean(beamformer=bb1Full) bcpsf2Full = BeamformerClean(beamformer=bb2Full) bcpsf3Full = BeamformerClean(beamformer=bb3Full) bcpsf4Full = BeamformerClean(beamformer=bb4Full) Lbcpsf1Rem = L_p(bcpsf1Rem.synthetic(4000,1)) Lbcpsf2Rem = L_p(bcpsf2Rem.synthetic(4000,1)) Lbcpsf3Rem = L_p(bcpsf3Rem.synthetic(4000,1)) Lbcpsf4Rem = L_p(bcpsf4Rem.synthetic(4000,1)) Lbcpsf1Full = L_p(bcpsf1Full.synthetic(4000,1)) Lbcpsf2Full = L_p(bcpsf2Full.synthetic(4000,1)) Lbcpsf3Full = L_p(bcpsf3Full.synthetic(4000,1)) Lbcpsf4Full = L_p(bcpsf4Full.synthetic(4000,1))