You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I'm not sure that the following is a bug or it is correct, I report what I notice:
I was looking the arrivals_to_impulse_response function in uwapm.py file and its computation. I notice that the amplitude of the arrival, row.arrival_amplitude, is setted in the right ndx position for each arrival, but, because ndx is computed as an approximation of the time of arrival (ndx = int(_np.round((row.time_of_arrival.real-t0)*fs))) can be happen that 2 different arrival have the same ndx index. In this case is correct to replace the ir[ndx] value with the last arrival amplitude, or should be added the new amplitude to the previous (ir[ndx] += row.arrival_amplitude)? In the first case aren't we losing one (or more) arrival?
I tried to generate arrivals with the following script:
Then I try to do some elaboration to investigate the results, I build two dictionary, A_arr, A_ir, which contains the pairs: time of arrival (approximated as in arrivals_to_impulse_response function) and a list of the amplitudes of each arrival received at this time. In lost_arr list is contained the tuple of "lost arrivals".
I also try to plot the sum of the amplitude of the impulse response and the sum of the amplitudes of the arrival (which I expected to be the same), but they differ in the quantities present inlost_arr.
>>>print(f'Sum of arrival amplitudes: {sum(list(arrivals.arrival_amplitude))}')
>>>print(f'Sum of impulse response amplitudes: {sum(ir)}')
>>>print(f'Sum of impulse response amplitudes + lost arrivals: {sum(ir) +sum([e[1] foreinlost_arr])}')
Sumofarrivalamplitudes: (0.00023585833449997007+0.001292865475452424j)
Sumofimpulseresponseamplitudes: (-7.266767664939084e-05+0.0012367161871826558j)
Sumofimpulseresponseamplitudes+lostarrivals: (0.00023585833449997015+0.0012928654754524244j)
I'm not sure if there is nothing wrong in my reasoning, if so I apologize, otherwise can you check too? In case it is correct to fix it replacing with ir[ndx] += row.arrival_amplitude the similar line in uwapm.arrivals_to_impulse_response function?
Thanks!
The text was updated successfully, but these errors were encountered:
Yes, it would make sense to add the amplitudes (as complex values). The current implementation implicitly assumes that the sampling rate is high enough to avoid overlapping arrivals. But even in that case, geometry can contrive to have two arrivals overlap, and we should handle it properly.
PR welcome, if you feel like taking a stab at fixing it @vinz-uts
Hi, I'm not sure that the following is a bug or it is correct, I report what I notice:
I was looking the
arrivals_to_impulse_response
function inuwapm.py
file and its computation. I notice that the amplitude of the arrival,row.arrival_amplitude
, is setted in the rightndx
position for each arrival, but, becausendx
is computed as an approximation of the time of arrival (ndx = int(_np.round((row.time_of_arrival.real-t0)*fs))
) can be happen that 2 different arrival have the samendx
index. In this case is correct to replace their[ndx]
value with the last arrival amplitude, or should be added the new amplitude to the previous (ir[ndx] += row.arrival_amplitude
)? In the first case aren't we losing one (or more) arrival?I tried to generate arrivals with the following script:
Then I try to do some elaboration to investigate the results, I build two dictionary,
A_arr
,A_ir
, which contains the pairs: time of arrival (approximated as inarrivals_to_impulse_response
function) and a list of the amplitudes of each arrival received at this time. Inlost_arr
list is contained the tuple of "lost arrivals".I also try to plot the sum of the amplitude of the impulse response and the sum of the amplitudes of the arrival (which I expected to be the same), but they differ in the quantities present in
lost_arr
.I'm not sure if there is nothing wrong in my reasoning, if so I apologize, otherwise can you check too? In case it is correct to fix it replacing with
ir[ndx] += row.arrival_amplitude
the similar line inuwapm.arrivals_to_impulse_response
function?Thanks!
The text was updated successfully, but these errors were encountered: