<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>k-Wave User Forum &#187; Topic: only change alpha coef but still have reflection and question about steer angle</title>
		<link>http://www.k-wave.org/forum/topic/only-change-alpha-coef-but-still-have-reflection-and-question-about-steer-angle</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:40:11 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.k-wave.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.k-wave.org/forum/rss/topic/only-change-alpha-coef-but-still-have-reflection-and-question-about-steer-angle" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "only change alpha coef but still have reflection and question about steer angle"</title>
			<link>http://www.k-wave.org/forum/topic/only-change-alpha-coef-but-still-have-reflection-and-question-about-steer-angle#post-8769</link>
			<pubDate>Sun, 21 May 2023 14:05:16 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8769@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I haven't run your code, but regarding the reflection coefficient, there are two things to consider:&#60;/p&#62;
&#60;p&#62;1. For &#60;code&#62;alpha_power&#60;/code&#62; not equal to 2, the medium will be dispersive. This means the sound speed will vary as a function of frequency, and as a function of &#60;code&#62;alpha_coeff&#60;/code&#62;. In this case, having a heterogeneous &#60;code&#62;alpha_coeff&#60;/code&#62; also means you have a heterogeneous sound speed (even if you didn't set one using &#60;code&#62;medium.sound_speed&#60;/code&#62;).&#60;/p&#62;
&#60;p&#62;2. Even in a non-dispersive medium (e.g., with &#60;code&#62;alpha_power&#60;/code&#62; set to 2), you will still get a (very small) reflection when the absorption is non-constant (even if the sound speed and density are matched). This is because changing the absorption will modify the specific acoustic impedance.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>daibingze on "only change alpha coef but still have reflection and question about steer angle"</title>
			<link>http://www.k-wave.org/forum/topic/only-change-alpha-coef-but-still-have-reflection-and-question-about-steer-angle#post-8683</link>
			<pubDate>Thu, 01 Dec 2022 23:53:24 +0000</pubDate>
			<dc:creator>daibingze</dc:creator>
			<guid isPermaLink="false">8683@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;br /&#62;
i met a problem while simulating with k-wave.&#60;br /&#62;
The case i test is keeping the 3-D medium's properties all the same but alpha coef which is the attenuation coeff at the middle of the area with a cylinder shape. I set c0 = 1540m/s rho0 = 1000, alpha_power = 1.5 or 1.01, and a map of alpha coef, within the cylinder, it's 1 and the other area is 0.5. i'm imaging the area with single angle planewave.&#60;br /&#62;
Theoretically, i should get an only black backscattered bmode image becausethere's no impedence mismatch which related to rho and c,so there should not be a reflector in the backscattered image.But what i actually got is it seems like there are two reflectors at the top and bottom edge of the circle area. Can anyone help explain this? &#60;/p&#62;
&#60;p&#62;And during the testing, i met another problem about steering angle of the transducer,i wanted to tranmit steered planewaves and compound them into one image, but it seems like the steer is not electronic steering, it's mechanically steer the transducer, so when i do delay and sum, i should not add the steered angle there. Am i understanding it correct?&#60;/p&#62;
&#60;p&#62;Thank you! and the following is the code.&#60;/p&#62;
&#60;p&#62;clearvars;close all;&#60;br /&#62;
addpath(genpath([pwd,'/k-wave-toolbox-version-1.3']))&#60;br /&#62;
% simulation settings&#60;br /&#62;
DATA_CAST       = 'gpuArray-single';     % set to 'single' or 'gpuArray-single' to speed up computations&#60;br /&#62;
RUN_SIMULATION  = true;         % set to false to reload previous results instead of running simulation&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE THE K-WAVE GRID&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% set the size of the perfectly matched layer (PML)&#60;br /&#62;
pml_x_size = 20;                % [grid points]&#60;br /&#62;
pml_y_size = 20;                % [grid points]&#60;br /&#62;
pml_z_size = 10;                % [grid points]&#60;/p&#62;
&#60;p&#62;% set total number of grid points not including the PML&#60;br /&#62;
%Nx = 1024+44 - 2 * pml_x_size;      % [grid points]&#60;br /&#62;
Nx = 512+44 - 2 * pml_x_size;      % [grid points]&#60;br /&#62;
%Ny = 1024+44 - 2 * pml_y_size;      % [grid points]&#60;br /&#62;
Ny = 512+44 - 2 * pml_y_size;      % [grid points]&#60;/p&#62;
&#60;p&#62;Nz = 128 - 2 * pml_z_size;      % [grid points]&#60;/p&#62;
&#60;p&#62;% set desired grid size in the x-direction not including the PML&#60;br /&#62;
x = 50e-3;                      % [m]&#60;br /&#62;
% calculate the spacing between the grid points&#60;br /&#62;
dx = x / Nx;                    % [m]&#60;br /&#62;
dy = dx;%1.923076923076923e-04;                        % [m]&#60;br /&#62;
%dz = 2*dx;                        % [m]&#60;br /&#62;
dz = 2e-4;&#60;br /&#62;
% create the k-space grid&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy, Nz, dz);&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE THE MEDIUM PARAMETERS&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
c0 = 1500;         %for water             % [m/s]&#60;br /&#62;
rho0 = 1000;                    % [kg/m^3]&#60;br /&#62;
% medium.alpha_coeff = 0.75;      % [dB/(MHz^y cm)]  % need to change this paramenters to map also&#60;br /&#62;
medium.alpha_power = 1.01;&#60;br /&#62;
%medium.BonA = 20;&#60;br /&#62;
%BonA non linear&#60;br /&#62;
% create the time array&#60;br /&#62;
t_end = (Nx * dx) * 2.2 / c0;   % [s]&#60;br /&#62;
%t_end = (Nx * dx) * 2 / c0;   % [s]&#60;br /&#62;
kgrid.makeTime(c0, [], t_end);&#60;/p&#62;
&#60;p&#62;%%&#60;br /&#62;
% =========================================================================&#60;br /&#62;
% DEFINE THE INPUT SIGNAL&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% define properties of the input signal&#60;br /&#62;
source_strength = 10e5;          % [Pa]&#60;br /&#62;
tone_burst_freq = 2e6;        % [Hz]&#60;br /&#62;
tone_burst_cycles = 4;&#60;/p&#62;
&#60;p&#62;% create the input signal using toneBurst&#60;br /&#62;
input_signal = toneBurst(1/kgrid.dt, tone_burst_freq, tone_burst_cycles);&#60;/p&#62;
&#60;p&#62;input_signal = (source_strength ./ (c0 * rho0)) .* input_signal;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE THE ULTRASOUND TRANSDUCER&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% physical properties of the transducer&#60;br /&#62;
transducer.number_elements = 128;  	% total number of transducer elements&#60;br /&#62;
transducer.element_width = 3;       % width of each element [grid points]&#60;br /&#62;
transducer.element_length = 24;  	% length of each element [grid points]&#60;br /&#62;
transducer.element_spacing = 0;  	% spacing (kerf  width) between the elements [grid points]&#60;br /&#62;
transducer.radius = inf;            % radius of curvature of the transducer [m]&#60;/p&#62;
&#60;p&#62;% calculate the width of the transducer in grid points&#60;br /&#62;
transducer_width = transducer.number_elements * transducer.element_width ...&#60;br /&#62;
    + (transducer.number_elements - 1) * transducer.element_spacing;&#60;/p&#62;
&#60;p&#62;pitch = transducer.element_width*dx;&#60;/p&#62;
&#60;p&#62;%transducer.transmit_apodization = 'Hanning';    &#60;/p&#62;
&#60;p&#62;%%&#60;/p&#62;
&#60;p&#62;% use this to position the transducer in the middle of the computational grid&#60;br /&#62;
transducer.position = round([1, Ny/2 - transducer_width/2, Nz/2 - transducer.element_length/2]);&#60;/p&#62;
&#60;p&#62;% properties used to derive the beamforming delays&#60;br /&#62;
transducer.sound_speed = c0;                    % sound speed [m/s]&#60;br /&#62;
transducer.focus_distance = Inf;              % focus distance [m]&#60;br /&#62;
transducer.elevation_focus_distance = 25e-3;    % focus distance in the elevation plane [m]&#60;/p&#62;
&#60;p&#62;%transducer.steering_angle = 0;                  % steering angle [degrees]&#60;/p&#62;
&#60;p&#62;% apodization&#60;br /&#62;
transducer.transmit_apodization = 'Hanning';&#60;br /&#62;
transducer.receive_apodization = 'Rectangular';&#60;/p&#62;
&#60;p&#62;% define the transducer elements that are currently active&#60;/p&#62;
&#60;p&#62;transducer.active_elements = ones(transducer.number_elements, 1);&#60;/p&#62;
&#60;p&#62;% append input signal used to drive the transducer&#60;br /&#62;
transducer.input_signal = input_signal;&#60;br /&#62;
%&#60;br /&#62;
% % create the transducer using the defined settings&#60;br /&#62;
% transducer = kWaveTransducer(kgrid, transducer);&#60;br /&#62;
% print out transducer properties&#60;br /&#62;
transducer = kWaveTransducer(kgrid, transducer);&#60;br /&#62;
transducer.properties;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE THE MEDIUM PROPERTIES&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% define a large image size to move across&#60;/p&#62;
&#60;p&#62;Nx_tot = Nx;&#60;br /&#62;
Ny_tot = Ny;&#60;br /&#62;
Nz_tot = Nz;&#60;/p&#62;
&#60;p&#62;alpha_coeff = 0.5;&#60;br /&#62;
alpha_coeff2 = 1;&#60;/p&#62;
&#60;p&#62;scattering_map = randn([Nx_tot, Ny_tot, Nz_tot]);&#60;br /&#62;
% define a random distribution of scatterers for the medium&#60;br /&#62;
background_map_mean = 1;&#60;br /&#62;
background_map_std = 0;&#60;br /&#62;
background_map = background_map_mean + background_map_std * scattering_map;&#60;/p&#62;
&#60;p&#62;phanton_map_std = 0;&#60;/p&#62;
&#60;p&#62;% define properties&#60;br /&#62;
%background_speed =  c0 * ones(Nx_tot, Ny_tot, Nz_tot) .* background_map;&#60;br /&#62;
sound_speed_map = c0 .* background_map;&#60;br /&#62;
density_map = rho0 .* background_map;&#60;/p&#62;
&#60;p&#62;alpha_coeff_map = alpha_coeff.* background_map;&#60;/p&#62;
&#60;p&#62;radius = 4e-3;      % [m]&#60;br /&#62;
x_pos = 25e-3;    % [m]&#60;br /&#62;
y_pos = 25e-3;    % [m]&#60;br /&#62;
for zi = 1:Nz_tot&#60;br /&#62;
alpha_coeff_slice = alpha_coeff_map(:,:,zi);&#60;br /&#62;
scattering_regionb = zeros(Nx_tot, Ny_tot);&#60;/p&#62;
&#60;p&#62;scattering_regionb = makeDisc(Nx_tot, Ny_tot, round(x_pos/dx), round(y_pos/dy), round(radius/dx));&#60;br /&#62;
scattering_slice = scattering_map(:,:,zi);&#60;/p&#62;
&#60;p&#62;scattering_c02 = alpha_coeff2.*(1 + phanton_map_std * scattering_slice);&#60;/p&#62;
&#60;p&#62;alpha_coeff_slice(scattering_regionb == 1) = scattering_c02(scattering_regionb == 1);&#60;br /&#62;
alpha_coeff_map(:,:,zi) = alpha_coeff_slice;&#60;/p&#62;
&#60;p&#62;end&#60;/p&#62;
&#60;p&#62;alpha_coeff_slice_ori = alpha_coeff_slice;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% RUN THE SIMULATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% set the input settings&#60;br /&#62;
input_args = {...&#60;br /&#62;
    'PMLInside', false, 'PMLSize', [pml_x_size, pml_y_size, pml_z_size], ...&#60;br /&#62;
    'DataCast', DATA_CAST, 'DataRecast', true, 'PlotSim', false};&#60;/p&#62;
&#60;p&#62;i = 0;&#60;/p&#62;
&#60;p&#62;medium.sound_speed = c0;%sound_speed_map;%(:, medium_position:medium_position + Ny - 1, :);&#60;br /&#62;
medium.density = rho0;%density_map;%(:, medium_position:medium_position + Ny - 1, :);&#60;/p&#62;
&#60;p&#62;for degree= 0:0  % rotate&#60;/p&#62;
&#60;p&#62;    disp(['Computing scan angle ' num2str(degree)]);&#60;br /&#62;
    rot_alpha_coeff_slice = rotate_kgrid_dbz(alpha_coeff_slice_ori, degree, alpha_coeff);&#60;/p&#62;
&#60;p&#62;    for steer_ang = -1:1:1&#60;br /&#62;
        i = i+1;&#60;br /&#62;
    transducer.steering_angle = steer_ang;&#60;br /&#62;
    %transducer.input_signal = input_signal;&#60;br /&#62;
    % create the transducer using the defined settings&#60;/p&#62;
&#60;p&#62;    disp(['Computing steer angle ' num2str(steer_ang)]);&#60;/p&#62;
&#60;p&#62;for zi = 1:Nz_tot&#60;br /&#62;
alpha_coeff_map(:,:,zi) = rot_alpha_coeff_slice;&#60;/p&#62;
&#60;p&#62;end&#60;br /&#62;
    medium.alpha_coeff = alpha_coeff_map;%(:, medium_position:medium_position + Ny - 1, :);&#60;br /&#62;
    sensor_data = kspaceFirstOrder3DG(kgrid, medium, transducer, transducer, input_args{:});&#60;br /&#62;
    back_rf(:,:,i) = sensor_data;&#60;br /&#62;
    %ps_data(:,:,i) = bf_planewave(sensor_data,1/kgrid.dt);&#60;br /&#62;
    end&#60;/p&#62;
&#60;p&#62;end&#60;/p&#62;
&#60;p&#62;figure();imagesc(20*log10(abs(hilbert(back_rf(:,:,1)'))));title('raw rf data')
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
