-
Notifications
You must be signed in to change notification settings - Fork 46
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
NotATransducer.scan_line use apodization to give each sensor_data line a weight. But only for delays!=0, which I think maybe unreasonable.
Besides, I do not understand why line do not need to divide the weighted sum.
np.sum(sensor_data, axis=0) / apodization.sum()
def scan_line(self, sensor_data):
"""
Apply beamforming and apodization to the sensor data.
"""
# Get the current apodization setting
apodization = self.get_receive_apodization()
# Get the current beamforming weights and reverse
delays = -self.beamforming_delays
# Offset the received sensor_data by the beamforming delays and apply receive apodization
for element_index in range(self.number_active_elements):
if delays[element_index] > 0:
# Shift element data forwards
sensor_data[element_index, :] = (
np.pad(sensor_data[element_index, delays[element_index] :], (0, delays[element_index]), "constant")
* apodization[element_index]
)
elif delays[element_index] < 0:
# Shift element data backwards
sensor_data[element_index, :] = (
np.pad(
sensor_data[element_index, : sensor_data.shape[1] + delays[element_index]], (-delays[element_index], 0), "constant"
)
* apodization[element_index]
)
# Form the line summing across the elements
line = np.sum(sensor_data, axis=0)
return line
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working