<?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: Row of pins phantom</title>
		<link>http://www.k-wave.org/forum/topic/row-of-pins-phantom</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 01:11:16 +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/row-of-pins-phantom" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Row of pins phantom"</title>
			<link>http://www.k-wave.org/forum/topic/row-of-pins-phantom#post-3653</link>
			<pubDate>Sat, 18 May 2013 09:06:55 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">3653@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Avinoam,&#60;/p&#62;
&#60;p&#62;I suspect the problem is related to spectral blocking. In your simulation, the maximum frequency supported by the grid is 3.85 MHz and your source frequency is set to 1.2 MHz. However, because you are using a tone-burst, the actual frequency content of your input signal varies over some range. You can check this by looking at the frequency spectrum of your input signal, e.g., &#60;/p&#62;
&#60;p&#62;&#60;code&#62;spect(input_signal, 1/kgrid.dt, &#38;#39;Plot&#38;#39;, [true, false]);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;When you run a nonlinear simulation, higher frequency harmonics of your input signal will be generated due to the steepening waves, however, some of these frequencies are not supported by the grid, so are incorrectly aliased to lower frequencies (this behaviour is called spectral blocking). This is likely to be the cause of the high-frequency noise that you have observed.&#60;/p&#62;
&#60;p&#62;You could try using a lower source frequency, reducing the source amplitude, using a smaller grid spacing, etc.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>barz on "Row of pins phantom"</title>
			<link>http://www.k-wave.org/forum/topic/row-of-pins-phantom#post-3643</link>
			<pubDate>Thu, 16 May 2013 03:43:33 +0000</pubDate>
			<dc:creator>barz</dc:creator>
			<guid isPermaLink="false">3643@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;/p&#62;
&#60;p&#62;I've tried both your suggestions without success.&#60;br /&#62;
When the non linearity is switched off the high frequency noise decreases but did not disappear. In addition I am trying to simulate harmonic imaging and therefore this is not a true solution.&#60;/p&#62;
&#60;p&#62;I am attaching my code hoping it could help.&#60;br /&#62;
Thanks for your help!&#60;/p&#62;
&#60;p&#62;Avinoam&#60;/p&#62;
&#60;p&#62;clear all;&#60;/p&#62;
&#60;p&#62;% simulation settings&#60;br /&#62;
data_cast =  'gpuArray-single';&#60;br /&#62;
run_simulation = true;&#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 = 512 - 2*PML_X_SIZE;   % [grid points]&#60;br /&#62;
Ny = 128 - 2*PML_Y_SIZE;   % [grid points]&#60;br /&#62;
Nz = 64 - 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 = 94.4e-3;                  % [m]&#60;/p&#62;
&#60;p&#62;% calculate the spacing between the grid points&#60;br /&#62;
dx = x/Nx;                  % [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 = makeGrid(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 = 1540;                                      % [m/s]&#60;br /&#62;
rho0 = 1000;                                % [kg/m^3]&#60;br /&#62;
scattering_c0 = 1613;           % [m/s]&#60;br /&#62;
scattering_rho0 = 1120;      % [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;% =========================================================================&#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;br /&#62;
Nx_tot = Nx;&#60;br /&#62;
Ny_tot = Ny;&#60;br /&#62;
Nz_tot = Nz;&#60;/p&#62;
&#60;p&#62;% % create a binary sensor mask with seven detection positions&#60;br /&#62;
pointMask = zeros(Nx_tot, Ny_tot, Nz_tot);&#60;br /&#62;
pointMask(round([Nx/8, Nx/4, 3*Nx/8, Nx/2, 5*Nx/8, 6*Nx/8, 7*Nx/8]), Ny/2, Nz/2) = 1;&#60;/p&#62;
&#60;p&#62;% define background properties&#60;br /&#62;
sound_speed_map = c0*ones(Nx_tot, Ny_tot, Nz_tot);&#60;br /&#62;
density_map = rho0*ones(Nx_tot, Ny_tot, Nz_tot);&#60;/p&#62;
&#60;p&#62;% assign pins&#60;br /&#62;
sound_speed_map(pointMask == 1) = scattering_c0;&#60;br /&#62;
density_map(pointMask == 1) = scattering_rho0;&#60;/p&#62;
&#60;p&#62;% load the current section of the medium&#60;br /&#62;
medium.sound_speed = sound_speed_map;&#60;br /&#62;
medium.density = density_map;&#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 = 32;  	% total number of transducer elements&#60;br /&#62;
transducer.element_width = 2;       % 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;% 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 = 70e-3;          % focus distance [m]&#60;br /&#62;
transducer.elevation_focus_distance = 70e-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 = 'Hanning';&#60;br /&#62;
transducer.receive_apodization = 'Hanning';&#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;% =========================================================================&#60;br /&#62;
% DEFINE THE INPUT SIGNAL&#60;br /&#62;
% =========================================================================&#60;br /&#62;
 % create the time array&#60;br /&#62;
t_end = (Nx*dx)*2.2/c0;     % [s]&#60;br /&#62;
cfl = 0.2;&#60;br /&#62;
kgrid.t_array = makeTime(kgrid,  medium.sound_speed, cfl, t_end);&#60;/p&#62;
&#60;p&#62;% define properties of the input signal&#60;br /&#62;
source_strength = 1.5e6;    	% [Pa]&#60;br /&#62;
tone_burst_freq = 1.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;% 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;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% RUN THE SIMULATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% preallocate the storage&#60;br /&#62;
scan_lines = zeros(1, kgrid.Nt);&#60;/p&#62;
&#60;p&#62;% set the input settings&#60;br /&#62;
input_args = {...&#60;br /&#62;
    'PMLInside', false, 'PlotSim', false, 'PMLSize', [PML_X_SIZE, PML_Y_SIZE, PML_Z_SIZE], ...&#60;br /&#62;
    'DataCast', data_cast,'Smooth',[true,true,true]};&#60;/p&#62;
&#60;p&#62;% run the simulation if set to true, otherwise, load previous results from&#60;br /&#62;
% disk&#60;br /&#62;
if run_simulation&#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 = makeTransducer(kgrid, transducer);&#60;/p&#62;
&#60;p&#62;    % print out transducer properties&#60;br /&#62;
    transducer.properties;&#60;/p&#62;
&#60;p&#62;    if strcmp(data_cast, 'gpuArray-single')&#60;br /&#62;
        % run the simulation&#60;br /&#62;
        sensor_data = kspaceFirstOrder3D(kgrid, medium, transducer, transducer, input_args{:});&#60;br /&#62;
        % extract the scan line from the sensor data&#60;br /&#62;
        scan_lines(1, :) = gather(transducer.scan_line(sensor_data));&#60;br /&#62;
    else&#60;br /&#62;
        % run the simulation&#60;br /&#62;
        sensor_data = kspaceFirstOrder3DC(kgrid, medium, transducer, transducer, input_args{:});&#60;br /&#62;
        % extract the scan line from the sensor data&#60;br /&#62;
        scan_lines(1, :) = transducer.scan_line(sensor_data);&#60;br /&#62;
    end&#60;/p&#62;
&#60;p&#62;    % save the scan lines to disk&#60;br /&#62;
    save example_us_bmode_scan_lines_pins scan_lines;&#60;br /&#62;
else&#60;br /&#62;
    % load the scan lines from disk&#60;br /&#62;
    load example_us_bmode_scan_lines_pins&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% PROCESS THE RESULTS&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% -----------------------------&#60;br /&#62;
% Remove Input Signal&#60;br /&#62;
% -----------------------------&#60;/p&#62;
&#60;p&#62;% create a window to set the first part of each scan line to zero to remove&#60;br /&#62;
% interference from the input signal&#60;br /&#62;
scan_line_win = getWin(kgrid.Nt*2, 'Tukey', 'Param', 0.05).';&#60;br /&#62;
scan_line_win = [zeros(1, length(input_signal)*2), scan_line_win(1:end/2 - length(input_signal)*2)];&#60;/p&#62;
&#60;p&#62;% apply the window to each of the scan lines&#60;br /&#62;
scan_lines = bsxfun(@times, scan_line_win, scan_lines);&#60;/p&#62;
&#60;p&#62;% store a copy of the middle scan line to illustrate the effects of each&#60;br /&#62;
% processing step&#60;br /&#62;
scan_line_example(1, :) = scan_lines;&#60;br /&#62;
% -----------------------------&#60;br /&#62;
% Time Gain Compensation&#60;br /&#62;
% -----------------------------&#60;/p&#62;
&#60;p&#62;% create radius variable assuming that t0 corresponds to the middle of the&#60;br /&#62;
% input signal&#60;br /&#62;
t0 = length(input_signal)*kgrid.dt/2;&#60;br /&#62;
r = c0*( (1:length(kgrid.t_array))*kgrid.dt/2 - t0);    % [m]&#60;/p&#62;
&#60;p&#62;% create time gain compensation function based on attenuation value,&#60;br /&#62;
% transmit frequency, and round trip distance&#60;br /&#62;
tgc_alpha = 0.3;       % [dB/(MHz cm)]&#60;br /&#62;
tgc = exp(2*tgc_alpha*tone_burst_freq/1e6*r*100);&#60;/p&#62;
&#60;p&#62;% apply the time gain compensation to each of the scan lines&#60;br /&#62;
scan_lines = bsxfun(@times, tgc, scan_lines);&#60;/p&#62;
&#60;p&#62;% store a copy of the middle scan line to illustrate the effects of each&#60;br /&#62;
% processing step&#60;br /&#62;
% scan_line_example(2, :) = scan_lines(end/2, :);&#60;br /&#62;
scan_line_example(2, :) = scan_lines(1, :);&#60;/p&#62;
&#60;p&#62;% -----------------------------&#60;br /&#62;
% Frequency Filtering&#60;br /&#62;
% -----------------------------&#60;/p&#62;
&#60;p&#62;% filter the scan lines using both the transmit frequency and the second&#60;br /&#62;
% harmonic&#60;br /&#62;
scan_lines_fund = gaussianFilter(scan_lines, 1/kgrid.dt, tone_burst_freq, 100, true);&#60;br /&#62;
scan_lines_harm = gaussianFilter(scan_lines, 1/kgrid.dt, 2*tone_burst_freq, 30, true);
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Row of pins phantom"</title>
			<link>http://www.k-wave.org/forum/topic/row-of-pins-phantom#post-3640</link>
			<pubDate>Wed, 15 May 2013 14:39:38 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">3640@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Avinoam,&#60;/p&#62;
&#60;p&#62;There are a couple of things to try. First, if you are using a strong sound-speed contrast, make sure that your time step is set appropriately. In the example you mention, you will need to move the line &#60;code&#62;kgrid.t_array = makeTime(kgrid, c0, [], t_end)&#60;/code&#62; to after you have created your medium maps, and replace &#60;code&#62;c0&#60;/code&#62; with &#60;code&#62;medium.sound_speed&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;Second, you could try switching off the nonlinearity (by removing the line &#60;code&#62;medium.BonA = 6;&#60;/code&#62;) to see if the high-frequency noise is related to spectral blocking (where the nonlinearity generates high-frequency harmonics not supported by the spatial grid).&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>barz on "Row of pins phantom"</title>
			<link>http://www.k-wave.org/forum/topic/row-of-pins-phantom#post-3636</link>
			<pubDate>Wed, 15 May 2013 00:53:38 +0000</pubDate>
			<dc:creator>barz</dc:creator>
			<guid isPermaLink="false">3636@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;/p&#62;
&#60;p&#62;I am trying to modify the example &#34;Simulating B-mode Ultrasound Images&#34;  to simulate a B-mode image of row of highly echogenic pins inside a tissue. The simulation results I got so far include a high frequency noise with a peak just below the maximal supported frequency. I have tried to use the smoothing option for both the pulse and the speed and density maps. This noise is not apparent when the speed and density maps of the original phantoms are used.&#60;/p&#62;
&#60;p&#62;Do you have any Idea about the source of this artifact and how I can remove it?&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Avinoam
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
