<?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: Increasing envelope of signal at sensor point</title>
		<link>http://www.k-wave.org/forum/topic/increasing-envelope-of-signal-at-sensor-point</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 11:33: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/increasing-envelope-of-signal-at-sensor-point" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Increasing envelope of signal at sensor point"</title>
			<link>http://www.k-wave.org/forum/topic/increasing-envelope-of-signal-at-sensor-point#post-5584</link>
			<pubDate>Thu, 07 Jul 2016 13:58:45 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5584@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Angad,&#60;/p&#62;
&#60;p&#62;Ah apologies, indeed, you're correct. For some reason I had it in my mind that you had the sensor mask set to the whole domain, not a single line. Glad you've got it to work.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>asrekhi on "Increasing envelope of signal at sensor point"</title>
			<link>http://www.k-wave.org/forum/topic/increasing-envelope-of-signal-at-sensor-point#post-5582</link>
			<pubDate>Wed, 06 Jul 2016 18:26:52 +0000</pubDate>
			<dc:creator>asrekhi</dc:creator>
			<guid isPermaLink="false">5582@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;/p&#62;
&#60;p&#62;Thanks for your insight - the paper you linked to is quite informative. I'll have to take that into account in future simulations. For the time being, setting the CFL number to 0.1 keeps the simulation stable.&#60;/p&#62;
&#60;p&#62;I do maintain that the point I'm looking at is outside the PML. Each field in the struct &#34;sensor_data&#34; is of size (# sensor points, # time steps). So plotting sensor_data.p(60,:), for example, plots the pressure over time at the 60th sensor point, not the 60th column-indexed point of the whole grid space, correct? One thing I've done to check this is to find the peak pressure at each sensor point and plot that versus x-axis position (since my sensor points run along the x-axis). I've found that the pressure pattern thus found is qualitatively what I would expect from an array of point sources at x = 40, as coded in the script above. Let me know if I'm missing anything here.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Angad
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Increasing envelope of signal at sensor point"</title>
			<link>http://www.k-wave.org/forum/topic/increasing-envelope-of-signal-at-sensor-point#post-5579</link>
			<pubDate>Wed, 06 Jul 2016 08:15:14 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5579@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Angad,&#60;/p&#62;
&#60;p&#62;When you include absorption and nonlinearity, the stability is not so straight forward to predict. The function &#60;code&#62;checkStability&#60;/code&#62; will give an accurate estimate for the homogeneous absorbing case, but not for the nonlinear case. If the code is unstable, you will notice this as an eventual blow-up (to infinity) of the pressure values within the domain, which sounds a bit like what you're seeing. Even if the code is stable, using a smaller CFL will increase the accuracy with which the absorption and nonlinearity are encoded. &#60;/p&#62;
&#60;p&#62;Again, I haven't run your code, but I still suspect the plotted point is within the PML. For a binary sensor mask, the sensor data is returned using MATLAB's column-wise linear matrix index ordering, where &#60;code&#62;sensor_data&#60;/code&#62; is indexed as &#60;code&#62;(sensor_point_index, time_index)&#60;/code&#62;. This means point 60 will still be within the first column of the domain, which will be within the PML. Something to double check in any case.&#60;/p&#62;
&#60;p&#62;Another PML related issue to keep in mind is that the PML doesn't work very well at less than ~3 PPW (see &#60;a href=&#34;http://www.k-wave.org/papers/2014-Robertson-IEEEIUS.pdf&#34;&#62;here&#60;/a&#62;). Thus depending on the strength of the nonlinearity, if you are generating significant energy close to the Nyquist limit, this might manifest as an increase in the signal within the PML as the simulation progresses.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>asrekhi on "Increasing envelope of signal at sensor point"</title>
			<link>http://www.k-wave.org/forum/topic/increasing-envelope-of-signal-at-sensor-point#post-5577</link>
			<pubDate>Wed, 06 Jul 2016 01:53:43 +0000</pubDate>
			<dc:creator>asrekhi</dc:creator>
			<guid isPermaLink="false">5577@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;/p&#62;
&#60;p&#62;The behavior does not seem to occur for a linear simulation (with or without absorption); it's only apparent when nonlinearity is included. I agree that part of the sensor mask is in the PML, but this does not affect the simulation at all, and the point whose pressure I'm plotting is not in the PML (the PML is only 10 grid points thick, and I'm plotting the pressure at a point 60 grid points away from one face of the simulation boundary).&#60;/p&#62;
&#60;p&#62;I've played around with the simulation settings in the time since my first post and found that decreasing the CFL number seems to fix the problem. For example, decreasing it from its default of 0.3 to 0.2 changed the %delta(peak pressure) at the same sensor point (point 60) from 16% to 7% over the length of the simulation, and decreasing it further to 0.1 made the sensor point pressure amplitude constant within the precision of the simulation. Does this mean that it's an issue related to the stability of the simulation? If so, can I fix it without having to cut the CFL from 0.3 to 0.1 (which extends my sim time by a factor of 3)?&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Angad
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Increasing envelope of signal at sensor point"</title>
			<link>http://www.k-wave.org/forum/topic/increasing-envelope-of-signal-at-sensor-point#post-5565</link>
			<pubDate>Mon, 04 Jul 2016 17:31:38 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">5565@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi asrekhi,&#60;/p&#62;
&#60;p&#62;I haven't run your code, but the obvious things seem ok. Two things to check. First, if you turn off absorption and nonlinearity, do you see the same behaviour? (The code is exact in this case). Second, your sensor mask also includes the PML. This means that &#60;code&#62;sensor_data_C.p(60,:)&#60;/code&#62; will be recorded within the PML. If you exclude the PML from the sensor mask (or plot other points not in the PML), do you see the same behaviour?&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>asrekhi on "Increasing envelope of signal at sensor point"</title>
			<link>http://www.k-wave.org/forum/topic/increasing-envelope-of-signal-at-sensor-point#post-5556</link>
			<pubDate>Fri, 01 Jul 2016 21:15:57 +0000</pubDate>
			<dc:creator>asrekhi</dc:creator>
			<guid isPermaLink="false">5556@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I am running a series of simulations in which I have an array of pressure sources (all driven at the same amplitude and phase), with sensor points along the axis of the array. The entire simulation medium is air, with attenuation and nonlinearity included. The amplitude/envelope of the signal that is input to each pressure source is constant over time.&#60;/p&#62;
&#60;p&#62;For a &#34;small&#34; grid size (320x320x128), the pressure at the sensor points is more or less what I expect. However, when I increase the grid size in the axial direction (320x320x1024), I find that the amplitude/envelope of the pressure at the sensor points increases with time, even though I've changed nothing else about the simulation. &#60;/p&#62;
&#60;p&#62;I'm not sure what the reason for this might be - is this a symptom of some numerical instability? I don't see how this can be physical, but if it is, why does it only show up when I increase the grid size in the axial direction?&#60;/p&#62;
&#60;p&#62;I've included the code below for reference. Thanks in advance for your help.&#60;/p&#62;
&#60;p&#62;%%%%%%%% Setup %%%%%%%%&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
Nx = 1024;          % number of grid points in the x direction&#60;br /&#62;
Ny = 320;           % number of grid points in the y direction&#60;br /&#62;
Nz = 320;           % number of grid points in the z direction&#60;br /&#62;
dx = 0.85e-3;       % grid point spacing in the x direction [m]&#60;br /&#62;
dy = 0.85e-3;       % grid point spacing in the y direction [m]&#60;br /&#62;
dz = 0.85e-3;       % grid point spacing in the z direction [m]&#60;br /&#62;
kgrid = makeGrid(Nx, dx, Ny, dy, Nz, dz);&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
clear('medium');&#60;br /&#62;
medium.sound_speed = 343;               % [m/s]&#60;br /&#62;
medium.density = 1.225;                 % [kg/m^3]&#60;br /&#62;
medium.alpha_coeff = 0.8;               % [dB/(MHz^y cm)]&#60;br /&#62;
medium.alpha_power = 1.33;              % [y in fmla above]&#60;br /&#62;
medium.BonA = 0.4;                      % equal to (gamma - 1) for gases&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
[kgrid.t_array, dt] = makeTime(kgrid, medium.sound_speed);&#60;/p&#62;
&#60;p&#62;% define a square source element&#60;br /&#62;
source_width = 60;                     % [# of grid points]&#60;br /&#62;
source.p_mask = zeros(Nx, Ny, Nz);&#60;br /&#62;
source_x = 40;&#60;br /&#62;
source_y1 = 2*round(0.5*(Ny/2 - source_width/2 + 1));&#60;br /&#62;
source_y2 = 2*round(0.5*(Ny/2 + source_width/2));&#60;br /&#62;
source_z1 = 2*round(0.5*(Nz/2 - source_width/2 + 1));&#60;br /&#62;
source_z2 = 2*round(0.5*(Nz/2 + source_width/2));&#60;br /&#62;
for y = source_y1:4:source_y2&#60;br /&#62;
    for z = source_z1:4:source_z2&#60;br /&#62;
        source.p_mask(source_x,y,z) = 1;&#60;br /&#62;
    end&#60;br /&#62;
end&#60;/p&#62;
&#60;p&#62;% define the sensor mask&#60;br /&#62;
sensor.mask = zeros(Nx, Ny, Nz);&#60;br /&#62;
sensor.mask(:, Ny/2, Nz/2) = 1;&#60;/p&#62;
&#60;p&#62;% define a time-varying sinusoidal source&#60;br /&#62;
source_freq = 51.5e3;                   % [Hz]&#60;br /&#62;
source_mag = 3168;                      % [Pa]&#60;br /&#62;
source.p = source_mag*sin(2*pi*source_freq*kgrid.t_array);&#60;/p&#62;
&#60;p&#62;% smooth the source to avoid aliasing&#60;br /&#62;
source.p = filterTimeSeries(kgrid, medium, source.p,'ZeroPhase',true);&#60;/p&#62;
&#60;p&#62;% enforce input pressure rather than adding it to the existing pressure&#60;br /&#62;
source.p_mode = 'additive';&#60;/p&#62;
&#60;p&#62;% define the field parameters to record&#60;br /&#62;
sensor.record = {'p', 'u'};&#60;/p&#62;
&#60;p&#62;% input arguments&#60;br /&#62;
input_args = {'DisplayMask', source.p_mask, 'DataCast', 'single', ...&#60;br /&#62;
    'CartInterp', 'nearest', 'Smooth', false, 'PMLSize', 10, ...&#60;br /&#62;
    'PMLAlpha', 2};&#60;/p&#62;
&#60;p&#62;fprintf('\nSimulation parameters created.\n');&#60;/p&#62;
&#60;p&#62;% view the source element and sensor mask&#60;br /&#62;
% voxelPlot( single( source.p_mask &#124; sensor.mask ) );&#60;/p&#62;
&#60;p&#62;%%%%%%%% Run %%%%%%%%&#60;/p&#62;
&#60;p&#62;% Run directly in MATLAB&#60;br /&#62;
% sensor_data = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;% Save input files to disk to be run with compiled C++ code&#60;br /&#62;
sensor_data = kspaceFirstOrder3D(kgrid, medium, source, sensor, ...&#60;br /&#62;
   input_args{:}, 'SaveToDisk', '5x5_nonlinear_prop_input.h5');&#60;br /&#62;
fprintf('\nData saved to HDF file.\n');&#60;/p&#62;
&#60;p&#62;%%%%%%%% Load results %%%%%%%%&#60;/p&#62;
&#60;p&#62;sensor_data_C.p = h5read('5x5_nonlinear_prop_output.h5', '/p');&#60;br /&#62;
sensor_data_C.ux = h5read('5x5_nonlinear_prop_output.h5', '/ux');&#60;br /&#62;
sensor_data_C.uy = h5read('5x5_nonlinear_prop_output.h5', '/uy');&#60;br /&#62;
sensor_data_C.uz = h5read('5x5_nonlinear_prop_output.h5', '/uz');&#60;br /&#62;
fprintf('\nData read from HDF file.\n');&#60;br /&#62;
fprintf('\nTime vector has %d entries.\n',size(sensor_data_C.p,2));&#60;br /&#62;
x = 0:(Nx-1);&#60;br /&#62;
x = x - source_x;&#60;br /&#62;
x = dx*x;&#60;/p&#62;
&#60;p&#62;%%%%%%%% Visualize transient results %%%%%%%%&#60;/p&#62;
&#60;p&#62;% pressure vs time at specific positions&#60;br /&#62;
figure&#60;br /&#62;
plot(sensor_data_C.p(60,:),'k');
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
