Trajectory def from .h5 source file: Moving focus time domain beamforming

53 views
Skip to first unread message

Sri Chaitanya Durga Prasad Mojjada

unread,
Sep 26, 2023, 5:03:09 AM9/26/23
to Acoular-users
Dear acoular users,
I have tried to define the trajectory of my test case by importing the .h5 source data containing a trigger signal in it's last channel 

I have used Trigger class and AngleTracker class to define trajectory.

I have defined trajectory in two ways as shown in the code below

Which way is the right way to do it?
Am I missing anything else? 

# File paths
h5_file = r'\\epm.ebmpapst.loc\DBA\Winuser\PAMOJJAD\Documents\Python Scripts\DLR_results\Neuer Ordner\case3.h5'
mic_geom_file = r'\\epm.ebmpapst.loc\DBA\Winuser\pamojjad\Documents\Python Scripts\DLRsensorpos4.xml'

# Load microphone geometry
m = acoular.MicGeom(from_file=mic_geom_file)
m.invalid_channels = [80,81]

# Extract trigger signal and RPM
tr = acoular.MaskedTimeSamples( name=r'\\epm.ebmpapst.loc\DBA\Winuser\PAMOJJAD\Documents\Python Scripts\DLR_results\Neuer Ordner\case3.h5' )
invalid = [i for i in range(81)]# list of invalid channels (unwanted microphones etc.)
tr.invalid_channels = invalid #
t = acoular.MaskedTimeSamples(name=h5_file,start=0,stop=1000)
t.invalid_channels = [80,81]
trigger = acoular.Trigger(source=tr, threshold=0.5)  # Adjust as needed
triggerdata=trigger.trigger_data
angle_tracker = acoular.AngleTracker(source=t, trigger=trigger)
ang = angle_tracker.angle

rps=angle_tracker.average_rpm /60
U=59#number of revolutions taken based on the size of trigger data
tmax=U/rps
delta_t = 1./rps/16.0
freq=800
sfreq=48076.92
# Construct the trajectory based on RPM
R = 0.7  # Radius of the trajectory (change as needed)
#Traj defined directly from angle
traj = acoular.Trajectory()
for idx, a in enumerate(ang):
    traj.points[idx] = (R*cos(a), R*sin(a), 0.3)  # Adjust Z-coordinate as needed
   
   
# =============================================================================
#traj defined as shown in the example of rotating point sources
# traj = Trajectory()
# for tl in arange(0, tmax*1.001, delta_t):
#     i = tl* rps * 2 * pi #angle
#     # define points for trajectory spline
#     traj.points[tl] = (R*cos(i), R*sin(i), 0.3) # anti-clockwise rotation


Kindly please get back to me

Thanks,
Chaitanya.Mojjada. 

Reply all
Reply to author
Forward
0 new messages