<?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: ultrasound simulation</title>
		<link>http://www.k-wave.org/forum/topic/ultrasound-simulation-1</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 03:13:52 +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/ultrasound-simulation-1" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "ultrasound simulation"</title>
			<link>http://www.k-wave.org/forum/topic/ultrasound-simulation-1#post-5514</link>
			<pubDate>Thu, 26 May 2016 16:19:03 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5514@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Swetha,&#60;/p&#62;
&#60;p&#62;The second peak that you see in the time domain traces comes from the edge wave. If you turn plotting on (set &#60;code&#62;&#38;#39;PlotSim&#38;#39;, true&#60;/code&#62;), you will see the part of the wave that I mean.&#60;/p&#62;
&#60;p&#62;If you remove the first part of the signal, it will be easier to see the reflection. The reflection has a very low amplitude due to geometrical spreading (the point reflector is a long way from the source). For example, after changing Nx to 512, try &#60;code&#62;plot(sensor_data(1, 1000:end).&#38;#39;&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ssg47 on "ultrasound simulation"</title>
			<link>http://www.k-wave.org/forum/topic/ultrasound-simulation-1#post-5508</link>
			<pubDate>Wed, 18 May 2016 13:50:36 +0000</pubDate>
			<dc:creator>ssg47</dc:creator>
			<guid isPermaLink="false">5508@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I also changed Nx from 128 to 512 because I want to simulate deep tissue imaging. But I don't get any echoes from the scatterers. I tried increasing the strength of the input signal as well but it doesn't produce any change. Is there something else I need to consider. Thank you so much for helping!
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ssg47 on "ultrasound simulation"</title>
			<link>http://www.k-wave.org/forum/topic/ultrasound-simulation-1#post-5505</link>
			<pubDate>Mon, 16 May 2016 19:28:36 +0000</pubDate>
			<dc:creator>ssg47</dc:creator>
			<guid isPermaLink="false">5505@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Dr. Treeby,&#60;/p&#62;
&#60;p&#62;I made those changes and I think I see the delay at the end of the signal from sensor data. I was wondering what are the different impulse I see in the plotted signal(I don't know how to post an image here). I understand that the first part is the input signal to the source and the last part is the received echo. But there is a small signal between these two and I'm not sure I can explain it. It would be great if you could help me!&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;clear all;
pml_x_size = 20;
pml_y_size = 20;
% create the computational grid
Nx = 128 - 2*pml_x_size;           % number of grid points in the x (row) direction
Ny = 96 - 2*pml_y_size;           % number of grid points in the y (column) direction
dx = 0.2e-3;        % grid point spacing in the x direction [m]
dy = 0.2e-3;        % grid point spacing in the y direction [m]
kgrid = makeGrid(Nx, dx, Ny, dy);
gridx_pts =11;
c0 = 1540;                  % [m/s]
rho0 = 1000;                % [kg/m^3]
medium.alpha_coeff = 0.75; 	% [dB/(MHz^y cm)]
medium.alpha_power = 1.5;
medium.BonA = 6;
medium.sound_speed_ref = 1540;
% define the properties of the propagation medium
t_end = (Nx*dx)*2.2/c0;     % [s]
%kgrid.t_array = makeTime(kgrid, c0, [], t_end);
kgrid.t_array = 0e-9:15e-9:t_end;
source_strength = 5e6;    	% [Pa]
tone_burst_freq = 1.875e6; 	% [Hz]
tone_burst_cycles = 5;
% create the input signal using toneBurst
input_signal = toneBurst(1/kgrid.dt, tone_burst_freq, tone_burst_cycles);
%define the source
source.p_mask = zeros(Nx,Ny);
num_elements = 32;      % [grid points]
x_offset = 1;          % [grid points]
start_index = Ny/2 - round(num_elements/2) + 1;
source.p_mask(x_offset, start_index:start_index + num_elements - 1) = 1;
source.p = input_signal;
% define the sensor
sensor.mask = zeros(Nx,Ny);
x_offset = 1;          % [grid points]
start_index = Ny/2 - round(num_elements/2) + 1;
sensor.mask(x_offset, start_index) = 1;
sensor.mask(x_offset,start_index+13) = 1;
%define medium
Ny_tot = Ny+gridx_pts;
sound_speed_map = c0*ones(Nx, Ny_tot);
density_map = rho0*ones(Nx, Ny_tot);
cwire = 3000;
scattering_rho0 = cwire/1.5;%1150
% define the fishing wire point as a ball (high scattering intensity)
radius = 0.1e-3;      % [m]
scattering_region = makeCircle(Nx, Ny_tot, Nx-1,Ny_tot/2,radius,&#38;#39;true&#38;#39;);
% assign scatterer the properties
sound_speed_map(scattering_region == 1) = cwire;
density_map(scattering_region == 1) = scattering_rho0;

input_args = {&#38;#39;PMLInside&#38;#39;, false, &#38;#39;PMLSize&#38;#39;, [pml_x_size, pml_y_size],&#38;#39;PlotSim&#38;#39;,false,&#38;#39;PlotLayout&#38;#39;,true,&#38;#39;PlotScale&#38;#39;,&#38;#39;auto&#38;#39;};
psn = 1;
for i = 1:4
    medium.sound_speed = sound_speed_map(:,psn:psn+Ny-1);
    medium.density = density_map(:,psn:psn+Ny-1);
    sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor,input_args{:});
    sdata(i,:,:) = sensor_data;
    psn = psn +2;
end
% plot the simulated sensor data
figure;
hold on;
for i = 1:4
plot(reshape(sdata(i,1,:),[1,kgrid.Nt]));hold on
end
ylabel(&#38;#39;Sensor Position&#38;#39;);
xlabel(&#38;#39;Time Step&#38;#39;);&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Swetha
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "ultrasound simulation"</title>
			<link>http://www.k-wave.org/forum/topic/ultrasound-simulation-1#post-5504</link>
			<pubDate>Sun, 15 May 2016 16:03:12 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5504@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi ssg47,&#60;/p&#62;
&#60;p&#62;There are a few problems with your code:&#60;/p&#62;
&#60;p&#62;(1) You forgot to pass &#60;code&#62;input_args&#60;/code&#62; to &#60;code&#62;kspaceFirstOrder2D&#60;/code&#62;, which means the defaults are used instead. In particular, this means the PML is inside the grid, and so your source is within the PML.&#60;/p&#62;
&#60;p&#62;(2) You don't need to scale the source pressure by the impedance if you are using &#60;code&#62;source.p&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;(3) The time step is likely too big for a stable simulation (see command line warning). You can find a discussion of the stability criteria in the k-Wave manual.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ssg47 on "ultrasound simulation"</title>
			<link>http://www.k-wave.org/forum/topic/ultrasound-simulation-1#post-5500</link>
			<pubDate>Fri, 13 May 2016 17:11:08 +0000</pubDate>
			<dc:creator>ssg47</dc:creator>
			<guid isPermaLink="false">5500@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Dr. Cox and Dr. Treeby,&#60;/p&#62;
&#60;p&#62;My question is about sensor data that is received after moving the target. I read posts regarding delay but didn't get an answer. When I move medium I don't get any shift in the signal that I am supposed to see. Is there some internal mechanism that gets rid of the shift in the signals so that they start at time index 0 ? I urgently need help. I have tried everything after reading the posts and manual but haven't got lucky yet. I also tried the bmode linear transducer example but the received signal for each scan line is not shifted.&#60;br /&#62;
Here is my code:&#60;/p&#62;
&#60;p&#62;clear all;&#60;br /&#62;
pml_x_size = 20;&#60;br /&#62;
pml_y_size = 20;&#60;br /&#62;
% create the computational grid&#60;br /&#62;
Nx = 128 - 2*pml_x_size;           % number of grid points in the x (row) direction&#60;br /&#62;
Ny = 96 - 2*pml_y_size;           % number of grid points in the y (column) direction&#60;br /&#62;
dx = 0.2e-3;        % grid point spacing in the x direction [m]&#60;br /&#62;
dy = 0.2e-3;        % grid point spacing in the y direction [m]&#60;br /&#62;
kgrid = makeGrid(Nx, dx, Ny, dy);&#60;br /&#62;
gridx_pts =11;&#60;br /&#62;
c0 = 1540;                  % [m/s]&#60;br /&#62;
rho0 = 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;br /&#62;
medium.sound_speed_ref = 1540;&#60;br /&#62;
% define the properties of the propagation medium&#60;br /&#62;
t_end = (Nx*dx)*2.2/c0;     % [s]&#60;br /&#62;
kgrid.t_array = makeTime(kgrid, c0, [], t_end);&#60;br /&#62;
source_strength = 5e6;    	% [Pa]&#60;br /&#62;
tone_burst_freq = 1.875e6; 	% [Hz]&#60;br /&#62;
tone_burst_cycles = 5;&#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./(c0*rho0)).*input_signal;&#60;br /&#62;
%&#60;br /&#62;
%define the source&#60;br /&#62;
source.p_mask = zeros(Nx,Ny);&#60;br /&#62;
num_elements = 32;      % [grid points]&#60;br /&#62;
x_offset = 1;          % [grid points]&#60;br /&#62;
start_index = Ny/2 - round(num_elements/2) + 1;&#60;br /&#62;
source.p_mask(x_offset, start_index:start_index + num_elements - 1) = 1;&#60;br /&#62;
source.p = input_signal;&#60;br /&#62;
% define the sensor&#60;br /&#62;
sensor.mask = zeros(Nx,Ny);&#60;br /&#62;
x_offset = 1;          % [grid points]&#60;br /&#62;
start_index = Ny/2 - round(num_elements/2) + 1;&#60;br /&#62;
sensor.mask(x_offset, start_index) = 1;&#60;br /&#62;
sensor.mask(x_offset,start_index+13) = 1;&#60;br /&#62;
%define medium&#60;br /&#62;
Ny_tot = Ny+gridx_pts;&#60;br /&#62;
sound_speed_map = c0*ones(Nx, Ny_tot);&#60;br /&#62;
density_map = rho0*ones(Nx, Ny_tot);&#60;br /&#62;
cwire = 3000;&#60;br /&#62;
scattering_rho0 = cwire/1.5;%1150&#60;br /&#62;
% define the fishing wire point as a ball (high scattering intensity)&#60;br /&#62;
radius = 0.1e-3;      % [m]&#60;br /&#62;
scattering_region = makeCircle(Nx, Ny_tot, Nx-1,Ny_tot/2,radius,'true');&#60;br /&#62;
% assign scatterer the properties&#60;br /&#62;
sound_speed_map(scattering_region == 1) = cwire;&#60;br /&#62;
density_map(scattering_region == 1) = scattering_rho0;&#60;/p&#62;
&#60;p&#62;%%&#60;br /&#62;
input_args = {'PMLInside', false, 'PMLSize', [pml_x_size, pml_y_size],'PlotSim',true,'PlotLayout',true,'PlotScale','auto'};&#60;br /&#62;
for i = 1:4&#60;br /&#62;
    medium.sound_speed = sound_speed_map(:,i:i+Ny-1);&#60;br /&#62;
    medium.density = density_map(:,i:i+Ny-1);&#60;br /&#62;
    sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor);&#60;br /&#62;
    sdata(i,:,:) = sensor_data;&#60;br /&#62;
end&#60;br /&#62;
%% =========================================================================&#60;br /&#62;
% VISUALISATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% plot the simulated sensor data&#60;br /&#62;
figure;&#60;br /&#62;
hold on;&#60;br /&#62;
for i = 1:4&#60;br /&#62;
plot(reshape(sdata(i,2,:),[1,kgrid.Nt]))&#60;br /&#62;
end&#60;br /&#62;
colormap(getColorMap);&#60;br /&#62;
ylabel('Sensor Position');&#60;br /&#62;
xlabel('Time Step');&#60;br /&#62;
colorbar;
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
