ogl_beamforming

Ultrasound Beamforming Implemented with OpenGL
git clone anongit@rnpnr.xyz:ogl_beamforming.git
Log | Files | Refs | Feed | Submodules | LICENSE

Commit: dab382fea386eb1309631c9201763405f5518dbb
Parent: 6b154dc205c1cdd2526dabb90bc584d59de8f72f
Author: Randy Palamar
Date:   Fri, 26 Jul 2024 15:36:40 -0600

add pulse length correction to (u)forces shader

Diffstat:
Mbeamformer_parameters.h | 3++-
Mshaders/hadamard.glsl | 1+
Mshaders/lpf.glsl | 1+
Mshaders/uforces.glsl | 3++-
4 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/beamformer_parameters.h b/beamformer_parameters.h @@ -19,5 +19,6 @@ typedef struct { f32 sampling_frequency; /* [Hz] */ f32 center_frequency; /* [Hz] */ f32 focal_depth; /* [m] */ - f32 _pad[3]; + f32 time_offset; /* pulse length correction time [s] */ + f32 _pad[2]; } BeamformerParameters; diff --git a/shaders/hadamard.glsl b/shaders/hadamard.glsl @@ -31,6 +31,7 @@ layout(std140, binding = 0) uniform parameters { float sampling_frequency; /* [Hz] */ float center_frequency; /* [Hz] */ float focal_depth; /* [m] */ + float time_offset; /* pulse length correction time [s] */ }; void main() diff --git a/shaders/lpf.glsl b/shaders/lpf.glsl @@ -31,6 +31,7 @@ layout(std140, binding = 0) uniform parameters { float sampling_frequency; /* [Hz] */ float center_frequency; /* [Hz] */ float focal_depth; /* [m] */ + float time_offset; /* pulse length correction time [s] */ }; //layout(location = 1) uniform uint u_lpf_order; diff --git a/shaders/uforces.glsl b/shaders/uforces.glsl @@ -23,6 +23,7 @@ layout(std140, binding = 0) uniform parameters { float sampling_frequency; /* [Hz] */ float center_frequency; /* [Hz] */ float focal_depth; /* [m] */ + float time_offset; /* pulse length correction time [s] */ }; layout(rg32f, location = 1) uniform image3D u_out_data_tex; @@ -91,7 +92,7 @@ void main() vec2 rdist = vec2(x, image_point.z); for (uint j = 0; j < dec_data_dim.y; j++) { float dist = transmit_dist + length(rdist); - float time = dist / speed_of_sound; + float time = dist / speed_of_sound + time_offset; /* NOTE: do cubic interp between adjacent time samples */ vec2 p = cubic(ridx, time * sampling_frequency);