<?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; User Favorites: Farnazkhj</title>
		<link><a href='http://www.k-wave.org/forum/profile/farnazkhj'>farnazkhj</a></link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:11:39 +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/profile/" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Plane wave artifact"</title>
			<link>http://www.k-wave.org/forum/topic/plane-wave-artifact#post-6931</link>
			<pubDate>Wed, 26 Jun 2019 10:46:35 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6931@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;If you get a stability warning and reducing dt fixes the peak, then it does sound like a stability problem (with an easy fix). The stability is related to the frequency of the source, but the properties of the grid and medium.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Farnaz on "Plane wave artifact"</title>
			<link>http://www.k-wave.org/forum/topic/plane-wave-artifact#post-6923</link>
			<pubDate>Tue, 25 Jun 2019 13:06:11 +0000</pubDate>
			<dc:creator>Farnaz</dc:creator>
			<guid isPermaLink="false">6923@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Dear Brad,&#60;/p&#62;
&#60;p&#62;Thank you for the quick response. &#60;/p&#62;
&#60;p&#62;Yes, I used filterTimeSeries but the peak is still there. Maybe this plot would demonstrate my question better: &#60;/p&#62;
&#60;p&#62;&#60;img src=&#34;https://imagizer.imageshack.com/img922/6394/iEIIry.jpg&#34; /&#62;&#60;/p&#62;
&#60;p&#62;&#60;img src=&#34;https://imagizer.imageshack.com/img923/4159/ypcT6l.jpg&#34; /&#62;&#60;/p&#62;
&#60;p&#62;The one with high peak in the frequency spectrum has the center frequency of 5e6hz whereas the other one with with center frequency of 1.5e6hz looks as I expect. The only parameter that changes is the frequency of input signal.&#60;br /&#62;
note that I get the warning that the simulation might not be stable because of time steps but I am wondering why this happens for 5Mhz whereas the grid can support up to 17Mhz? (decreasing dt results in disappearing this peak)&#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 = 66;                % [grid points]&#60;br /&#62;
pml_y_size = 65;                % [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 = 1152 - 2 * pml_x_size;      % [grid points]&#60;br /&#62;
Ny = 1152 - 2 * pml_y_size;      % [grid points]&#60;br /&#62;
Nz = 32 - 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 = 42.4e-3;                      % [m]&#60;/p&#62;
&#60;p&#62;% calculate the spacing between the grid points&#60;br /&#62;
dx = 3.6765e-5;                     % [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 ;&#60;br /&#62;
medium.density = 900 ;&#60;br /&#62;
c0 = 1540;                      % [m/s]&#60;br /&#62;
rho0 = 900;                    % [kg/m^3]&#60;br /&#62;
medium.alpha_coeff = 0.5;      % [dB/(MHz^y cm)]&#60;br /&#62;
medium.alpha_power = 1.05;&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
t_end = (Nx * dx) * 2.2 / c0;   % [s]&#60;/p&#62;
&#60;p&#62;kgrid.makeTime(c0, [], t_end);&#60;br /&#62;
t_min_stable = checkStability(kgrid,medium) ;&#60;br /&#62;
kgrid.t_array = (0:t_min_stable:t_end) ; &#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 = 1.5e6;        % [Hz]&#60;br /&#62;
tone_burst_cycles = 2;&#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;br /&#62;
input_signal = (source_strength ./ (c0 * rho0)) .* input_signal;&#60;br /&#62;
input_signal = filterTimeSeries(kgrid,medium,input_signal) ;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Plane wave artifact"</title>
			<link>http://www.k-wave.org/forum/topic/plane-wave-artifact#post-6921</link>
			<pubDate>Tue, 25 Jun 2019 11:49:33 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6921@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;If the peaks do not increase as the simulation runs, it doesn't sound like a stability issue. Have you tried filtering the input signal, e.g., using &#60;code&#62;filterTimeSeries&#60;/code&#62;?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Farnaz on "Plane wave artifact"</title>
			<link>http://www.k-wave.org/forum/topic/plane-wave-artifact#post-6919</link>
			<pubDate>Tue, 25 Jun 2019 10:02:12 +0000</pubDate>
			<dc:creator>Farnaz</dc:creator>
			<guid isPermaLink="false">6919@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;hi Brad, &#60;/p&#62;
&#60;p&#62;Thank you very much for the response. &#60;/p&#62;
&#60;p&#62;As far as I understood the stability depends mostly on dt. However, by changing input signal (increasing transducer center frequency (still far less than the frequency grid supports) or changing the number of cycles) I see peaks in the frequency spectrum where I do not expect, e.g. a relatively high peak at the highest frequency that grid supports or a very high peak centered around 0.&#60;br /&#62;
Is this also stability issue? if not, how these peaks appear?  &#60;/p&#62;
&#60;p&#62;Thanks in advance,&#60;br /&#62;
Farnaz
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Plane wave artifact"</title>
			<link>http://www.k-wave.org/forum/topic/plane-wave-artifact#post-6915</link>
			<pubDate>Tue, 25 Jun 2019 08:48:47 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6915@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Farnazkhj,&#60;/p&#62;
&#60;p&#62;Unfortunately there is no simple way to speed up the calculation without using more computational resources. We will release an MPI code that can scale across multiple nodes on a cluster later in the year. Unfortunately for now, the performance of a single recent GPU is likely to be better than the performance of a single node, even using multiple cores.&#60;/p&#62;
&#60;p&#62;The CFL depends on both dt and dx. So what you propose is only possible if you also change the grid spacing.&#60;/p&#62;
&#60;p&#62;As it stands, you can't sample with a lower frequency (i.e., decimate the output) in either the MATLAB or C++ code. For reference, the &#60;code&#62;-s&#60;/code&#62; command line argument for the C++ code is identical to &#60;code&#62;sensor.record_start_index&#60;/code&#62; in MATLAB.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Farnaz on "Plane wave artifact"</title>
			<link>http://www.k-wave.org/forum/topic/plane-wave-artifact#post-6904</link>
			<pubDate>Mon, 24 Jun 2019 11:22:58 +0000</pubDate>
			<dc:creator>Farnaz</dc:creator>
			<guid isPermaLink="false">6904@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello again,&#60;/p&#62;
&#60;p&#62;I realized by adding random scatterers the cross-talk artifact will be eliminated from the raw channel data. Although I have still questions regarding this simulation: &#60;/p&#62;
&#60;p&#62;-I am wondering how it would be possible to speed up this simulation?(it takes 10-11GB memory on GPU and about 15-20 minutes to run) &#60;/p&#62;
&#60;p&#62;-As it is not possible to run GPU code on parallel GPUs, how many CPU cores on a cluster do I need to run with same performance? &#60;/p&#62;
&#60;p&#62;- Is it possible to increase dt and compensate for it with decreasing cfl?  &#60;/p&#62;
&#60;p&#62;- How can I sample in a lower frequency using MATLAB interface (I know it is possible to use -s argument using command line but I get error passing this argument in the MATLAB). Would this decrease the computation time? (I assume it won't and dt is an independent parameter for solving the equations, right?)
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Plane wave simulation, commercial probe"</title>
			<link>http://www.k-wave.org/forum/topic/plane-wave-simulation-commercial-probe#post-6893</link>
			<pubDate>Sat, 22 Jun 2019 20:04:02 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6893@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Farnazkhj,&#60;/p&#62;
&#60;p&#62;1. Yes, if you set the focus point to a large distance, you will get an unfocused transmit.&#60;/p&#62;
&#60;p&#62;2. As long as the transducer is not within the PML, you can set Nz to be a small number. The only downside is that you might not capture the complete out-of-plane behaviour, although the effect on the image is likely to be very small.&#60;/p&#62;
&#60;p&#62;3. Keep in mind a simulation in 2D is different to 3D (e.g., a point source in 2D corresponds to an infinite line source in 3D, so will spherical spreading will be less than a point source in 3D). If you can live with that, 2D will certainly be faster. &#60;/p&#62;
&#60;p&#62;Brad
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Farnaz on "Plane wave artifact"</title>
			<link>http://www.k-wave.org/forum/topic/plane-wave-artifact#post-6869</link>
			<pubDate>Tue, 04 Jun 2019 09:24:05 +0000</pubDate>
			<dc:creator>Farnaz</dc:creator>
			<guid isPermaLink="false">6869@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi all, &#60;/p&#62;
&#60;p&#62;I am trying to simulate a real transducer, I came across an artifact that I am not sure where it is coming from and whether it could be solved or it is just a physical limitation. I could not find my answer in the forum or the manual. The artifact seems to be some sort of cross talk. It would be a great help if you could share your insights. &#60;/p&#62;
&#60;p&#62;I am trying to simulate a 128 element transducer (64 elements of the transducer are activated during TX and RX), transducer width is 37.5 mm therefore only the 64 middle elements are active(18.75mm). I use the transducer class and CUDA code. My intention is to transmit a plane wave trough a medium and receive the echoes with same transducer. My grid size is 1024*1024*64 with pml size 64*64*16(outside).   &#60;/p&#62;
&#60;p&#62;After extracting the scan-lines using transducer.combine_sensor_data(sensor_data) and ploting it, the area near transducer receives what appears to me as a horizontal wave propagated from the side elements. When I remove the kerf the artifact to some extend disappears (not completely though and I need kerf)&#60;/p&#62;
&#60;p&#62;-What can possibly cause such artifact? (e.g. can this be a result of small number of grid points in z directions?(I have restriction in computational resources right now)) &#60;/p&#62;
&#60;p&#62;-Can I avoid it in any way (increasing pml size, pml alpha, placing the transducer inside a highly absorbing material, increase or decrease dt, etc.)&#60;/p&#62;
&#60;p&#62;-What are the acoustic properties of the transducer and the kerf? &#60;/p&#62;
&#60;p&#62;-As the grid is too large, I would like to increase time step but the artifact seems to be even worse when I do so (I use t_min_stable = checkStability(kgrid,medium) and set t_end to this value, changing cfl value doesn't help too). How can I increase time step (or decreasing frequency or in general any solution that results in smaller data size) &#60;/p&#62;
&#60;p&#62;my code is as follows: &#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;f_max = 5e6 ; &#60;/p&#62;
&#60;p&#62;% set the size of the perfectly matched layer (PML)&#60;br /&#62;
pml_x_size =  64;               % [grid points]&#60;br /&#62;
pml_y_size = 64;                % [grid points]&#60;br /&#62;
pml_z_size = 16 ;&#60;/p&#62;
&#60;p&#62;pml_x_alpha = 3;&#60;br /&#62;
pml_y_alpha = 3 ;&#60;br /&#62;
pml_z_alpha = 3 ; &#60;/p&#62;
&#60;p&#62;%total size&#60;br /&#62;
x_size = 4.24e-2 ; %[m]&#60;br /&#62;
y_size = 4.24e-2 ; &#60;/p&#62;
&#60;p&#62;dy = 0.0375/(128*4+127*4 ); %[m]&#60;br /&#62;
dx = dy ;  %&#60;br /&#62;
dz = dy ; &#60;/p&#62;
&#60;p&#62;% Ny = y_size/dy grid points&#60;br /&#62;
Ny = 1024 ; %ceil(y_size/dy)-2*pml_x_size ;&#60;br /&#62;
Nx = 1024 ; %ceil(x_size/dx)-2*pml_y_size   ;&#60;br /&#62;
Nz = 32; &#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 ;&#60;br /&#62;
rho0 = 900;                    % [kg/m^3]&#60;br /&#62;
medium.alpha_coeff = 0.5 ;&#60;br /&#62;
medium.alpha_power = 1.05 ; &#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
c0_min = 1300 ;  %m/s&#60;br /&#62;
t_end = (Nx * dx) * 2.2 / c0_min;   % [s]&#60;br /&#62;
kgrid.makeTime(c0_min,0.3, t_end);&#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 = 1e6;          % [Pa]&#60;/p&#62;
&#60;p&#62;sampling_freq = 20e6 ; % [Hz]&#60;br /&#62;
tone_burst_freq = 5e6;          % [Hz]&#60;br /&#62;
tone_burst_cycles = 2;&#60;br /&#62;
input_signal = toneBurst(1/kgrid.dt, tone_burst_freq, tone_burst_cycles);&#60;br /&#62;
input_signal = (source_strength ./ (c0_min * 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 = 4;       % width of each element [grid points]&#60;br /&#62;
transducer.element_length =28;  	% length of each element [grid points]&#60;br /&#62;
transducer.element_spacing = 4;  	% 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([2, 2,  1]);&#60;/p&#62;
&#60;p&#62;% properties used to derive the beamforming delays&#60;br /&#62;
transducer.sound_speed = c0_min;           % sound speed [m/s]&#60;br /&#62;
transducer.focus_distance = inf;           % focus distance [m]&#60;br /&#62;
transducer.elevation_focus_distance = inf;    % 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 = zeros(transducer.number_elements, 1);&#60;br /&#62;
transducer.active_elements(33:96) = 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;br /&#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;% define a random distribution of scatterers for the medium&#60;br /&#62;
background_map_mean = 1;&#60;br /&#62;
background_map = background_map_mean ;&#60;br /&#62;
scattering_c0 = c0_min ;&#60;br /&#62;
scattering_rho0 = scattering_c0 / 0.9 ;&#60;/p&#62;
&#60;p&#62;% define properties&#60;br /&#62;
sound_speed_map = c0_min * ones(Nx_tot, Ny_tot, Nz_tot) .* background_map;&#60;br /&#62;
density_map = rho0 * ones(Nx_tot, Ny_tot, Nz_tot) .* background_map;&#60;br /&#62;
medium.sound_speed = sound_speed_map(:,:, :);&#60;br /&#62;
medium.density = density_map(:, :, :);&#60;br /&#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;
    'PMLAlpha', [pml_x_alpha, pml_y_alpha, pml_z_alpha], 'DataCast', DATA_CAST, 'DataRecast', true, 'PlotSim', false};&#60;br /&#62;
% save input files to disk&#60;/p&#62;
&#60;p&#62;% run the simulation&#60;br /&#62;
[sensor_data] = kspaceFirstOrder3DG(kgrid, medium, transducer, transducer, input_args{:});&#60;br /&#62;
scan_lines = transducer.combine_sensor_data(sensor_data) ;&#60;br /&#62;
%&#60;br /&#62;
 save sensor_data&#60;br /&#62;
% &#60;/p&#62;
&#60;p&#62;It would be really helpful if you can share your insights.&#60;br /&#62;
Thanks in advance,&#60;br /&#62;
Farnaz
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Farnaz on "Plane wave simulation, commercial probe"</title>
			<link>http://www.k-wave.org/forum/topic/plane-wave-simulation-commercial-probe#post-6850</link>
			<pubDate>Tue, 14 May 2019 12:41:39 +0000</pubDate>
			<dc:creator>Farnaz</dc:creator>
			<guid isPermaLink="false">6850@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi, &#60;/p&#62;
&#60;p&#62;I am new to k-wave and have some questions, I'm trying to simulate a commercial ultrasound transducer with 128 elements which 64 elements of it are activated in a plane wave scenario. &#60;/p&#62;
&#60;p&#62;1- If I set the focus point to inf (or very large values) when I am defining transducer parameters will I have plane wave? If not, how I can simulate plane wave for a commercial probe then? &#60;/p&#62;
&#60;p&#62;2- Based on the pitch and kerf parameters I need at least 1024 grid points in x and y direction (only for the transducer probe face)(3.75 cm probe 4 grid point for piezo and extra 4 grid points for kerf). The whole medium is then 4.24*4.24 cm and the probe plane is located just outside the PML. The same transducer will be used as sensor to record the data.&#60;br /&#62;
As the transducer class only works in 3D mode, these many grid points are computationally expensive, what happens if I set Nz to a very small number  while maintaining dz=dx=dy (say Nz = 16,32, etc...)? &#60;/p&#62;
&#60;p&#62;3- If this is not possible to do what are your suggestions for my simulation? Should I use 2D simulation and set everything manually instead of using transducer class? (BTW i'm using 3D c++ version for CUDA but I run it in MATLAB (I have a GeForce GTX 1080 Ti))
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
