<?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: Dunzinho</title>
		<link><a href='http://www.k-wave.org/forum/profile/dunzinho'>dunzinho</a></link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:10:26 +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>g.c. on "A Question about The Reflection at The Hetrogeneous Media Boundary"</title>
			<link>http://www.k-wave.org/forum/topic/a-question-about-the-reflection-at-the-hetrogeneous-media-boundary#post-9089</link>
			<pubDate>Tue, 07 May 2024 15:09:01 +0000</pubDate>
			<dc:creator>g.c.</dc:creator>
			<guid isPermaLink="false">9089@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi!&#60;br /&#62;
I am currently working on my master thesis and want to simulate the propagation of a pressure distribution in a structure of alterning Al and Pb foils (a few um thick, circular, 2cm radius, the whole thing is in vacuum). I am having problems with my result, as it is diverging: the mean pressure on a thin detector on the other side of the stack is going towards 10^293Pa. I assumed it accured because my geometry is not smooth enougth, so to check I just built a block of Pb in vacuum and put a circular pressure source inside of it, and run the simulation in 2D. As I understood from one of the last posts (point 4) it shouldn't be a problem if the source originates from within the high impedance material. Why does my code still diverge? is there a solution to this problem? i tried to change the material properties, but I have to change them so much, that the simulation is not rapresentative anymore. &#60;/p&#62;
&#60;p&#62;Here is my code:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;%% % create masks
z_lim = 0.03;
x_lim = 0.01;%in m

Nx = 200;           % number of grid points in the x direction
Nz = 600;           % number of grid points in the z direction
dz = 0.00005;
dx = 0.0001;
[Z,X] = meshgrid((0:dz:z_lim-dz),(-1*x_lim:dx:x_lim-dx));
geom = zeros(size(Z));
det = zeros(size(Z));

lz = 0.02; % [m], z length
lx = 0.01; % [m], x length
z0 = 0.015; % [m], z center
x0 = 0; % [m], x center
ind = ((Z &#38;gt;= z0-lz/2) &#38;amp; (Z &#38;lt; z0+lz/2) &#38;amp; (X &#38;gt;= x0-lx/2) &#38;amp; (X &#38;lt; x0+lx/2));
[num, ~] = materials(4); %add the material of interest
geom(ind) = num;
geom = permute(geom,[2,1]);

% Create the computational grid for the 2D slice
kgrid = kWaveGrid(Nz, dz, Nx, dx);
[densitymask,speedmask,alphamask,ymask] = get_masks(geom);

%%
% Define the properties of the upper layer of the propagation medium

medium.sound_speed = speedmask;
medium.density = densitymask;

% Create time array
t_end = 3e-6;  % [s]
kgrid.makeTime(medium.sound_speed, [], t_end);
%%
%create SOURCE
% define a single source point
disc_magnitude = 300; % [Pa]
disc_x_pos = Nx/2;    % [grid points]
disc_z_pos = Nz/4;
disc_radius = 0.4;    % [grid points]
disc = disc_magnitude * makeDisc(Nz, Nx, disc_z_pos, disc_x_pos, disc_radius);

source.p0 = zeros(Nz, Nx);
source.p0 = disc  ;
% %%
%  %SENSOR

det = makeLine(Nz, Nx, [round(0.023/dz), 90],[round(0.023/dz), 110]);
%det = permute(det,[2,1]);
sensor.mask=det;
%%

% Run the simulation with PlotLayout and PlotScale
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor,...
                &#38;#39;PlotLayout&#38;#39;, true);

%%
% Assuming your pressure data is stored in a variable named &#38;#39;pressure_data&#38;#39;
figure
% Calculate the mean pressure across all pixels at each time step
mean_pressure = mean(sensor_data, 1);

% Plot pressure versus time
plot(kgrid.t_array, mean_pressure, &#38;#39;LineWidth&#38;#39;, 2);
xlabel(&#38;#39;Time&#38;#39;);
ylabel(&#38;#39;Mean Pressure on detector&#38;#39;);
title(&#38;#39;Mean Pressure vs Time&#38;#39;);
grid on;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;the materials are defined as follows: &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function [num, mat, rho, c, gamma, alpha_coeff,y] = materials(arg)

% attenuation data: Appl. Sci. 2020, 10(7), 2230; &#60;a href=&#34;https://doi.org/10.3390/app10072230&#34; rel=&#34;nofollow&#34;&#62;https://doi.org/10.3390/app10072230&#60;/a&#62; 

if arg == 0 &#124; strcmpi(arg,&#38;#39;vacuum&#38;#39;) &#124; strcmpi(arg,&#38;#39;vac&#38;#39;)
    mat = &#38;#39;vacuum&#38;#39;;
    num = 0;

    rho = 0.0012 ;% 1.2e-3; %                 [g/cm^3] density
    c = 0.4; %0.4; %                    [mm/us] speed of sound
    beta = 3400e-6; %               [1/K] vol. thermal expansion
    c_p = 1012; %                   [J/kg/K] spec. heat capacity
    gamma = beta*(c*1000)^2/c_p; %  [Pa/(J/m^3)] Grüneisenparameter
    alpha_coeff = 1e-6; %0                    [dB/cm/MHz^y] acoustic attenuation coef.
    y = 1; %                        attenuation exponent

elseif arg == 4 &#124; strcmpi(arg,&#38;#39;lead&#38;#39;) &#124; strcmpi(arg,&#38;#39;Pb&#38;#39;)
    mat = &#38;#39;Pb&#38;#39;;
    num = 4;

    A = 207; %                      [u] eff. Massezahl
    Z = 82; %                       [u] eff. Ordnungszahl
    rho = 11.29;%11.29; %                  [g/cm^3] density
    c = 1.96; % 1.96                    [mm/us] speed of sound
    beta = 29e-6; % 87e-6; %                 [1/K] vol. thermal expansion
    c_p = 129; %                    [J/kg/K] spec. heat capacity
    gamma = beta*(c*1000)^2/c_p; %  [Pa/ (J/m^3)] Grüneisenparameter
    I = 823; %                      [eV] mean excitation energy
    alpha_coeff = 4.33; %alpha = 4.33; %                 [dB/cm/MHz] acoustic attenuation coef.
    y = 1; %                        attenuation exponent

end&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;and get masks is a function: &#60;/p&#62;
&#60;pre&#62;&#60;code&#62;function [densitymask,speedmask,alphamask,ymask] = get_masks(geom)  

% create mask arrays
densitymask = zeros(size(geom));
speedmask = zeros(size(geom));
alphamask = zeros(size(geom));
ymask = zeros(size(geom));

% initialise counter
n = 0;

while ~all(densitymask(:)) 

    % assign values of materials to masks
    [~, ~, rho, c, ~, alpha_coeff,y] = materials(n);

    densitymask(geom == n) = rho*1e3; %     [kg/m^3]

    speedmask(geom == n) = c*1e3; %         [m/s]

    alphamask(geom == n) = alpha_coeff; %         [dB/cm/MHz^y] 

    ymask(geom == n) = y; % 

    % increase counter
    n = n+1;

end
end&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;Thank you in advance for any help.&#60;br /&#62;
Best regards,&#60;br /&#62;
Gianna
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Simulating curved transducers"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-curved-transducers#post-8759</link>
			<pubDate>Wed, 17 May 2023 18:58:32 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8759@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Take a look at the new kWaveArray class and &#60;a href=&#34;http://www.k-wave.org/documentation/example_at_piston_and_bowl_transducers.php&#34;&#62;related examples&#60;/a&#62; in v1.4.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>aduer on "Simulating curved transducers"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-curved-transducers#post-8703</link>
			<pubDate>Wed, 08 Feb 2023 09:59:56 +0000</pubDate>
			<dc:creator>aduer</dc:creator>
			<guid isPermaLink="false">8703@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I am currently working on my bachelor thesis on focused ultrasound. Now I take the example &#34;defining transducer&#34; with the &#34;Transducer-class&#34; as a basis, the problem is that I cannot change the radius. Now I wanted to ask how and whether I can rewrite the &#34;Transducer class&#34; in such a way that I can change the radius and simulate a curved transducer with the kwave transducer class.&#60;/p&#62;
&#60;p&#62;Best regards,&#60;br /&#62;
Alex
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Amita on "about the wave equation"</title>
			<link>http://www.k-wave.org/forum/topic/about-the-wave-equation#post-8419</link>
			<pubDate>Sun, 09 Jan 2022 17:37:32 +0000</pubDate>
			<dc:creator>Amita</dc:creator>
			<guid isPermaLink="false">8419@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;ok&#60;br /&#62;
Thank you
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "about the wave equation"</title>
			<link>http://www.k-wave.org/forum/topic/about-the-wave-equation#post-8418</link>
			<pubDate>Sun, 09 Jan 2022 15:23:52 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8418@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;See &#60;a href=&#34;https://discovery.ucl.ac.uk/id/eprint/10113895/1/2014_Treeby_IEEE_kWaveElastic.pdf&#34;&#62;here&#60;/a&#62;.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Amita on "about the wave equation"</title>
			<link>http://www.k-wave.org/forum/topic/about-the-wave-equation#post-8417</link>
			<pubDate>Sun, 09 Jan 2022 15:16:37 +0000</pubDate>
			<dc:creator>Amita</dc:creator>
			<guid isPermaLink="false">8417@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi&#60;/p&#62;
&#60;p&#62;It is written there in user manual that the tool is solving governing equations for fluid medium, then how k-wave is applicable for solid or viscoelastic medium when the wave equation itself is not for these medium?&#60;/p&#62;
&#60;p&#62;or&#60;/p&#62;
&#60;p&#62;which governing equations are being solved behind the command pstdElastic2D and pstdElastic3D?&#60;/p&#62;
&#60;p&#62;please help.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Absorption coeff. of the target"</title>
			<link>http://www.k-wave.org/forum/topic/absorption-coeff-of-the-target#post-8200</link>
			<pubDate>Wed, 09 Jun 2021 08:57:26 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8200@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;If you don't specify the absorption, the simulation will be lossless. If you have already specified the medium properties, you can remove it by:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;medium = rmfield(medium, &#38;#39;alpha_coeff&#38;#39;);
medium = rmfield(medium, &#38;#39;alpha_power&#38;#39;);&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>zengqw2021 on "Absorption coeff. of the target"</title>
			<link>http://www.k-wave.org/forum/topic/absorption-coeff-of-the-target#post-8197</link>
			<pubDate>Wed, 09 Jun 2021 08:17:44 +0000</pubDate>
			<dc:creator>zengqw2021</dc:creator>
			<guid isPermaLink="false">8197@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;br /&#62;
   Ok, I see. Is there a way for me to turn absorption off during reconstruction?&#60;/p&#62;
&#60;p&#62;    Zeng
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Absorption coeff. of the target"</title>
			<link>http://www.k-wave.org/forum/topic/absorption-coeff-of-the-target#post-8196</link>
			<pubDate>Tue, 08 Jun 2021 17:39:26 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8196@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Zeng,&#60;/p&#62;
&#60;p&#62;The second simulation is run on a different sized grid (to avoid the inverse crime). So you will either need to use the same grid, or redefine &#60;code&#62;medium.alpha_coeff&#60;/code&#62; to be Nx by Ny. &#60;/p&#62;
&#60;p&#62;Note though, you probably want to turn absorption off anyway for the reconstruction (or invert it as described in the attenuation compensation examples).&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>zengqw2021 on "Absorption coeff. of the target"</title>
			<link>http://www.k-wave.org/forum/topic/absorption-coeff-of-the-target#post-8171</link>
			<pubDate>Mon, 07 Jun 2021 16:06:11 +0000</pubDate>
			<dc:creator>zengqw2021</dc:creator>
			<guid isPermaLink="false">8171@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Dear treeby,&#60;br /&#62;
   I’m a new user of k-Wave toolbox. It is great. Now, I'm trying to run a simulation with different absorption coeff. The alfa_coeff is change to a matrix, the simulation encounter the following error:&#60;br /&#62;
Matrix dimensions must agree.&#60;br /&#62;
Error in kspaceFirstOrder2D (line 864)&#60;br /&#62;
                   (rhox + rhoy) ...&#60;br /&#62;
Error in PAT_Heterogeneous (line 93)&#60;br /&#62;
p0_recon = kspaceFirstOrder2D(kgrid_recon, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;%%The code is as follows:&#60;/p&#62;
&#60;p&#62;clearvars;clear;close all;clc;&#60;/p&#62;
&#60;p&#62;% =========================================================================&#60;br /&#62;
% SIMULATION&#60;br /&#62;
% =========================================================================&#60;/p&#62;
&#60;p&#62;% assign the grid size and create the computational grid&#60;br /&#62;
PML_size = 20;              % size of the PML in grid points&#60;br /&#62;
Nx = 256 - 2 * PML_size;    % number of grid points in the x direction&#60;br /&#62;
Ny = 256 - 2 * PML_size;    % number of grid points in the y direction&#60;br /&#62;
x = 20e-3;                  % total grid size [m]&#60;br /&#62;
y = 20e-3;                  % total grid size [m]&#60;br /&#62;
dx = x / Nx;                % grid point spacing in the x direction [m]&#60;br /&#62;
dy = y / Ny;                % grid point spacing in the y direction [m]&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;% create initial pressure distribution&#60;br /&#62;
medium.sound_speed = 330;   % [m/s]&#60;br /&#62;
medium.alpha_coeff = ones(kgrid.Nx,kgrid.Ny)*0.75;  % [dB/(MHz^y cm)] %ones(kgrid.Nx,kgrid.Ny)*&#60;br /&#62;
medium.alpha_power = 1.5;&#60;br /&#62;
medium.alpha_mode = 'no_dispersion';&#60;/p&#62;
&#60;p&#62;Cp_heat_cap = 1.002;       % the specific heat capacity at constant pressure&#60;br /&#62;
Heat_beta   = 1/273.15;    % the coefficient of the thermal expansion&#60;/p&#62;
&#60;p&#62;disc_H0    = 30;               % [kJ/m3]&#60;br /&#62;
disc_x_pos = floor(Nx/2);             % [grid points]&#60;br /&#62;
disc_y_pos = floor(Ny/2);  	       % [grid points]&#60;br /&#62;
disc_radius = 4/2/sqrt(log(2));    % [grid points]&#60;br /&#62;
disc_1 = Heat_beta*medium.sound_speed^2/Cp_heat_cap*disc_H0*makeDisc(Nx, Ny, disc_x_pos, disc_y_pos, disc_radius); % Heat_beta*medium.sound_speed^2/Cp_heat_cap*&#60;/p&#62;
&#60;p&#62;p0 = disc_1 ;&#60;br /&#62;
% imagesc(p0);&#60;br /&#62;
source.p0 = disc_1 ;&#60;br /&#62;
init_p0  = source.p0; %for output&#60;/p&#62;
&#60;p&#62;% smooth the initial pressure distribution and restore the magnitude&#60;br /&#62;
source.p0 = smooth(source.p0, true);&#60;/p&#62;
&#60;p&#62;% define a centered Cartesian circular sensor&#60;br /&#62;
sensor_radius = 2e-3;      % [m]&#60;br /&#62;
sensor_angle = 2*pi ;      % [rad]&#60;br /&#62;
sensor_pos = [0, 0];       % [m]&#60;br /&#62;
num_sensor_points = 30;&#60;br /&#62;
cart_sensor_mask = makeCartCircle(sensor_radius, num_sensor_points, sensor_pos, sensor_angle);&#60;/p&#62;
&#60;p&#62;% assign to sensor structure&#60;br /&#62;
sensor.mask = cart_sensor_mask;&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
t1=kgrid.makeTime(medium.sound_speed);&#60;/p&#62;
&#60;p&#62;% set the input arguements: force the PML to be outside the computational&#60;br /&#62;
% grid; switch off p0 smoothing within kspaceFirstOrder2D&#60;br /&#62;
input_args1 = {'PMLInside', false, 'PMLSize', PML_size, 'PlotPML', false, 'Smooth', false};&#60;/p&#62;
&#60;p&#62;% %% save the simulation animations as a movie&#60;br /&#62;
% input_args2 = {'RecordMovie', true, 'MovieName', 'example_movie'};&#60;br /&#62;
% input_args = [input_args1 input_args2];&#60;br /&#62;
input_args = input_args1;&#60;/p&#62;
&#60;p&#62;% run the simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;% add noise to the recorded sensor data&#60;br /&#62;
signal_to_noise_ratio = 40;	% [dB]&#60;br /&#62;
sensor_data = addNoise(sensor_data, signal_to_noise_ratio, 'peak');&#60;/p&#62;
&#60;p&#62;% create a second computation grid for the reconstruction to avoid the&#60;br /&#62;
% inverse crime&#60;br /&#62;
Nx = 300;           % number of grid points in the x direction&#60;br /&#62;
Ny = 300;           % number of grid points in the y direction&#60;br /&#62;
dx = x/Nx;          % grid point spacing in the x direction [m]&#60;br /&#62;
dy = y/Ny;          % grid point spacing in the y direction [m]&#60;br /&#62;
kgrid_recon = kWaveGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;% use the same time array for the reconstruction&#60;br /&#62;
kgrid_recon.setTime(kgrid.Nt, kgrid.dt);&#60;/p&#62;
&#60;p&#62;% reset the initial pressure&#60;br /&#62;
source.p0 = 0;&#60;/p&#62;
&#60;p&#62;% assign the time reversal data&#60;br /&#62;
sensor.time_reversal_boundary_data = sensor_data;&#60;/p&#62;
&#60;p&#62;% run the time-reversal reconstruction&#60;br /&#62;
p0_recon = kspaceFirstOrder2D(kgrid_recon, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;Could you give me some advice?&#60;br /&#62;
I appreciate any help in this regard.&#60;br /&#62;
   Zeng
&#60;/p&#62;</description>
		</item>
		<item>
			<title>alisiddiqi87 on "Power law absorption coefficient units"</title>
			<link>http://www.k-wave.org/forum/topic/power-law-absorption-coefficient-units#post-7702</link>
			<pubDate>Tue, 21 Jul 2020 10:24:56 +0000</pubDate>
			<dc:creator>alisiddiqi87</dc:creator>
			<guid isPermaLink="false">7702@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Bradley,&#60;/p&#62;
&#60;p&#62;I think NikiKeyz is right.&#60;/p&#62;
&#60;p&#62;&#38;gt;&#38;gt;To convert from dB/km to dB/cm you need to multiply by 1e-4.&#60;br /&#62;
It should be 1e-5.&#60;/p&#62;
&#60;p&#62;&#38;gt;&#38;gt;Then to convert from dB/m/kHz^y to dB/m/MHz^y requires multiplying the prefactor by a further 0.001^y&#60;br /&#62;
I think it should be 'dividing' the prefactor by a further 0.001^y&#60;/p&#62;
&#60;p&#62;Thanks and regards,&#60;br /&#62;
Ali
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Yan on "Absorption in photoacoustic simulations"</title>
			<link>http://www.k-wave.org/forum/topic/absorption-in-photoacoustic-simulations#post-7420</link>
			<pubDate>Sun, 19 Apr 2020 15:21:40 +0000</pubDate>
			<dc:creator>Yan</dc:creator>
			<guid isPermaLink="false">7420@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Dear Bencox,&#60;/p&#62;
&#60;p&#62;Is there any paper demonstrating the relationship of the frequencies generated by a specified source being illuminated and the frequencies of the temporal heating pulse?&#60;/p&#62;
&#60;p&#62;It would be grateful if you can give some your insight on this!&#60;/p&#62;
&#60;p&#62;Thanks!&#60;/p&#62;
&#60;p&#62;Yan
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bencox on "Effective propagation velocity differs from medium.sound_speed"</title>
			<link>http://www.k-wave.org/forum/topic/effective-propagation-velocity-differs-from-mediumsound_speed#post-6932</link>
			<pubDate>Wed, 26 Jun 2019 11:15:22 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">6932@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Michael, &#60;/p&#62;
&#60;p&#62;Try the simulation in 1D and see if you get the same result. There is some effect of the bandlimited interpolant, but the effect of simulating in 2D will be greater, I suspect, as the cross-correlation will not work well, because the pulse shape of the propagating wave will be different from the source pulse.&#60;/p&#62;
&#60;p&#62;Best wishes,&#60;br /&#62;
Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>MichaelElfering on "Effective propagation velocity differs from medium.sound_speed"</title>
			<link>http://www.k-wave.org/forum/topic/effective-propagation-velocity-differs-from-mediumsound_speed#post-6924</link>
			<pubDate>Tue, 25 Jun 2019 15:01:39 +0000</pubDate>
			<dc:creator>MichaelElfering</dc:creator>
			<guid isPermaLink="false">6924@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Ben,&#60;br /&#62;
Thanks very much for your response.&#60;br /&#62;
Yes the result gets pretty much perfect after a distance of about 1m is reached – as seen in the bottom diagram of my example. Here, the time it takes the signal to go from one grid point to the next matches the theoretical value almost perfectly.&#60;br /&#62;
I stumbled across the band-limited interpolant as well, but what made me wonder is that the error increases as the grid gets finer. To my understanding the error due to band-limited interpolant should decrease if I chose a finer grid since the band gets wider. Doesn’t it?&#60;br /&#62;
Is there any way to reduce this behaviour? Finer Grid (larger Nx) and smaller CFL doesn’t seem to do the job…  Maybe I’m doing it wrong?! Or maybe there is another way like some kind of smoothed time varying source?!&#60;br /&#62;
Anyhow many thanks for your support and for the very powerful Toolbox you build.&#60;br /&#62;
Best wishes,&#60;br /&#62;
Michael
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bencox on "Effective propagation velocity differs from medium.sound_speed"</title>
			<link>http://www.k-wave.org/forum/topic/effective-propagation-velocity-differs-from-mediumsound_speed#post-6920</link>
			<pubDate>Tue, 25 Jun 2019 10:54:18 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">6920@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Michael, &#60;/p&#62;
&#60;p&#62;Most of the effect comes from the fact that in 2D the measured pulses have a different shape from the source. It is clearer if a symmetrical pulse is used as the source, as the measured time series will no longer be symmetrical. &#60;/p&#62;
&#60;p&#62;However, there is also a slight time shift between the signal measured at the source point and the signal measured at adjacent points. This is due to the band-limited interpolant (see other posts on this if you're interested). If you measure the time difference from a point a few grid points away from the source to points further away then your problem shouldn't arise.&#60;/p&#62;
&#60;p&#62;Best wishes,&#60;br /&#62;
Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "3D UltraSound Delay and Sum (DAS) and image reconstruction"</title>
			<link>http://www.k-wave.org/forum/topic/3d-ultrasound-delay-and-sum-das-and-image-reconstruction#post-6899</link>
			<pubDate>Sat, 22 Jun 2019 20:38:02 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6899@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Have you looked at the &#60;a href=&#34;https://www.ustb.no&#34;&#62;Ultrasound Toolbox&#60;/a&#62;? That might have something useful (I haven't used it myself).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Missed scaling factor"</title>
			<link>http://www.k-wave.org/forum/topic/missed-scaling-factor#post-6898</link>
			<pubDate>Sat, 22 Jun 2019 20:35:54 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6898@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi ourdream,&#60;/p&#62;
&#60;p&#62;In this case, you will still be measuring the output in pascals, although the detected signal will be affected by the directional response of the sensor. If you had a physical sensor that increased in size, you'd measure a larger signal in volts (other things being equal), but this would come out in the wash when you apply the calibration from volts to pascals.&#60;/p&#62;
&#60;p&#62;Is that what you were asking?&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>MichaelElfering on "Effective propagation velocity differs from medium.sound_speed"</title>
			<link>http://www.k-wave.org/forum/topic/effective-propagation-velocity-differs-from-mediumsound_speed#post-6881</link>
			<pubDate>Wed, 12 Jun 2019 12:31:47 +0000</pubDate>
			<dc:creator>MichaelElfering</dc:creator>
			<guid isPermaLink="false">6881@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;br /&#62;
I’m trying to determine the medium property (speed of sound) based on the measured Time-of-Flight. When I started simulating some cases in k-wave I noticed, that the results I get differ from the theory especially close to the source. I’m using a time varying source and dirichlet boundary conditions. The magnitude of the error seems to depend on the grid resolution (Nx) and is independent from the cfl-number. Can anyone tell me what might be the cause?&#60;br /&#62;
Thanks&#60;br /&#62;
Michael&#60;/p&#62;
&#60;p&#62;Here is a simple case that demonstrates the problem:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;clearvars;

% =========================================================================
% SIMULATION
% =========================================================================

% create the computational grid
Nx = 512;           % number of grid points in the x (row) direction
Ny = 64;           % number of grid points in the y (column) direction
dx = 15/Nx;    	% grid point spacing in the x direction [m]
dy = dx;            % grid point spacing in the y direction [m]
kgrid = kWaveGrid(Nx, dx, Ny, dy);

% define the properties of the propagation medium
medium.sound_speed = 1500;  % [m/s]
medium.alpha_coeff = 0.75;  % [dB/(MHz^y cm)]
medium.alpha_power = 1.5;
cfl = 0.1;
endtime = 0.013; % [s]

% create the time array
kgrid.makeTime(medium.sound_speed, cfl, endtime);

% define a row of source points
source.p_mask = zeros(Nx, Ny);
source.p_mask(end - Nx/4, Ny/2) = 1;

% define the properties of the tone burst used to drive the transducer
sampling_freq = 1/kgrid.dt;     % [Hz]
tone_burst_freq = 800;          % [Hz]
tone_burst_cycles = 6;
source_mag = 2;                 % [Pa]

% create the tone burst signals
source.p = source_mag * toneBurst(sampling_freq, tone_burst_freq, tone_burst_cycles);
padsz = length(kgrid.t_array)-length(source.p);
source.p = padarray(source.p, [0 padsz], 0, &#38;#39;post&#38;#39;);

% filter the source to remove high frequencies not supported by the grid
source.p = filterTimeSeries(kgrid, medium, source.p);

source.p_mode = &#38;#39;dirichlet&#38;#39;;

% define a single sensor point
sensor.mask = zeros(Nx, Ny);
sensor.mask(Nx/4:end - Nx/4, Ny/2) = 1;

% define the acoustic parameters to record
sensor.record = {&#38;#39;p&#38;#39;, &#38;#39;p_final&#38;#39;};

% run the simulation
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor);

%% calculate Time of Flight between two sensor points
[NS, ~] = size(sensor_data.p);
tof = zeros(1, NS);
x2 = source.p;   % source signal
for j=1:NS
        x1 = squeeze(sensor_data.p(j, :));    % receiver signal
        [y1, lags] = xcorr(x1,x2);
        [~,idx] = max(y1);
        tof(j) = lags(idx) * kgrid.dt;
end

dist = (kgrid.x(logical(source.p_mask))-kgrid.x(logical(sensor.mask)))&#38;#39;;

c = dist./tof;         % mean speed of sound between the source an the sensor
c(end) = nan;
tofn = tof/kgrid.dt;   % Normalized ToF
deltatn = -diff(tofn); % Number of Timesteps it takes the signal to get from one grid cell to the next

% theoretical values
c_theo = ones(1, length(c))* medium.sound_speed;
deltatn_theo = ones(1, length(deltatn))*(kgrid.dx / (medium.sound_speed * kgrid.dt));

% =========================================================================
%% VISUALISATION
% =========================================================================

% plot calulated speed of Sound
figure;
[~, scale, prefix] = scaleSI(max(dist(:)));
subplot(2, 1, 1);
plot(dist * scale, c, &#38;#39;k-&#38;#39;, &#38;#39;DisplayName&#38;#39;, &#38;#39;simulation&#38;#39;);
hold on;
plot(dist * scale, c_theo, &#38;#39;r-&#38;#39;, &#38;#39;DisplayName&#38;#39;, &#38;#39;theoretical&#38;#39;);
hold off;
xlabel([&#38;#39;distance [&#38;#39; prefix &#38;#39;m]&#38;#39;]);
ylabel(&#38;#39;speed of sound [m/s]&#38;#39;);
axis tight;
title(&#38;#39;effective SoS between source and sensor&#38;#39;);
legend(&#38;#39;simulation&#38;#39;,&#38;#39;theoretical&#38;#39;);

subplot(2, 1, 2);
plot(dist * scale, [deltatn 0], &#38;#39;k-&#38;#39;, &#38;#39;DisplayName&#38;#39;, &#38;#39;simulation&#38;#39;);
hold on;
plot(dist * scale, [deltatn_theo 0], &#38;#39;r-&#38;#39;, &#38;#39;DisplayName&#38;#39;, &#38;#39;theoretical&#38;#39;);
hold off;
xlabel([&#38;#39;distance [&#38;#39; prefix &#38;#39;m]&#38;#39;]);
ylabel(&#38;#39;number of time steps&#38;#39;);
axis tight;
title(&#38;#39;number of time steps for each grid step&#38;#39;);
legend(&#38;#39;simulation&#38;#39;,&#38;#39;theoretical&#38;#39;);&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>souradiprockz on "3D UltraSound Delay and Sum (DAS) and image reconstruction"</title>
			<link>http://www.k-wave.org/forum/topic/3d-ultrasound-delay-and-sum-das-and-image-reconstruction#post-6861</link>
			<pubDate>Mon, 27 May 2019 12:13:41 +0000</pubDate>
			<dc:creator>souradiprockz</dc:creator>
			<guid isPermaLink="false">6861@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Okay thanks for the beamforming part. What about image reconstruction?&#60;br /&#62;
how can we reconstruct the image using sensor data ('delay and sum algorithm') in K wave toolbox?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>ourdream on "Missed scaling factor"</title>
			<link>http://www.k-wave.org/forum/topic/missed-scaling-factor#post-6859</link>
			<pubDate>Thu, 23 May 2019 13:50:14 +0000</pubDate>
			<dc:creator>ourdream</dc:creator>
			<guid isPermaLink="false">6859@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Dear Bradley,&#60;/p&#62;
&#60;p&#62;I didn't know you replied to my post.&#60;br /&#62;
Sorry for this late response.&#60;/p&#62;
&#60;p&#62;I think you are right. Your recommendation fixed the different amplitude problem.&#60;br /&#62;
Thanks a lot.&#60;/p&#62;
&#60;p&#62;However, your solution causes another confusion to me.&#60;br /&#62;
What is the physical meaning for the measured PA amplitude when we normalize the sensor?&#60;br /&#62;
Referring your 2005 J. of Acoust. Soc. Am. Paper, it is a little bit difficult for me to match the simulated PA amplitude value with the value from those equations in the reference.&#60;/p&#62;
&#60;p&#62;Regards,
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
