Skip to content

[BUG] NotATransducer.scan_line use apodization only for delay != 0 #627

@SquareSon

Description

@SquareSon

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

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions