<?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: Weird attenuation behaviour</title>
		<link>http://www.k-wave.org/forum/topic/weird-attenuation-behaviour</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 10:16:25 +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/weird-attenuation-behaviour" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Weird attenuation behaviour"</title>
			<link>http://www.k-wave.org/forum/topic/weird-attenuation-behaviour#post-5451</link>
			<pubDate>Tue, 05 Apr 2016 09:23:48 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5451@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Marvin,&#60;/p&#62;
&#60;p&#62;For a pressure source, you don't need to scale the source strength by the impedance. In your case, this reduces the source strength by ~1.5e6. Also, your sensor mask is too big for the grid (Nx is &#38;lt; 120 after you subtract the PML size). You could use something like:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;sensor.mask(10:10:Nx, 32, 32) = 1;&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Remember that your wave will also decay due to spherical spreading. In 3D, the pressure will decay with 1/r. If you ignore the frequency content of your pulse and just take the maximum of the wave amplitude at your sensor positions multiplied by the travel distance, you should get approximately the same number.&#60;/p&#62;
&#60;p&#62;I'm not sure I follow your final question about the shorter wavelengths travelling further - could you elaborate a bit more on how you calculate this?&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mavheart on "Weird attenuation behaviour"</title>
			<link>http://www.k-wave.org/forum/topic/weird-attenuation-behaviour#post-5438</link>
			<pubDate>Mon, 28 Mar 2016 13:52:01 +0000</pubDate>
			<dc:creator>mavheart</dc:creator>
			<guid isPermaLink="false">5438@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi everyone,&#60;/p&#62;
&#60;p&#62;I'm using k-wave to simulate the propagation of sound in water. In a first test I tried to measure the attenuation length.&#60;/p&#62;
&#60;p&#62;I've built a very simple setup:&#60;/p&#62;
&#60;p&#62;Nx = 128&#60;br /&#62;
Ny = 64&#60;br /&#62;
Nz = 64&#60;/p&#62;
&#60;p&#62;Then I placed one source voxel in (1, 32, 32) and 11 sensor voxels in (10:10:120, 32, 32)&#60;/p&#62;
&#60;p&#62;The result confused me, as I measured 10e-5 Pa even though my source strength was to be 10e6 Pa. (After including the acoustic impedance, it was still ~ 10e-1)&#60;/p&#62;
&#60;p&#62;What happened to the sound, why is it that weak? Also shorter wavelengths appear to travel farther in my piece of code. This should definitely be the other way around, shouldn't it?&#60;/p&#62;
&#60;p&#62;Here is my code, thank you for your help!&#60;/p&#62;
&#60;p&#62;Marvin Willam&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;clear all;

DATA_CAST = &#38;#39;single&#38;#39;;       % set to &#38;#39;single&#38;#39; or &#38;#39;gpuArray-single&#38;#39; to speed up computations
MASK_PLANE = &#38;#39;xy&#38;#39;;          % set to &#38;#39;xy&#38;#39; or &#38;#39;xz&#38;#39; to generate the beam pattern in different planes
USE_STATISTICS = true;      % set to true to compute the rms or peak beam patterns, set to false to compute the harmonic beam patterns

% =========================================================================
% DEFINE THE K-WAVE GRID
% =========================================================================

% set the size of the perfectly matched layer (PML)
PML_X_SIZE = 20;            % [grid points]
PML_Y_SIZE = 10;            % [grid points]
PML_Z_SIZE = 10;            % [grid points]

% set total number of grid points not including the PML
Nx = 128 - 2*PML_X_SIZE;    % [grid points]
Ny = 64 - 2*PML_Y_SIZE;     % [grid points]
Nz = 64 - 2*PML_Z_SIZE;     % [grid points]

% set desired grid size in the x-direction not including the PML
x = 40e-3;                  % [m]

% calculate the spacing between the grid points
dx = x/Nx;                  % [m]
dy = dx;                    % [m]
dz = dx;                    % [m]

% create the k-space grid
kgrid = makeGrid(Nx, dx, Ny, dy, Nz, dz);

% =========================================================================
% DEFINE THE MEDIUM PARAMETERS
% =========================================================================

% define the properties of the propagation medium
medium.sound_speed = 1540;      % [m/s]
medium.density = 1000;          % [kg/m^3]
medium.alpha_coeff = 0.75;      % [dB/(MHz^y cm)]
medium.alpha_power = 1.5;
medium.BonA = 6;

% create the time array
t_end = 6e-4;                  % [s]
kgrid.t_array = makeTime(kgrid, medium.sound_speed, [], t_end);

% =========================================================================
% DEFINE THE INPUT SIGNAL
% =========================================================================

% define properties of the input signal
source_strength = 1e6;          % [Pa]
tone_burst_freq = 16e3;    	% [Hz]
tone_burst_cycles = 5;

if dx &#38;gt; medium.sound_speed/(2*tone_burst_freq)

	fprintf(&#38;#39;Warning, grid too coarse for this frequency! \n dx = %dm, must be less than %dm. \n \n&#38;#39;, dx, medium.sound_speed/(2*tone_burst_freq));

end

% create the input signal using toneBurst
input_signal = toneBurst(1/kgrid.dt, tone_burst_freq, tone_burst_cycles);

figure
plot(input_signal)

% scale the source magnitude by the source_strength divided by the
% impedance (the source is assigned to the particle velocity)
input_signal = (source_strength./(medium.sound_speed*medium.density)).*input_signal;

figure
plot(input_signal)

sensor.mask = zeros(Nx, Ny, Nz);

sensor.mask(10:10:120, 32, 32) = 1;

source.p_mask = zeros(Nx, Ny, Nz);

source.p_mask(1, 32, 32) = 1;

source.p = input_signal;

input_args = {&#38;#39;DisplayMask&#38;#39;, source.p_mask, ...
    &#38;#39;PMLInside&#38;#39;, false, &#38;#39;PlotPML&#38;#39;, true, &#38;#39;PMLSize&#38;#39;, [PML_X_SIZE, PML_Y_SIZE, PML_Z_SIZE], ...
    &#38;#39;DataCast&#38;#39;, DATA_CAST, &#38;#39;DataRecast&#38;#39;, true, &#38;#39;PlotSim&#38;#39;, false};

sensor_data = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
