Beispiel #1
0
# some important definitions
#===============================================================================

freq = 6144.0*3/128.0 # frequency of interest (114 Hz)
sfreq = 6144.0/2 # sampling frequency (3072 Hz)
r = 3.0 # array radius
R = 2.5 # radius of source trajectory
Z = 4 # distance of source trajectory from 
rps = 15.0/60. # revolutions per second
U = 3.0 # total number of revolutions

#===============================================================================
# construct the trajectory for the source
#===============================================================================

tr = Trajectory()
tr1 = Trajectory()
tmax = U/rps
delta_t = 1./rps/16.0 # 16 steps per revolution
for t in arange(0, tmax*1.001, delta_t):
    i = t* rps * 2 * pi #angle
    # define points for trajectory spline
    tr.points[t] = (R*cos(i), R*sin(i), Z) # anti-clockwise rotation
    tr1.points[t] = (R*cos(i), R*sin(i), Z) # anti-clockwise rotation

#===============================================================================
# define circular microphone array
#===============================================================================

m = MicGeom()
# set 28 microphone positions
Beispiel #2
0
#===============================================================================

freq = 6144.0 * 3 / 128.0  # frequency of interest (114 Hz)
sfreq = 6144.0 / 2  # sampling frequency (3072 Hz)
c0 = 343.0  # speed of sound
r = 3.0  # array radius
R = 2.5  # radius of source trajectory
Z = 4  # distance of source trajectory from
rps = 15.0 / 60.  # revolutions per second
U = 3.0  # total number of revolutions

#===============================================================================
# construct the trajectory for the source
#===============================================================================

tr = Trajectory()
tr1 = Trajectory()
tmax = U / rps
delta_t = 1. / rps / 16.0  # 16 steps per revolution
for t in arange(0, tmax * 1.001, delta_t):
    i = t * rps * 2 * pi  #angle
    # define points for trajectory spline
    tr.points[t] = (R * cos(i), R * sin(i), Z)  # anti-clockwise rotation
    tr1.points[t] = (R * cos(i), R * sin(i), Z)  # anti-clockwise rotation

#===============================================================================
# define circular microphone array
#===============================================================================

m = MicGeom()
# set 28 microphone positions
Beispiel #3
0
passby_dist = .5  # distance that the source is passing in front of array
CONV_AMP = True

# create linear mic geom
MGEOM = MicGeom()
N = 5
L = .5
MGEOM.mpos_tot = np.zeros((3, N), dtype=np.float64)
win = np.sin(np.arange(N) * np.pi / (N - 1))
b = 0.4
MGEOM.mpos_tot[0] = np.linspace(-L, L, N) * (1 - b) / (win * b + 1 - b)

# Monopole Trajectory
t_passby = passby_dist / SPEED / 3.6
nsamples = int(t_passby * SFREQ)
TRAJ = Trajectory()  # source center
TRAJ.points[0] = (-passby_dist / 2 + SOURCE_POS[0], SOURCE_POS[1],
                  SOURCE_POS[2])
TRAJ.points[t_passby] = (+passby_dist / 2, SOURCE_POS[1], SOURCE_POS[2])


def create_test_time_data(nsamples):
    """
    creates test data for a single moving monopole emitting white noise
    
    Parameters
    ----------
    speed : float
        source velocity in m/s.

    Returns