<?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: JoanOS</title>
		<link><a href='http://www.k-wave.org/forum/profile/joanos'>joanos</a></link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 02:03:42 +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>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>Bradley Treeby on "Power law absorption coefficient units"</title>
			<link>http://www.k-wave.org/forum/topic/power-law-absorption-coefficient-units#post-6064</link>
			<pubDate>Fri, 21 Jul 2017 13:47:13 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6064@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;The conversion should be:&#60;/p&#62;
&#60;p&#62;(0.068e2) Np / m / MHz^-b = (0.068e2 * 8.686 / 100) dB / cm / MHz^-b = (0.59) dB / cm / MHz^-b&#60;/p&#62;
&#60;p&#62;You will need to assume a value of &#60;code&#62;alpha_power&#60;/code&#62; if you want to calculate &#60;code&#62;alpha_coeff&#60;/code&#62; from the absorption at a single frequency.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>v3p on "Power law absorption coefficient units"</title>
			<link>http://www.k-wave.org/forum/topic/power-law-absorption-coefficient-units#post-6048</link>
			<pubDate>Fri, 07 Jul 2017 17:18:14 +0000</pubDate>
			<dc:creator>v3p</dc:creator>
			<guid isPermaLink="false">6048@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Thank you Bradley!&#60;br /&#62;
It was my mistake, as I understand now only alpha power should be a scalar.&#60;br /&#62;
Might I have one more assist from you. In new simulation I tried to make heterogeneous medium where one layer is skull bone and second brain. i took data from this site &#60;a href=&#34;http://www.kayelaby.npl.co.uk/general_physics/2_4/2_4_6.html&#34; rel=&#34;nofollow&#34;&#62;http://www.kayelaby.npl.co.uk/general_physics/2_4/2_4_6.html&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;When I convert units I received a huge number for alpha coefficient, for example:&#60;br /&#62;
Brain: 0.068*10^2*8.686(db)*10^(6*1.3)(Hz)/100(cm)=~37*10^6...&#60;/p&#62;
&#60;p&#62;And second is possible to calculate alpha coefficient for skull when I know only alpha at certain frequency 9@3Mhz
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Simulating medium with two acoustic properties"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-medium-with-two-acoustic-properties#post-6041</link>
			<pubDate>Tue, 04 Jul 2017 09:01:31 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6041@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Mohalmadi,&#60;/p&#62;
&#60;p&#62;See my comment above.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Mohalmadi on "Simulating medium with two acoustic properties"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-medium-with-two-acoustic-properties#post-6039</link>
			<pubDate>Mon, 03 Jul 2017 16:56:39 +0000</pubDate>
			<dc:creator>Mohalmadi</dc:creator>
			<guid isPermaLink="false">6039@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Bradley .. Thank you for your response.&#60;/p&#62;
&#60;p&#62;What I did is creating a medium which has the following properties: c0, rho0, medium.alpha_coeff. Then I wanted to create another medium within it which has the following properties: scattering_c0, scattering_rho0, and scattering_alpha_coeff. By doing that I was able to change the properties of the cavity independently from the medium. Even changing the value of the smaller medium's (scatterer) attenuation doesn't seem to affect the final result.&#60;/p&#62;
&#60;p&#62;So basically when a sound signal travels from a medium with high attenuation (Brain) and passes through a medium with a lower attenuation (water) we should see a hyperechoic signal coming from the base of the water medium. From the simulation, I wasn't able to see that. &#60;/p&#62;
&#60;p&#62;So my question is, how can I change the value of the attenuation?&#60;/p&#62;
&#60;p&#62;Thank you
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Power law absorption coefficient units"</title>
			<link>http://www.k-wave.org/forum/topic/power-law-absorption-coefficient-units#post-6036</link>
			<pubDate>Sun, 02 Jul 2017 21:48:18 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6036@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi v3p,&#60;/p&#62;
&#60;p&#62;&#60;code&#62;medium.alpha_coeff&#60;/code&#62; can be defined as a matrix (see the heterogeneous medium examples included in the MATLAB help).&#60;/p&#62;
&#60;p&#62;To make your conversion:&#60;br /&#62;
- multiply by 8.686 to convert from Nepers to dB&#60;br /&#62;
- divide by 100 to convert from per m to per cm&#60;br /&#62;
- multiply by 1e12 to convert from per Hz^2 to per MHz^2&#60;/p&#62;
&#60;p&#62;This gives:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;medium.alpha_coeff = 0.26;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Remember to set &#60;code&#62;medium.alpha_power&#60;/code&#62; to 2.&#60;/p&#62;
&#60;p&#62;Brad
&#60;/p&#62;</description>
		</item>
		<item>
			<title>v3p on "Power law absorption coefficient units"</title>
			<link>http://www.k-wave.org/forum/topic/power-law-absorption-coefficient-units#post-6034</link>
			<pubDate>Sat, 01 Jul 2017 12:44:08 +0000</pubDate>
			<dc:creator>v3p</dc:creator>
			<guid isPermaLink="false">6034@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;In addition how can I change layer alpha coeff. if it should be a scalar? :/&#60;br /&#62;
I am trying to simulate layered medium with different alpha coedd.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>v3p on "Power law absorption coefficient units"</title>
			<link>http://www.k-wave.org/forum/topic/power-law-absorption-coefficient-units#post-6032</link>
			<pubDate>Fri, 30 Jun 2017 21:19:31 +0000</pubDate>
			<dc:creator>v3p</dc:creator>
			<guid isPermaLink="false">6032@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;How can I get the right values for medium.alpha_coeff and medium.alpha_power for:&#60;/p&#62;
&#60;p&#62;1) Glycerol, it article absorption equal to ~ 3000 10−15 neper m−1 Hz−2?&#60;br /&#62;
2) Any kind of foam or porous material!?&#60;/p&#62;
&#60;p&#62;Thank you
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Simulating medium with two acoustic properties"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-medium-with-two-acoustic-properties#post-6022</link>
			<pubDate>Thu, 29 Jun 2017 15:03:53 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">6022@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Moe,&#60;/p&#62;
&#60;p&#62;The field name for the attenuation is called &#60;code&#62;medium.alpha_coeff&#60;/code&#62; not &#60;code&#62;medium.attenuation&#60;/code&#62;, so it looks like you're not assigning the heterogeneous absorption value. You might also want to try a stronger attenuation contrast.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Mohalmadi on "Simulating medium with two acoustic properties"</title>
			<link>http://www.k-wave.org/forum/topic/simulating-medium-with-two-acoustic-properties#post-6017</link>
			<pubDate>Wed, 28 Jun 2017 04:04:52 +0000</pubDate>
			<dc:creator>Mohalmadi</dc:creator>
			<guid isPermaLink="false">6017@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello &#60;/p&#62;
&#60;p&#62;I'm trying to mimic some of the artifact associated with the intraoperative ultrasound system. basically, I created a medium that has homogeneous acoustic properties. and within the medium, I created a cavity that has different acoustic properties.&#60;br /&#62;
I started by changing the code of one of the examples (b-mode linear transducer), however, I couldn't change the attenuation coefficient of the cavity (Ball). So what I did is changing the matrix of the medium. I was able to change the attenuation value, but unfortunately, the B-mode image doesn't change when I change the value. It seems that it only depends on c0 (sound speed) and rho0 (density) but not attenuation. Can anyone explain to me how to do that?&#60;/p&#62;
&#60;p&#62;Thank you for your help&#60;br /&#62;
Moe&#60;/p&#62;
&#60;p&#62;My code is here if you want to check it:&#60;/p&#62;
&#60;p&#62;close all&#60;br /&#62;
clear all&#60;br /&#62;
clc&#60;/p&#62;
&#60;p&#62;% simulation settings&#60;br /&#62;
DATA_CAST       = 'single';     % set to 'single' or 'gpuArray-single' to speed up computations&#60;br /&#62;
RUN_SIMULATION  = true;         % set to false to reload previous results instead of running simulation&#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 = 5;            % Depth [grid points]&#60;br /&#62;
pml_y_size = 3;            % Width [grid points]&#60;br /&#62;
pml_z_size = 3;            % Length[grid points] &#60;/p&#62;
&#60;p&#62;% set total number of grid points not including the PML&#60;br /&#62;
Nx = 64 - 2*pml_x_size;   % [grid points]&#60;br /&#62;
Ny = 32 - 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 = 20e-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;% Calculations for plotting depth&#60;br /&#62;
N_whole_x = Nx + (2*pml_x_size);&#60;br /&#62;
Whole_x_cartesian = N_whole_x * dx;&#60;br /&#62;
Start_medium_depth = (Whole_x_cartesian-x)/2;&#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 = 1560;                  % Speed of sound in medium [m/s]&#60;br /&#62;
rho0 = 1046;                % Denisty of medium [kg/m^3]&#60;br /&#62;
medium.alpha_coeff = 0.60; 	% Attenuation coefficent of medium [dB/(MHz^y cm)]&#60;br /&#62;
medium.alpha_power = 1.35;  % Power law absorption exponent&#60;br /&#62;
medium.BonA = 6;            % Parameter of nonlinearity&#60;br /&#62;
medium.alpha_mode = 'no_dispersion';&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
t_end = (Nx*dx)*2.2/c0;     % Total simulation time default number is 2.2 however,&#60;br /&#62;
                            % when need more time to capture signal you&#60;br /&#62;
                            % nedd to increase it [s] &#60;/p&#62;
&#60;p&#62;kgrid.t_array = makeTime(kgrid, c0, [], t_end);&#60;/p&#62;
&#60;p&#62;%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&#60;br /&#62;
% DEFINE THE INPUT SIGNAL&#60;br /&#62;
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&#60;/p&#62;
&#60;p&#62;% The maximum frequency that can be represented on the spatial grid is the&#60;br /&#62;
% Nyquist limit of c_min/(2*dx) where dx is the grid spacing.&#60;br /&#62;
% When using higher frequencies in the simulation, decrease the grid spacing.&#60;/p&#62;
&#60;p&#62;source_strength = 1e6;   % Intensity of source [Pa]&#60;br /&#62;
tone_burst_freq = 0.4e6; % Signal frequesncy [Hz]&#60;br /&#62;
tone_burst_cycles = 4;   % Number of cycles [#]&#60;/p&#62;
&#60;p&#62;% create the input signal using toneBurst % &#38;lt;becomes our ultrasound pulse&#38;gt;&#60;br /&#62;
input_signal = toneBurst(1/kgrid.dt, tone_burst_freq, tone_burst_cycles,'Envelope','Rectangular');&#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;
% DEFINE THE ULTRASOUND TRANSDUCER&#60;br /&#62;
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&#60;/p&#62;
&#60;p&#62;% physical properties of the transducer&#60;br /&#62;
transducer.number_elements = 8;  	% Total number of transducer elements&#60;br /&#62;
transducer.element_width = 2;       % Width of each element [grid points]&#60;br /&#62;
transducer.element_length = 6;  	% 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;                % Speed of sound [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 = 'Rectangular'; % Apodization used on transmit&#60;br /&#62;
transducer.receive_apodization = 'Rectangular';  % Apodization used on receive&#60;/p&#62;
&#60;p&#62;% define the transducer elements that are currently active&#60;br /&#62;
number_active_elements = transducer.number_elements;&#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 = makeTransducer(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 THE MEDIUM PROPERTIES&#60;br /&#62;
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&#60;/p&#62;
&#60;p&#62;% define a large image size to move across&#60;br /&#62;
number_scan_lines = 30;&#60;br /&#62;
Nx_tot = Nx;&#60;br /&#62;
Ny_tot = Ny + number_scan_lines * transducer.element_width;&#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_std = 0.00;&#60;br /&#62;
background_map = background_map_mean + background_map_std*randn([Nx_tot, Ny_tot, Nz_tot]);&#60;/p&#62;
&#60;p&#62;% define a random distribution of scatterers for the highly scattering region&#60;/p&#62;
&#60;p&#62;scattering_map_bin = zeros(Nx_tot, Ny_tot, Nz_tot);&#60;/p&#62;
&#60;p&#62;% The position of the highly scattering object on the x-axis&#60;br /&#62;
x_min = round(Nx_tot/4);    % Starting point&#60;br /&#62;
x_center = round(Nx_tot/2); % Middle point&#60;br /&#62;
x_max = round(Nx_tot/2);% End point&#60;/p&#62;
&#60;p&#62;% The position of the highly scattering object on the y-axis&#60;br /&#62;
y_min = round(Ny_tot/4);    % Starting point&#60;br /&#62;
y_center = round(Ny_tot/2); % Middle point&#60;br /&#62;
y_max = round(Ny_tot/2);% End point&#60;/p&#62;
&#60;p&#62;% The position of the highly scattering object on the z-axis&#60;br /&#62;
z_min = round(Nz_tot/8);    % Starting point&#60;br /&#62;
z_center = round(Nz_tot/4); % Middle point&#60;br /&#62;
z_max = round(Nz_tot/4);% End point&#60;/p&#62;
&#60;p&#62;for k = z_max:Nz_tot&#60;/p&#62;
&#60;p&#62; for i = x_center:x_max&#60;br /&#62;
    for j = y_center:y_max&#60;br /&#62;
            scattering_map_bin(i,j,k) = 1;&#60;br /&#62;
    end&#60;br /&#62;
 end &#60;/p&#62;
&#60;p&#62; for i = x_min:x_center&#60;br /&#62;
    for j = y_min:y_center&#60;br /&#62;
            scattering_map_bin(i,j,k) = 1;&#60;br /&#62;
    end&#60;br /&#62;
 end &#60;/p&#62;
&#60;p&#62; for i = x_center:x_max&#60;br /&#62;
    for j = y_min:y_center&#60;br /&#62;
            scattering_map_bin(i,j,k) = 1;&#60;br /&#62;
    end&#60;br /&#62;
 end &#60;/p&#62;
&#60;p&#62; for i = x_min:x_center&#60;br /&#62;
    for j = y_center:y_max&#60;br /&#62;
            scattering_map_bin(i,j,k) = 1;&#60;br /&#62;
    end&#60;br /&#62;
 end &#60;/p&#62;
&#60;p&#62;end&#60;/p&#62;
&#60;p&#62;transducer_bin = zeros(Nx_tot, Ny_tot, Nz_tot);&#60;br /&#62;
  for i = transducer.position(1);&#60;br /&#62;
    for j = transducer.position(2):transducer.position(2)+transducer_width&#60;br /&#62;
        for k = transducer.position(3):transducer.position(3)+ transducer.element_length&#60;br /&#62;
        transducer_bin(i,j,k) = 1;&#60;br /&#62;
        end&#60;br /&#62;
    end&#60;br /&#62;
  end&#60;/p&#62;
&#60;p&#62;% Define the properties of the highly scatterer object (Water)&#60;br /&#62;
scattering_c0 = 1450 *scattering_map_bin;            % Speed of sound in medium [m/s]&#60;br /&#62;
scattering_rho0 = 993 *scattering_map_bin;    % Denisty of medium [kg/m^3]&#60;br /&#62;
scattering_alpha_coeff = 1 *scattering_map_bin;  % Attenuation coefficent of medium [dB/(MHz^y cm)]&#60;/p&#62;
&#60;p&#62;% Define properties&#60;br /&#62;
sound_speed_map = c0 *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;
attenuation_map= medium.alpha_coeff *ones(Nx_tot, Ny_tot, Nz_tot).*background_map;&#60;/p&#62;
&#60;p&#62;% Assign region&#60;br /&#62;
sound_speed_map(scattering_map_bin == 1) = scattering_c0(scattering_map_bin == 1);&#60;br /&#62;
density_map(scattering_map_bin == 1) = scattering_rho0(scattering_map_bin == 1);&#60;br /&#62;
attenuation_map(scattering_map_bin == 1) = scattering_alpha_coeff(scattering_map_bin == 1);&#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(number_scan_lines, kgrid.Nt);&#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;
    'DataCast', DATA_CAST, 'DataRecast', true, 'PlotSim', false};&#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;    % set medium position&#60;br /&#62;
    medium_position = 1;&#60;/p&#62;
&#60;p&#62;    for scan_line_index = 1:number_scan_lines&#60;/p&#62;
&#60;p&#62;        % update the command line status&#60;br /&#62;
        disp('');&#60;br /&#62;
        disp(['Computing scan line ' num2str(scan_line_index) ' of ' num2str(number_scan_lines)]);&#60;/p&#62;
&#60;p&#62;        % load the current section of the medium&#60;br /&#62;
        medium.sound_speed = sound_speed_map(:, medium_position:medium_position + Ny - 1, :);&#60;br /&#62;
        medium.density = density_map(:, medium_position:medium_position + Ny - 1, :);&#60;br /&#62;
        medium.attenuation = attenuation_map(:, medium_position:medium_position + Ny - 1, :);&#60;/p&#62;
&#60;p&#62;        % run the simulation&#60;br /&#62;
        sensor_data = kspaceFirstOrder3D(kgrid, medium, transducer, transducer, input_args{:});&#60;/p&#62;
&#60;p&#62;        % extract the scan line from the sensor data&#60;br /&#62;
        scan_lines(scan_line_index, :) = transducer.scan_line(sensor_data);&#60;/p&#62;
&#60;p&#62;        % update medium position&#60;br /&#62;
        medium_position = medium_position + transducer.element_width;&#60;/p&#62;
&#60;p&#62;    end&#60;/p&#62;
&#60;p&#62;    % save the scan lines to disk&#60;br /&#62;
    save example_us_bmode_scan_lines scan_lines;&#60;br /&#62;
else&#60;br /&#62;
    % load the scan lines from disk&#60;br /&#62;
    load example_us_bmode_scan_lines&#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;% 1) Remove Input Signal&#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(end/2, :);&#60;/p&#62;
&#60;p&#62;% 2) Time Gain Compensation&#60;/p&#62;
&#60;p&#62;% create radius variable assuming that t0 corresponds to the middle of the 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;%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&#60;br /&#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.4;       % [dB/(MHz cm)]&#60;br /&#62;
tgc = exp(2*tgc_alpha*tone_burst_freq/1e6*r*100);&#60;br /&#62;
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&#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;/p&#62;
&#60;p&#62;% 3) Frequency Filtering&#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;
&#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(3, :) = scan_lines_fund(end/2, :);&#60;/p&#62;
&#60;p&#62;% 4) Envelope Detection&#60;/p&#62;
&#60;p&#62;% envelope detection&#60;br /&#62;
scan_lines_fund = envelopeDetection(scan_lines_fund);&#60;br /&#62;
scan_lines_harm = envelopeDetection(scan_lines_harm);&#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(4, :) = scan_lines_fund(end/2, :);&#60;/p&#62;
&#60;p&#62;% 5) Log Compression&#60;/p&#62;
&#60;p&#62;% normalised log compression&#60;br /&#62;
compression_ratio = 3;&#60;br /&#62;
scan_lines_fund = logCompression(scan_lines_fund, compression_ratio, true);&#60;br /&#62;
scan_lines_harm = logCompression(scan_lines_harm, compression_ratio, true);&#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(5, :) = scan_lines_fund(end/2, :);&#60;/p&#62;
&#60;p&#62;% 6) Scan Conversion&#60;/p&#62;
&#60;p&#62;% upsample the image using linear interpolation&#60;br /&#62;
scale_factor = 2;&#60;br /&#62;
scan_lines_fund = interp2(1:kgrid.Nt, (1:number_scan_lines).', scan_lines_fund, 1:kgrid.Nt, (1:1/scale_factor:number_scan_lines).');&#60;br /&#62;
scan_lines_harm = interp2(1:kgrid.Nt, (1:number_scan_lines).', scan_lines_harm, 1:kgrid.Nt, (1:1/scale_factor:number_scan_lines).');&#60;/p&#62;
&#60;p&#62;%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&#60;br /&#62;
% VISUALISATION&#60;br /&#62;
%+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++&#60;/p&#62;
&#60;p&#62;% 1) Plotting the transducer:&#60;br /&#62;
transducer.plot&#60;br /&#62;
title('Schematic Of The Transducer');&#60;br /&#62;
xlabel('x-dimension (voxel)');&#60;br /&#62;
ylabel('y-dimension (voxel)');&#60;br /&#62;
zlabel('z-dimension (voxel)');&#60;/p&#62;
&#60;p&#62;% Plotting the input signal&#60;br /&#62;
figure;&#60;br /&#62;
plot (input_signal)&#60;br /&#62;
title('Input Signal (MHz)');&#60;br /&#62;
xlabel('Time');&#60;br /&#62;
ylabel('Amplitude');&#60;/p&#62;
&#60;p&#62;% Plottung the highly scattering object&#60;br /&#62;
voxelPlot(single(scattering_map_bin))&#60;br /&#62;
title('Schematic Of The Highly Scattering Object');&#60;br /&#62;
xlabel('x-dimension (voxel)');&#60;br /&#62;
ylabel('y-dimension (voxel)');&#60;br /&#62;
zlabel('z-dimension (voxel)');&#60;/p&#62;
&#60;p&#62;% Plotting transducer and scattering object&#60;br /&#62;
voxelPlot(single(scattering_map_bin &#124; transducer_bin));&#60;br /&#62;
title('Schematic Of The Highly Scattering Object And The Transducer');&#60;br /&#62;
xlabel('x-dimension (voxel)');&#60;br /&#62;
ylabel('y-dimension (voxel)');&#60;br /&#62;
zlabel('z-dimension (voxel)');&#60;br /&#62;
colormap(gray);&#60;/p&#62;
&#60;p&#62;% Extracting a single scan line from the sensor data using the current beamforming settings&#60;br /&#62;
scan_line = transducer.scan_line(sensor_data);&#60;br /&#62;
figure;&#60;br /&#62;
plot (scan_line)&#60;br /&#62;
title('Received Signal');&#60;br /&#62;
xlabel('Time');&#60;br /&#62;
ylabel('Amplitude');&#60;/p&#62;
&#60;p&#62;% Plotting the sound speed map&#60;br /&#62;
figure;&#60;br /&#62;
imagesc((0:number_scan_lines*transducer.element_width-1)*dy*1e3, (0:Nx_tot-1)*dx*1e3, sound_speed_map(:, 1 + Ny/2:end - Ny/2, Nz/2));&#60;br /&#62;
axis image;&#60;br /&#62;
colormap(gray);&#60;br /&#62;
set(gca, 'YLim', [0, 8]);&#60;br /&#62;
title('The Sound Speed Map');&#60;br /&#62;
xlabel('Horizontal Position [mm]');&#60;br /&#62;
ylabel('Depth [mm]');&#60;br /&#62;
colorbar;&#60;/p&#62;
&#60;p&#62;% Plotting the density map&#60;br /&#62;
figure;&#60;br /&#62;
imagesc((0:number_scan_lines*transducer.element_width-1)*dy*1e3, (0:Nx_tot-1)*dx*1e3, density_map(:, 1 + Ny/2:end - Ny/2, Nz/2));&#60;br /&#62;
axis image;&#60;br /&#62;
colormap(gray);&#60;br /&#62;
set(gca, 'YLim', [0, 8]);&#60;br /&#62;
title('The Density Map');&#60;br /&#62;
xlabel('Horizontal Position [mm]');&#60;br /&#62;
ylabel('Depth [mm]');&#60;br /&#62;
colorbar;&#60;/p&#62;
&#60;p&#62;% Plotting the attenuation map&#60;br /&#62;
figure;&#60;br /&#62;
imagesc((0:number_scan_lines*transducer.element_width-1)*dy*1e3, (0:Nx_tot-1)*dx*1e3, attenuation_map(:, 1 + Ny/2:end - Ny/2, Nz/2));&#60;br /&#62;
axis image;&#60;br /&#62;
colormap(gray);&#60;br /&#62;
set(gca, 'YLim', [0, 8]);&#60;br /&#62;
title('The Attenuation Map');&#60;br /&#62;
xlabel('Horizontal Position [mm]');&#60;br /&#62;
ylabel('Depth [mm]');&#60;br /&#62;
colorbar;&#60;/p&#62;
&#60;p&#62;% Plotting the processed b-mode ultrasound image&#60;br /&#62;
figure;&#60;br /&#62;
horz_axis = (0:length(scan_lines_fund(:, 1))-1)*transducer.element_width*dy/scale_factor*1e3;&#60;br /&#62;
imagesc(horz_axis, r*1e3, scan_lines_fund.');&#60;br /&#62;
axis image;&#60;br /&#62;
colormap(gray);&#60;br /&#62;
set(gca, 'YLim', [0, 8]);&#60;br /&#62;
title('The B-mode Image');&#60;br /&#62;
xlabel('Horizontal Position [mm]');&#60;br /&#62;
ylabel('Depth [mm]');&#60;br /&#62;
colorbar;&#60;/p&#62;
&#60;p&#62;% plot the processed harmonic ultrasound image&#60;br /&#62;
figure;&#60;br /&#62;
imagesc(horz_axis, r*1e3, scan_lines_harm.');&#60;br /&#62;
axis image;&#60;br /&#62;
colormap(gray);&#60;br /&#62;
set(gca, 'YLim', [0, 8]);&#60;br /&#62;
title('The Harmonic Image');&#60;br /&#62;
xlabel('Horizontal Position [mm]');&#60;br /&#62;
ylabel('Depth [mm]');&#60;br /&#62;
colorbar;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>NikiKeyz on "Power law absorption coefficient units"</title>
			<link>http://www.k-wave.org/forum/topic/power-law-absorption-coefficient-units#post-5839</link>
			<pubDate>Tue, 21 Feb 2017 22:44:41 +0000</pubDate>
			<dc:creator>NikiKeyz</dc:creator>
			<guid isPermaLink="false">5839@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi!&#60;br /&#62;
It seems to be a mistake here.&#60;br /&#62;
dB/km/kHz^y = 1e-5 dB/cm/kHz^y = 1e-5 dB/cm/(1e-3 MHz)^y&#60;br /&#62;
y = 1.4484&#60;br /&#62;
(1e-3)^1.4484 = 4.5165e-5&#60;br /&#62;
So 5.3273*x^1.4484 dB/km/kHz^y = 1.1795*x^1.4484 dB/cm/MHz^y
&#60;/p&#62;</description>
		</item>
		<item>
			<title>PiesangBrood2000 on "Power law absorption coefficient units"</title>
			<link>http://www.k-wave.org/forum/topic/power-law-absorption-coefficient-units#post-4681</link>
			<pubDate>Tue, 19 Aug 2014 12:14:27 +0000</pubDate>
			<dc:creator>PiesangBrood2000</dc:creator>
			<guid isPermaLink="false">4681@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Bradley,&#60;/p&#62;
&#60;p&#62;That clears things up, thanks a lot!&#60;/p&#62;
&#60;p&#62;Kind regards,&#60;br /&#62;
PiesangBrood2000
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Power law absorption coefficient units"</title>
			<link>http://www.k-wave.org/forum/topic/power-law-absorption-coefficient-units#post-4678</link>
			<pubDate>Mon, 18 Aug 2014 17:21:47 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">4678@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi PiesangBrood2000,&#60;/p&#62;
&#60;p&#62;Yes you're correct - the units in k-Wave should be dB/cm/MHz^y. To convert from dB/km to dB/cm you need to multiply by 1e-4. The absorption in air in the audible frequency range is very low compared the absorption in tissue in the MHz range. Most of the examples in the toolbox use parameters relevant to ultrasound in tissue.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>PiesangBrood2000 on "Power law absorption coefficient units"</title>
			<link>http://www.k-wave.org/forum/topic/power-law-absorption-coefficient-units#post-4673</link>
			<pubDate>Thu, 14 Aug 2014 13:37:08 +0000</pubDate>
			<dc:creator>PiesangBrood2000</dc:creator>
			<guid isPermaLink="false">4673@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Also this value of 2.4X10^-7 for alpha_coeff seems very small, compared to the 0.75 used in the example problems. I assume the examples aren't for waves in air (sound speed of 1500 m/s) as well as being in the MHz range.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>PiesangBrood2000 on "Power law absorption coefficient units"</title>
			<link>http://www.k-wave.org/forum/topic/power-law-absorption-coefficient-units#post-4672</link>
			<pubDate>Thu, 14 Aug 2014 13:30:12 +0000</pubDate>
			<dc:creator>PiesangBrood2000</dc:creator>
			<guid isPermaLink="false">4672@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Ben,&#60;/p&#62;
&#60;p&#62;Thanks, that does help.&#60;br /&#62;
In the k-Wave manual it gives the units for alpha_coeff as [dB/(MHz^y cm)] not [dB/(MHz^y m)], is this correct? If so then it would only be necessary to multiply the 2.4X10^-7 by a factor of 0.01 right?&#60;/p&#62;
&#60;p&#62;Kind regards,&#60;br /&#62;
PiesangBrood2000
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bencox on "Power law absorption coefficient units"</title>
			<link>http://www.k-wave.org/forum/topic/power-law-absorption-coefficient-units#post-4671</link>
			<pubDate>Wed, 13 Aug 2014 20:50:46 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">4671@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi PiesangBrood2000,&#60;/p&#62;
&#60;p&#62;To convert from dB/km to dB/m requires multiplying the prefactor by 0.001. Then to convert from dB/m/kHz^y to dB/m/MHz^y requires multiplying the prefactor by a further 0.001^y. So to convert your 5.3273 dB/km/kHz^y to dB/m/MHz^y as required by k-Wave, you need to multiply by 0.001^(y+1). &#60;/p&#62;
&#60;p&#62;So 5.3273 dB/km/kHz^y = 5.3273*0.001^(y+1) dB/m/MHz^y = 2.4x10^-7 dB/m/MHz^y.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;br /&#62;
Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>PiesangBrood2000 on "Power law absorption coefficient units"</title>
			<link>http://www.k-wave.org/forum/topic/power-law-absorption-coefficient-units#post-4670</link>
			<pubDate>Tue, 12 Aug 2014 12:49:28 +0000</pubDate>
			<dc:creator>PiesangBrood2000</dc:creator>
			<guid isPermaLink="false">4670@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I'm struggling to get the right values for medium.alpha_coeff and medium.alpha_power. I'm working from the &#34;Attenuation of sound in air&#34; table from&#60;br /&#62;
&#60;a href=&#34;http://www.kayelaby.npl.co.uk/general_physics/2_4/2_4_1.html&#34; rel=&#34;nofollow&#34;&#62;http://www.kayelaby.npl.co.uk/general_physics/2_4/2_4_1.html&#60;/a&#62;.&#60;br /&#62;
From their data I got an approximate fitting formula of y=5.3273*x^1.4484 (for 50% humidity) where y is the attenuation coefficient in [dB/km] and x is the frequency in [kHz].&#60;br /&#62;
I assume since medium.alpha_coeff is measured in [dB/(MHz^y cm]) I cant use 5.3273 as is. Would 0.053273 be the correct value for medium.alpha_coeff in [dB/(MHz^y cm)]?&#60;/p&#62;
&#60;p&#62;Kind regards,&#60;br /&#62;
PiesangBrood2000
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
