Skip to content

Commit cd66ace

Browse files
peterhollenderebrahimebrahim
authored andcommitted
Remove commented code from crosstalk #443
1 parent 891b031 commit cd66ace

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

src/openlifu/sim/kwave_if.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,10 @@ def run_simulation(arr: xdc.Transducer,
161161
source_mat = arr.calc_output(amplitude=amplitude, cycles=cycles, frequency=freq, dt=kgrid.dt, delays=delays, apod=apod)
162162
source_mat = source_mat[:, :kgrid.Nt]
163163
if arr.crosstalk_frac != 0:
164-
# Simulate crosstalk by adding additional elements to the array for each element that
165-
# is within the crosstalk distance, with the signal scaled by the crosstalk fraction.
166-
# This is a simple model of crosstalk and may not capture all the complexities of real
167-
# crosstalk, but it can be useful for testing and simulation purposes.
168-
#crosstalk_arr = arr.copy()
164+
# Simulate crosstalk by accumulating fraction of the source signal from each element into
165+
# its neighbors within a certain distance. This is a simple model of crosstalk and may
166+
# not capture all the complexities of real crosstalk, but it can be useful for testing
167+
# and simulation purposes.
169168
crosstalk_mat = source_mat.copy()
170169
positions = arr.get_positions(units="m")
171170
for src_idx in range(arr.numelements()):
@@ -176,10 +175,7 @@ def run_simulation(arr: xdc.Transducer,
176175
dst_pos = np.array(positions[dst_idx])
177176
dist = np.linalg.norm(src_pos - dst_pos)
178177
if dist <= arr.crosstalk_dist:
179-
# crosstalk_arr.elements += [arr.elements[dst_idx].copy()]
180178
crosstalk_mat[dst_idx,:] += arr.crosstalk_frac*source_mat[src_idx,:]
181-
#crosstalk_mat = np.vstack((crosstalk_mat, arr.crosstalk_frac*source_mat[src_idx,:]))
182-
#arr = crosstalk_arr
183179
source_mat = crosstalk_mat
184180
karray = get_karray(arr,
185181
translation=array_offset,

0 commit comments

Comments
 (0)