<?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: 1D Linear Probe Beam Simulation – Ultrasound Pulse Gradually Disappearing</title>
		<link>http://www.k-wave.org/forum/topic/1d-linear-probe-beam-simulation-%e2%80%93-ultrasound-pulse-gradually-disappearing</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 01:11:34 +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/1d-linear-probe-beam-simulation-%e2%80%93-ultrasound-pulse-gradually-disappearing" rel="self" type="application/rss+xml" />

		<item>
			<title>Gwansuk on "1D Linear Probe Beam Simulation – Ultrasound Pulse Gradually Disappearing"</title>
			<link>http://www.k-wave.org/forum/topic/1d-linear-probe-beam-simulation-%e2%80%93-ultrasound-pulse-gradually-disappearing#post-9190</link>
			<pubDate>Wed, 26 Feb 2025 08:23:51 +0000</pubDate>
			<dc:creator>Gwansuk</dc:creator>
			<guid isPermaLink="false">9190@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I am currently simulating the acoustic field of a 1D linear probe using k-Wave.&#60;br /&#62;
I have modified the code based on example_us_beam_patterns.m, and my key simulation settings are as follows:&#60;/p&#62;
&#60;p&#62;Frequency: 5 MHz&#60;br /&#62;
Grid spacing (dx): 0.025e-3 m&#60;br /&#62;
I confirmed that the initial ultrasound pulse propagates correctly. However, the pressure at the focal region is extremely low in the simulation results, making the beam pattern nearly invisible.&#60;br /&#62;
It appears as if the ultrasound wave propagates and then disappears.&#60;/p&#62;
&#60;p&#62;Does anyone have any insights or suggestions on why this might be happening?&#60;br /&#62;
I would appreciate any insights or suggestions on how to resolve this issue.&#60;/p&#62;
&#60;p&#62;Thank you!&#60;/p&#62;
&#60;p&#62;Gwansuk&#60;/p&#62;
&#60;p&#62;Below is the complete code:&#60;/p&#62;
&#60;p&#62;clearvars;&#60;/p&#62;
&#60;p&#62;% simulation settings&#60;br /&#62;
DATA_CAST = 'gpuArray-single';       % set to 'single' or 'gpuArray-single' to speed up computations&#60;br /&#62;
MASK_PLANE = 'xy';          % set to 'xy' or 'xz' to generate the beam pattern in different planes&#60;br /&#62;
USE_STATISTICS = true;      % set to true to compute the rms or peak beam patterns, set to false to compute the harmonic beam patterns&#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 = 10;            % [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 = 84 - 2 * PML_X_SIZE;    % [grid points]&#60;br /&#62;
Ny = 64 - 2 * PML_Y_SIZE;     % [grid points]&#60;br /&#62;
Nz = 64 - 2 * PML_Z_SIZE;     % [grid points]&#60;/p&#62;
&#60;p&#62;Nx = Nx * 74; %Nx = Nx * 74;&#60;br /&#62;
Ny = Ny * 24;&#60;br /&#62;
Nz = Nz * 1;&#60;/p&#62;
&#60;p&#62;% calculate the spacing between the grid points&#60;br /&#62;
dx = 0.025e-3;                  % [m]&#60;br /&#62;
dy = dx;                    % [m]&#60;br /&#62;
dz = dx;                    % [m]&#60;/p&#62;
&#60;p&#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;
medium.sound_speed = 1540;      % [m/s]&#60;br /&#62;
medium.density = 1000;          % [kg/m^3]&#60;br /&#62;
medium.alpha_coeff = 0.75;      % [dB/(MHz^y cm)]&#60;br /&#62;
medium.alpha_power = 1.5;&#60;br /&#62;
medium.BonA = 6;&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
fs = 300e6;             % Sampling rate (Hz)&#60;br /&#62;
dt = 1/fs;             % Time step (s)&#60;br /&#62;
t_end = 80e-6;         % Total simulation time (s)&#60;br /&#62;
Nt = round(t_end / dt); % Number of time steps&#60;/p&#62;
&#60;p&#62;% Set time axis&#60;br /&#62;
kgrid.t_array = 0:dt:(Nt-1)*dt;&#60;/p&#62;
&#60;p&#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 = 1e6;          % [Pa]&#60;br /&#62;
tone_burst_freq = 5.0e6;    	% [Hz]&#60;br /&#62;
tone_burst_cycles = 3;&#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;% scale the source magnitude by the source_strength divided by the&#60;br /&#62;
% impedance (the source is assigned to the particle velocity)&#60;br /&#62;
input_signal = (source_strength ./ (medium.sound_speed * medium.density)) .* 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 = 96;    % total number of transducer elements&#60;br /&#62;
transducer.element_width = 10;       % width of each element [grid points]&#60;br /&#62;
transducer.element_length = 20;     % 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;% 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 = 1540;                  % sound speed [m/s]&#60;br /&#62;
transducer.focus_distance = 55e-3; %55e-3;              % focus distance [m]&#60;br /&#62;
transducer.elevation_focus_distance = 19e-3;    % focus distance in the elevation plane [m]&#60;br /&#62;
transducer.elevation_focus_distance = 25e-3;    % focus distance in the elevation plane [m]&#60;br /&#62;
transducer.steering_angle = 0;                  % steering angle [degrees]&#60;/p&#62;
&#60;p&#62;% apodization&#60;br /&#62;
transducer.transmit_apodization = 'Rectangular';&#60;br /&#62;
transducer.receive_apodization = 'Rectangular';&#60;/p&#62;
&#60;p&#62;% define the transducer elements that are currently active&#60;br /&#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;/p&#62;
&#60;p&#62;% create the transducer using the defined settings&#60;br /&#62;
transducer = kWaveTransducer(kgrid, transducer);&#60;/p&#62;
&#60;p&#62;% print out transducer properties&#60;br /&#62;
transducer.properties;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% DEFINE SENSOR MASK&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% define a sensor mask through the central plane&#60;br /&#62;
sensor.mask = zeros(Nx, Ny, Nz);&#60;br /&#62;
switch MASK_PLANE&#60;br /&#62;
    case 'xy'&#60;/p&#62;
&#60;p&#62;        % define mask&#60;br /&#62;
        sensor.mask(:, :, Nz/2) = 1;&#60;/p&#62;
&#60;p&#62;        % store y axis properties&#60;br /&#62;
        Nj = Ny;&#60;br /&#62;
        j_vec = kgrid.y_vec;&#60;br /&#62;
        j_label = 'y';&#60;/p&#62;
&#60;p&#62;    case 'xz'&#60;/p&#62;
&#60;p&#62;        % define mask&#60;br /&#62;
        sensor.mask(:, Ny/2, :) = 1;&#60;/p&#62;
&#60;p&#62;        % store z axis properties&#60;br /&#62;
        Nj = Nz;&#60;br /&#62;
        j_vec = kgrid.z_vec;&#60;br /&#62;
        j_label = 'z';&#60;/p&#62;
&#60;p&#62;end &#60;/p&#62;
&#60;p&#62;% set the record mode such that only the rms and peak values are stored&#60;br /&#62;
if USE_STATISTICS&#60;br /&#62;
    sensor.record = {'p_rms', 'p_max'};&#60;br /&#62;
end&#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 = {'DisplayMask', transducer.all_elements_mask, ...&#60;br /&#62;
    'PMLInside', false, 'PlotPML', false, 'PMLSize', [PML_X_SIZE, PML_Y_SIZE, PML_Z_SIZE], ...&#60;br /&#62;
    'DataCast', DATA_CAST, 'DataRecast', true, 'PlotScale', [-1/2, 1/2] * source_strength};&#60;/p&#62;
&#60;p&#62;% stream the data to disk in blocks of 100 if storing the complete time&#60;br /&#62;
% history&#60;br /&#62;
if ~USE_STATISTICS&#60;br /&#62;
    input_args = [input_args {'StreamToDisk', 100}];&#60;br /&#62;
end&#60;br /&#62;
tic&#60;br /&#62;
% run the simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder3D(kgrid, medium, transducer, sensor, input_args{:});&#60;br /&#62;
toc&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% COMPUTE THE BEAM PATTERN USING SIMULATION STATISTICS&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;if USE_STATISTICS&#60;/p&#62;
&#60;p&#62;    % reshape the returned rms and max fields to their original position&#60;br /&#62;
    sensor_data.p_rms = reshape(sensor_data.p_rms, [Nx, Nj]);&#60;br /&#62;
    sensor_data.p_max = reshape(sensor_data.p_max, [Nx, Nj]);&#60;/p&#62;
&#60;p&#62;    % plot the beam pattern using the pressure maximum&#60;br /&#62;
    figure;&#60;br /&#62;
    imagesc(j_vec * 1e3, (kgrid.x_vec - min(kgrid.x_vec(:))) * 1e3, sensor_data.p_max * 1e-6);&#60;br /&#62;
    xlabel([j_label '-position [mm]']);&#60;br /&#62;
    ylabel('x-position [mm]');&#60;br /&#62;
    title('Total Beam Pattern Using Maximum Of Recorded Pressure');&#60;br /&#62;
    colormap(jet(256));&#60;br /&#62;
    c = colorbar;&#60;br /&#62;
    ylabel(c, 'Pressure [MPa]');&#60;br /&#62;
    axis image;&#60;/p&#62;
&#60;p&#62;    % plot the beam pattern using the pressure rms&#60;br /&#62;
    figure;&#60;br /&#62;
    imagesc(j_vec * 1e3, (kgrid.x_vec - min(kgrid.x_vec(:))) * 1e3, sensor_data.p_rms * 1e-6);&#60;br /&#62;
    xlabel([j_label '-position [mm]']);&#60;br /&#62;
    ylabel('x-position [mm]');&#60;br /&#62;
    title('Total Beam Pattern Using RMS Of Recorded Pressure');&#60;br /&#62;
    colormap(jet(256));&#60;br /&#62;
    c = colorbar;&#60;br /&#62;
    ylabel(c, 'Pressure [MPa]');&#60;br /&#62;
    axis image;&#60;/p&#62;
&#60;p&#62;    % end the example&#60;br /&#62;
    return&#60;/p&#62;
&#60;p&#62;end
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
