Esempio n. 1
0
# PowerSpectra can be used instead
#===============================================================================
f = PowerSpectra(
    time_data=t1,
    window='Hanning',
    overlap='50%',
    block_size=128,  #FFT-parameters
    ind_low=8,
    ind_high=16)  #to save computational effort, only
# frequencies with index 1-30 are used

#===============================================================================
# the environment, i.e. medium characteristics
# (in this case, the speed of sound is set)
#===============================================================================
env = Environment(c=346.04)

# =============================================================================
# a steering vector instance. SteeringVector provides the standard freefield
# sound propagation model in the steering vectors.
# =============================================================================
st = SteeringVector(grid=g, mics=m, env=env)

#===============================================================================
# beamformers in frequency domain
#===============================================================================
bb = BeamformerBase(freq_data=f, steer=st, r_diag=True)
bd = BeamformerDamas(beamformer=bb, n_iter=100)
be = BeamformerEig(freq_data=f, steer=st, r_diag=True, n=54)
bo = BeamformerOrth(beamformer=be, eva_list=list(range(38, 54)))
bs = BeamformerCleansc(freq_data=f, steer=st, r_diag=True)
Esempio n. 2
0
               x_max=0.2,
               y_min=-0.2,
               y_max=0.2,
               z_min=0.5,
               z_max=0.9,
               increment=0.2)
gc = g.gpos

flows = [
    SlotJet(v0=70.0, origin=(-0.7, 0, 0.7)),
    OpenJet(v0=70.0, origin=(-0.7, 0, 0.7)),
    RotatingFlow(v0=70.0, rpm=1000.0)
]

envs = [
    Environment(),
    UniformFlowEnvironment(ma=0.3),
    GeneralFlowEnvironment(ff=OpenJet(v0=70.0, origin=(-0.7, 0, 0.7)))
]


class acoular_env_test(unittest.TestCase):
    def test_flow_results(self):
        for fl in flows:
            with self.subTest(fl.__class__.__name__):
                name = join('reference_data', f'{fl.__class__.__name__}.npy')
                # stack all results
                actual_data = np.array([np.vstack(fl.v(x)) for x in gc.T])
                if WRITE_NEW_REFERENCE_DATA:
                    np.save(name, actual_data)
                ref_data = np.load(name)