<?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: Simulate echoes of balls or side-drilled holes (SDHs)</title>
		<link>http://www.k-wave.org/forum/topic/simulate-echoes-of-balls-or-side-drilled-holes-sdhs</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:40:24 +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/simulate-echoes-of-balls-or-side-drilled-holes-sdhs" rel="self" type="application/rss+xml" />

		<item>
			<title>liuying123 on "Simulate echoes of balls or side-drilled holes (SDHs)"</title>
			<link>http://www.k-wave.org/forum/topic/simulate-echoes-of-balls-or-side-drilled-holes-sdhs#post-9198</link>
			<pubDate>Sun, 16 Mar 2025 06:00:17 +0000</pubDate>
			<dc:creator>liuying123</dc:creator>
			<guid isPermaLink="false">9198@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello, your reply is very important to me. I would like to ask how you set up the materials for synthetic aperture imaging after scanning for internal defects in steel. Specifically, I have set up three layers: water, acrylic, and aluminum, with the phased array placed in the water layer for transmission and reception. Why are the echo signals very weak or even nonexistent? I have set the frequency to 7.5 MHz with a 36-element transducer array, scanning sequentially, but the A-scan data of the echoes does not seem correct. I would greatly appreciate your response. Below is my code. % 引导线性阵列示例&#60;br /&#62;
clearvars;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% 模拟&#60;br /&#62;
% ========================================================================&#60;br /&#62;
% 创建计算网格&#60;br /&#62;
Nx = 400;               % x 方向的网格点数&#60;br /&#62;
Ny = Nx;                % y 方向的网格点数&#60;br /&#62;
dx = 0.1e-3;           % x 方向的网格点间距 [m]&#60;br /&#62;
dy = dx;               % y 方向的网格点间距 [m]&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;% 定义介质属性&#60;br /&#62;
sound_speed_water = 1500;  % 水声速 [m/s]&#60;br /&#62;
density_water = 1000;       % 水密度 [kg/m^3]&#60;br /&#62;
sound_speed_acrylic = 2700; % 亚克力声速 [m/s]&#60;br /&#62;
density_acrylic = 1190;      % 亚克力密度 [kg/m^3]&#60;br /&#62;
sound_speed_aluminum = 6300; % 铝声速 [m/s]&#60;br /&#62;
density_aluminum = 2690;      % 铝密度 [kg/m^3]&#60;/p&#62;
&#60;p&#62;% 创建时间数组&#60;br /&#62;
t_end = 45.5e-6; % [s]&#60;br /&#62;
kgrid.makeTime(sound_speed_acrylic, [], t_end); % acrylic&#60;/p&#62;
&#60;p&#62;% 定义线性换能器的参数&#60;br /&#62;
num_elements = 36;      % [阵元数量]&#60;br /&#62;
x_offset = 20;          % [网格点]&#60;br /&#62;
element_width = 1;      % 定义阵元宽度为1个网格点&#60;br /&#62;
source_focus = 0.13;    % 聚焦深度 [m]&#60;br /&#62;
element_pitch = 0.3e-3;  % 每个阵元的间距 [m]&#60;br /&#62;
source.p_mask = zeros(Nx, Ny);&#60;/p&#62;
&#60;p&#62;% 计算发射阵元的起始位置&#60;br /&#62;
transducer_width = num_elements * (element_width + 2); % 发射阵元总宽度，包含间隔&#60;br /&#62;
start_index = round(Ny/2 - transducer_width/2); % y方向的起始位置&#60;/p&#62;
&#60;p&#62;% 计算每个阵元的时间延迟&#60;br /&#62;
ids = (0:num_elements - 1); % 阵元索引&#60;br /&#62;
time_delays = -(sqrt((ids .* element_pitch).^2 + source_focus.^2) - source_focus) ./ sound_speed_water;&#60;br /&#62;
time_delays = time_delays - min(time_delays); % 归一化时间延迟&#60;/p&#62;
&#60;p&#62;% 定义用于驱动换能器的音调脉冲属性&#60;br /&#62;
sampling_freq = 75e6;     % [Hz]&#60;br /&#62;
tone_burst_freq = 7.5e6;  % [Hz]&#60;br /&#62;
tone_burst_cycles = 1;&#60;/p&#62;
&#60;p&#62;% 定义回波数据存储三维矩阵&#60;br /&#62;
num_scans = 128 - 36 + 1;              % 扫描次数&#60;br /&#62;
num_time_points = length(kgrid.t_array); % 修正时间点数为 kgrid.t_array 的长度&#60;br /&#62;
echo_data = zeros(num_scans, num_elements, num_time_points); % 初始化三维矩阵&#60;/p&#62;
&#60;p&#62;% 创建音调脉冲信号，为每个阵元生成时间序列&#60;br /&#62;
source.p = zeros(num_elements, length(kgrid.t_array)); % 初始化源信号矩阵&#60;br /&#62;
for i = 1:num_elements&#60;br /&#62;
    pulse = toneBurst(sampling_freq, tone_burst_freq, tone_burst_cycles, ...&#60;br /&#62;
        'SignalOffset', time_delays(i));&#60;br /&#62;
    source.p(i, 1:length(pulse)) = 20 * pulse; %加了20倍更明显&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% 分配输入选项&#60;br /&#62;
input_args = {'DisplayMask', source.p_mask};&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% 定义传感器&#60;br /&#62;
% =========================================================================&#60;br /&#62;
sensor.mask = zeros(Nx, Ny); % 初始化传感器蒙版&#60;br /&#62;
sensor.record = {'p'}; % 记录声压&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% 定义三层介质，包含孔缺陷&#60;br /&#62;
% =========================================================================&#60;br /&#62;
% 创建声速和密度的映射&#60;br /&#62;
sound_speed_map = zeros(Nx, Ny); % 初始化为零矩阵&#60;br /&#62;
density_map = zeros(Nx, Ny);      % 初始化为零矩阵&#60;/p&#62;
&#60;p&#62;% 设置水层的位置（上层）&#60;br /&#62;
water_height = round(10e-3 / dy); % 水层高度 10 mm&#60;br /&#62;
for i = 1:water_height&#60;br /&#62;
    sound_speed_map(i, :) = sound_speed_water;  % 水声速&#60;br /&#62;
    density_map(i, :) = density_water;          % 水密度&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% 设置亚克力层的位置（中层）&#60;br /&#62;
acrylic_height = round(10e-3 / dy); % 亚克力层高度 10 mm&#60;br /&#62;
for i = water_height + 1:water_height + acrylic_height&#60;br /&#62;
    sound_speed_map(i, :) = sound_speed_acrylic;  % 亚克力声速&#60;br /&#62;
    density_map(i, :) = density_acrylic;          % 亚克力密度&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% 设置铝层的位置（下层）&#60;br /&#62;
aluminum_height = round(20e-3 / dy); % 铝层高度 20 mm&#60;br /&#62;
for i = water_height + acrylic_height + 1:water_height + acrylic_height + aluminum_height&#60;br /&#62;
    sound_speed_map(i, :) = sound_speed_aluminum;  % 铝层声速&#60;br /&#62;
    density_map(i, :) = density_aluminum;          % 铝层密度&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% 定义缺陷位置（孔）&#60;br /&#62;
radius = 1e-3; % 孔的半径&#60;br /&#62;
x_center = 300; % 网格中心&#60;br /&#62;
y_center = 200; % 孔在亚克力层中间&#60;br /&#62;
defect_region = makeDisc(Nx, Ny, x_center, y_center, round(radius/dx), 2 * pi);&#60;br /&#62;
sound_speed_map(defect_region == 1) = sound_speed_water;  % 孔区域设置为水的声速&#60;br /&#62;
density_map(defect_region == 1) = density_water;          % 孔区域设置为水的密度&#60;/p&#62;
&#60;p&#62;% 更新介质属性&#60;br /&#62;
medium.sound_speed = sound_speed_map;  % 使用有效字段&#60;br /&#62;
medium.density = density_map;          % 使用有效字段&#60;/p&#62;
&#60;p&#62;% 从第128个网格点开始进行扫描&#60;br /&#62;
start_scan_index = 28; % 设置起始扫描位置&#60;br /&#62;
for scan_index = 0:2:(2 * (num_scans - 1)) % 每次跨越两个网格&#60;br /&#62;
    % 当前发射阵元的起始位置&#60;br /&#62;
    current_position = start_scan_index + scan_index; % 网格位置从 128 开始&#60;/p&#62;
&#60;p&#62;    % 更新发射阵元的掩码&#60;br /&#62;
    source.p_mask(:) = 0; % 清除之前的掩码&#60;br /&#62;
    start_index = current_position + round(num_elements/2) * (element_width + 2); % 计算当前起始索引&#60;br /&#62;
    for i = 0:num_elements - 1&#60;br /&#62;
        % 仅在阵元位置设置掩码&#60;br /&#62;
        source.p_mask(x_offset, start_index + i * (element_width + 2)) = 1;&#60;br /&#62;
    end&#60;/p&#62;
&#60;p&#62;    % 运行模拟&#60;br /&#62;
    sensor.mask = zeros(Nx, Ny); % 初始化传感器蒙版&#60;br /&#62;
    sensor.mask(x_offset, start_index:start_index + (num_elements - 1) * (element_width + 2)) = 0; % 清空传感器蒙版&#60;br /&#62;
    for i = 0:num_elements - 1&#60;br /&#62;
        % 仅在阵元位置设置传感器蒙版&#60;br /&#62;
        sensor.mask(x_offset, start_index + i * (element_width + 2)) = 1; %原来是x_offset，改成的100&#60;br /&#62;
    end&#60;br /&#62;
    sensor.record = {'p'}; % 记录声压&#60;/p&#62;
&#60;p&#62;    % 运行模拟&#60;br /&#62;
    sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;    % 存储回波数据，确保维度匹配&#60;br /&#62;
    echo_data(scan_index / 2 + 1, :, :) = sensor_data.p; % 存储回波数据&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% 可视化&#60;br /&#62;
% =========================================================================&#60;br /&#62;
figure;&#60;br /&#62;
plot(sensor_data.p(21,:));&#60;br /&#62;
xlabel('时间点');&#60;br /&#62;
ylabel('声压 [Pa]');&#60;br /&#62;
title('最后一次扫描的声压信号');&#60;/p&#62;
&#60;p&#62;% 绘制特定扫描的接收到的信号（例如第5次扫描）&#60;br /&#62;
figure;&#60;br /&#62;
plot(squeeze(echo_data(5, :, :))); % 选择特定扫描和阵元的信号&#60;br /&#62;
xlabel('时间点');&#60;br /&#62;
ylabel('声压 [Pa]');&#60;br /&#62;
title('特定扫描的接收到的信号');&#60;/p&#62;
&#60;p&#62;% 绘制所有回波数据的示例&#60;br /&#62;
figure;&#60;br /&#62;
stackedPlot(kgrid.t_array, squeeze(echo_data(5, :, :)));&#60;br /&#62;
xlabel('时间 [s]');&#60;br /&#62;
ylabel('回波信号');&#60;br /&#62;
title('所有数据的示例');
&#60;/p&#62;</description>
		</item>
		<item>
			<title>biaojiang on "Simulate echoes of balls or side-drilled holes (SDHs)"</title>
			<link>http://www.k-wave.org/forum/topic/simulate-echoes-of-balls-or-side-drilled-holes-sdhs#post-4887</link>
			<pubDate>Wed, 10 Dec 2014 16:38:47 +0000</pubDate>
			<dc:creator>biaojiang</dc:creator>
			<guid isPermaLink="false">4887@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi, Bradley,&#60;/p&#62;
&#60;p&#62;   Thanks, I increased the grid points per wavelength when existing larger impedance mismatch, but the computation time increased much, especially for higher frequency, For 5MHz, 8-transducer array, and each transducer acted as a transmitter sequentially, it ran for one whole day to get the 3-D A-scan data, and the synthetic aperture imaging results were nice, we can detect the defects inside a thin steel layered material.  &#60;/p&#62;
&#60;p&#62;Best Regards&#60;br /&#62;
Biao
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Simulate echoes of balls or side-drilled holes (SDHs)"</title>
			<link>http://www.k-wave.org/forum/topic/simulate-echoes-of-balls-or-side-drilled-holes-sdhs#post-4874</link>
			<pubDate>Fri, 05 Dec 2014 18:15:44 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">4874@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Biao,&#60;/p&#62;
&#60;p&#62;If the physical situation has a large impedance mismatch, then there's not a lot you can do unfortunately! If you gate out the reflection from the front surface, or subtract the recorded signal when there is no flaw, can you see flaw echo then?&#60;/p&#62;
&#60;p&#62;If you want to model the contribution of shear waves in the solid layer, then it's probably best to use &#60;code&#62;pstdElastic3D&#60;/code&#62;. You could always compare the output between this and &#60;code&#62;kspaceFirstOrder3D&#60;/code&#62; to see if this is important for your particular configuration. &#60;/p&#62;
&#60;p&#62;To get accurate reflection coefficients for very large impedance changes, you will need to use a sufficient number of points per wavelength (see &#60;a href=&#34;http://www.k-wave.org/papers/2014-Robertson-IEEEIUS.pdf&#34;&#62;here&#60;/a&#62;).&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>biaojiang on "Simulate echoes of balls or side-drilled holes (SDHs)"</title>
			<link>http://www.k-wave.org/forum/topic/simulate-echoes-of-balls-or-side-drilled-holes-sdhs#post-4859</link>
			<pubDate>Wed, 26 Nov 2014 15:01:00 +0000</pubDate>
			<dc:creator>biaojiang</dc:creator>
			<guid isPermaLink="false">4859@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi, Bradley,&#60;/p&#62;
&#60;p&#62;    Yes, there is a steel layer immersed in water, and also the transducer array is in the water, the objective is to inspect the flaws inside the steel material layer.Since there is a big difference between the acoustic the impedence of the steel and the water, most of the energy, say more than 90% are reflected by the upper boundary of the steel layer. As a result, if there are air voids or other cracks in the layer, we can't find the flaw echo.&#60;/p&#62;
&#60;p&#62;    So, since there are solid layer in liquid, whether we must use function pstdElastic3D instead of kspaceFirstOrder3D?&#60;br /&#62;
    Can pstdElastic3D work well when exists large medium inhomogeneity? If not,the only thing we can do is to scale the material parameters.&#60;/p&#62;
&#60;p&#62;    Thanks!&#60;/p&#62;
&#60;p&#62;Best Regards&#60;br /&#62;
Biao
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Simulate echoes of balls or side-drilled holes (SDHs)"</title>
			<link>http://www.k-wave.org/forum/topic/simulate-echoes-of-balls-or-side-drilled-holes-sdhs#post-4856</link>
			<pubDate>Tue, 25 Nov 2014 18:29:24 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">4856@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Biao,&#60;/p&#62;
&#60;p&#62;I'm not sure I completely follow your setup. What is the upper boundary that you get a strong reflection from? Is it the steel layer? Is this also in water?&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>biaojiang on "Simulate echoes of balls or side-drilled holes (SDHs)"</title>
			<link>http://www.k-wave.org/forum/topic/simulate-echoes-of-balls-or-side-drilled-holes-sdhs#post-4848</link>
			<pubDate>Fri, 21 Nov 2014 15:19:41 +0000</pubDate>
			<dc:creator>biaojiang</dc:creator>
			<guid isPermaLink="false">4848@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi, Bradley.&#60;/p&#62;
&#60;p&#62;   I tried to simulate the echoes of an air or water filled ball or SDH in a steel layer. The problem is the echo reflected from the upper boundary is so strong that the ball echo was masked. However, when there is a steel ball in water, it is easy to find the echo and get a good beamformed image.&#60;br /&#62;
   The frequency is 5MHz, and the grid points per wavelength is 4 at 5MHz.&#60;br /&#62;
   What is the problem? Thanks!&#60;/p&#62;
&#60;p&#62;Best Regards&#60;br /&#62;
Biao
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
