Commit: c36035ca080200e6e8e2a1bd0b03160b05390d44
Parent: 1f2db6c97d7316f2af84c7755cd6d885695ef43c
Author: Randy Palamar
Date: Tue, 14 Jan 2025 18:07:24 -0700
hadamard: fix adjacent channel swapping
Every pair of channels was swapped. This caused a double point
issue in HERCULES and an SNR loss in FORCES. It went unnoticed
because the CUDA implementation didn't have this issue (CUDA
supports i16 as a data type so there is no need to unpack from a
packed uv4).
Diffstat:
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/shaders/hadamard.glsl b/shaders/hadamard.glsl
@@ -27,10 +27,11 @@ void main()
/* NOTE: offsets for storing the results in the output data */
uint out_off = dec_data_dim.x * dec_data_dim.y * acq + dec_data_dim.x * channel + time_sample;
+ channel += channel_offset;
/* NOTE: channel mapping is stored as u16s so we must do this to extract the final value */
- uint ch_array_idx = ((channel + channel_offset) / 8);
- uint ch_vec_idx = ((channel + channel_offset) % 8) / 2;
- uint ch_elem_lfs = ((channel + channel_offset) & 1u) * 16;
+ uint ch_array_idx = (channel / 8);
+ uint ch_vec_idx = (channel % 8) / 2;
+ uint ch_elem_lfs = ((~channel) & 1u) * 16;
uint rf_channel = (channel_mapping[ch_array_idx][ch_vec_idx] << ch_elem_lfs) >> 16;
/* NOTE: stride is the number of samples between acquistions; off is the