<?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: Additional information</title>
		<link>http://www.k-wave.org/forum/topic/additional-information</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:32:29 +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/additional-information" rel="self" type="application/rss+xml" />

		<item>
			<title>bencox on "Additional information"</title>
			<link>http://www.k-wave.org/forum/topic/additional-information#post-497</link>
			<pubDate>Tue, 08 May 2012 11:21:56 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">497@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Hussain,&#60;/p&#62;
&#60;p&#62;By setting the option &#60;code&#62;&#38;#39;PlotScale&#38;#39;&#60;/code&#62; to &#60;code&#62;&#38;#39;auto&#38;#39;&#60;/code&#62; in &#60;code&#62;kspaceFirstOrder3D&#60;/code&#62; it will scale the colormap on the images. However, I think your problem might be more fundamental. The code was designed for propagation in soft biological tissue where the material properties vary by at most 10%, and for the model to cope with much greater step changes in material properties it will probably be necessary to increase the number of points per minimum wavelength in your simulation (i.e. reduce dx, dy, dz). In 3D this will probably lead to a simulation that is very large computationally. So perhaps my original idea of putting a solid backing onto the detector was not so viable. &#60;/p&#62;
&#60;p&#62;Sorry not to be more help this time.&#60;/p&#62;
&#60;p&#62;Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Hussain on "Additional information"</title>
			<link>http://www.k-wave.org/forum/topic/additional-information#post-492</link>
			<pubDate>Wed, 02 May 2012 17:53:54 +0000</pubDate>
			<dc:creator>Hussain</dc:creator>
			<guid isPermaLink="false">492@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello Ben,&#60;/p&#62;
&#60;p&#62;I have also included my full code for your reference. Initially i start when the source is in focus and then i start moving the source away from the detector and observe the changes.&#60;br /&#62;
 Could you please help me out with the issues i have indicated in my previous post??&#60;/p&#62;
&#60;p&#62;Nx=100; % Number of points in the grid along x-direction&#60;br /&#62;
Ny=100;&#60;br /&#62;
Nz=100;&#60;br /&#62;
dx=1e-3; % grid point spacing in x-direction&#60;br /&#62;
dy=dx;&#60;br /&#62;
dz=dx;&#60;br /&#62;
%properties of the medium&#60;br /&#62;
medium.sound_speed = 1500*ones(Nx, Ny,Nz); % speed of sound in water medium [m/s]&#60;br /&#62;
medium.sound_speed(:,1:12,:) = 343; % [m/s] speed of sound in air&#60;br /&#62;
medium.sound_speed(66:100,12:16,:) = 343;&#60;br /&#62;
medium.sound_speed(1:35,12:16,:) = 343;&#60;/p&#62;
&#60;p&#62;medium.density = 1000*ones(Nx, Ny,Nz);     % Density of water medium[kg/m^3]&#60;br /&#62;
medium.density(:,1:12,:) =1.225;     % [kg/m^3] density of air medium&#60;br /&#62;
medium.density(66:100,12:16,:) =1.225;&#60;br /&#62;
medium.density(1:35,12:16,:) =1.225;&#60;/p&#62;
&#60;p&#62;% computation settings&#60;br /&#62;
input_args = {'DataCast', 'single','PlotLayout',true,'PMLInside',false}; %% Speeds up the computation time&#60;/p&#62;
&#60;p&#62;% create the computational grid&#60;br /&#62;
kgrid = makeGrid(Nx, dx, Ny, dy, Nz, dz);&#60;/p&#62;
&#60;p&#62;% % create initial pressure distribution&#60;br /&#62;
source.p0=  zeros (Nx,Ny,Nz);&#60;br /&#62;
source.p0 (49:51, 49:51,49:51) = 1; %% Everytime change the position along x in order move the source from the detector.&#60;/p&#62;
&#60;p&#62;% % % % define a single sensor point&#60;br /&#62;
sphere_sz = 78;&#60;br /&#62;
sphere_radius = 38; %% Focal length of the transducer 38mm&#60;br /&#62;
sphere_height = 5.2; %% In order fix the width of the transducer (Dia of transducer is 25mm)&#60;br /&#62;
sphere = makeSphere(sphere_sz, sphere_sz, sphere_sz, sphere_radius);&#60;/p&#62;
&#60;p&#62;% % carve most of the sphere off then add it to a mask of the correct size&#60;br /&#62;
sphere(:,sphere_height:end,:) = 0;&#60;br /&#62;
sensor.mask = zeros(Nx, Ny, Nz); %% Defining the mask to detect the signal&#60;br /&#62;
sensor.mask(Nx/8:Nx/8+sphere_sz-1, Ny/8:Ny/8+sphere_sz-1, Nz/8:Nz/8+sphere_sz-1 ) = sphere;&#60;/p&#62;
&#60;p&#62;% run the simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder3D(kgrid, medium, source, sensor, input_args{:});&#60;/p&#62;
&#60;p&#62;% average the data recorded at each grid point to simulate the measured&#60;br /&#62;
% signal from a single element focussed detector. Gives the average value&#60;br /&#62;
% and directionality of signal15&#60;br /&#62;
sensor_data = sum(sensor_data, 1);&#60;/p&#62;
&#60;p&#62;% we define the time array in terms of the grid points&#60;br /&#62;
[kgrid.t_array, dt] = makeTime(kgrid, medium.sound_speed); %creates evenly spaced time array for simulation&#60;br /&#62;
Nt = length(kgrid.t_array);&#60;/p&#62;
&#60;p&#62;voxelPlot(sensor.mask+source.p0);&#60;br /&#62;
view([14,20]);&#60;/p&#62;
&#60;p&#62;figure;&#60;br /&#62;
[t_sc, t_scale, t_prefix] = scaleSI(kgrid.t_array(end));&#60;br /&#62;
plot(kgrid.t_array*t_scale, sensor_data, '-');&#60;br /&#62;
xlabel(['Time [' t_prefix 's]']);&#60;br /&#62;
ylabel('Recorded Pressure');&#60;br /&#62;
set(gca, 'XLim', [0 30]);&#60;br /&#62;
title('Signal');&#60;/p&#62;
&#60;p&#62;Thanks a lot,&#60;br /&#62;
Hussain
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Hussain on "Additional information"</title>
			<link>http://www.k-wave.org/forum/topic/additional-information#post-490</link>
			<pubDate>Wed, 02 May 2012 14:54:14 +0000</pubDate>
			<dc:creator>Hussain</dc:creator>
			<guid isPermaLink="false">490@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello Ben,&#60;/p&#62;
&#60;p&#62;In addition to my earlier post. I also found that the pressure signal value is valid upto certain time only and i get NAN. The plot time vs pressure looks like this.&#60;br /&#62;
&#60;a href=&#34;http://imageshack.us/photo/my-images/28/figureb.jpg/&#34; rel=&#34;nofollow&#34;&#62;http://imageshack.us/photo/my-images/28/figureb.jpg/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62; Can you tell me what could be reason for such error? &#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Hussain
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Hussain on "Additional information"</title>
			<link>http://www.k-wave.org/forum/topic/additional-information#post-484</link>
			<pubDate>Tue, 01 May 2012 14:33:56 +0000</pubDate>
			<dc:creator>Hussain</dc:creator>
			<guid isPermaLink="false">484@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello Ben,&#60;/p&#62;
&#60;p&#62;As you had suggested, i tried changing the medium on the backside of the detector to a higher density and speed of sound. I was getting much better signal output. I still have to modify for getting a better signal. In the meantime, when i was running the simulation in such a way that i define a specific density and sound along the shape of the detector.&#60;br /&#62;
I wrote a code something like this to define the density and speed.&#60;br /&#62;
 My Nx,Ny and Nz=100. &#60;/p&#62;
&#60;p&#62;%properties of the medium&#60;br /&#62;
medium.sound_speed = 1500*ones(Nx, Ny,Nz); % speed of sound in water medium [m/s]&#60;br /&#62;
medium.sound_speed(:,1:12,:) = 343;&#60;br /&#62;
medium.sound_speed(66:100,12:16,:) = 343;&#60;br /&#62;
medium.sound_speed(1:36,12:16,:) = 343;&#60;/p&#62;
&#60;p&#62;medium.density = 1000*ones(Nx, Ny,Nz);&#60;br /&#62;
medium.density(:,1:12,:) =1.225;&#60;br /&#62;
medium.density(66:100,12:16,:) =1.225;&#60;br /&#62;
medium.density(1:36,12:16,:) =1.225;&#60;/p&#62;
&#60;p&#62;While running the simulation, I am getting huge values of pressure of the order 10^30 and the plot sim figure looks like this:&#60;br /&#62;
&#60;a href=&#34;http://imageshack.us/photo/my-images/692/plotsim.jpg/&#34; rel=&#34;nofollow&#34;&#62;http://imageshack.us/photo/my-images/692/plotsim.jpg/&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;I am not sure if this is right or what could be the reason for these types of signals.&#60;br /&#62;
Thanks a lot for helping,&#60;br /&#62;
Hussain
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bencox on "Additional information"</title>
			<link>http://www.k-wave.org/forum/topic/additional-information#post-472</link>
			<pubDate>Sat, 21 Apr 2012 07:22:39 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">472@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Hussain,&#60;/p&#62;
&#60;p&#62;The default PML thickness is 20 pixels, but you can change it with the option 'PMLsize' in kspaceFirstOrder3D:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;kspaceFirstOrder2D(kgrid, medium, source, sensor,&#38;#39;PMLSize&#38;#39;,30)&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Beware though, as the performance of the PML will deteriorate as its thickness is reduced. Another option would be to set 'PMLInside' to false, so that the PML is added to the size of domain that you define, although that will increase your domain size by twice the thickness of the PML in each direction so might slow the simulation down:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;kspaceFirstOrder2D(kgrid, medium, source, sensor,&#38;#39;PMLInside&#38;#39;,false)&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Hussain on "Additional information"</title>
			<link>http://www.k-wave.org/forum/topic/additional-information#post-471</link>
			<pubDate>Fri, 20 Apr 2012 15:39:37 +0000</pubDate>
			<dc:creator>Hussain</dc:creator>
			<guid isPermaLink="false">471@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello Ben,&#60;/p&#62;
&#60;p&#62;Thanks for suggesting the solution to my problem. I'm trying to work on it. In the meantime, i have some more issues. &#60;/p&#62;
&#60;p&#62;1. My object is exactly in the middle of the computational grid. My detector is in focus at a distance say 38mm. I believe that the detector might be within the PML boundary. I am not sure how to verify that if my detector is within PML. That could probably be a reason for my problem. Is there anything you could suggest me. In the meantime i'm trying to reduce the size of PML and check how things work. Do let me know if there is any other better way to do this.&#60;/p&#62;
&#60;p&#62;Thanks,&#60;br /&#62;
Hussain
&#60;/p&#62;</description>
		</item>
		<item>
			<title>bencox on "Additional information"</title>
			<link>http://www.k-wave.org/forum/topic/additional-information#post-466</link>
			<pubDate>Thu, 19 Apr 2012 14:57:16 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">466@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Hussain,&#60;/p&#62;
&#60;p&#62;I'm not sure it's a good idea, but I was wondering whether you could solve your problem by making the sound speed and density different behind the transducer from in front of it, ie. set the sound speed and density behind the transducer quite high to simulate something hard. This example (&#60;a href=&#34;http://www.k-wave.org/documentation/example_ivp_heterogeneous_medium.php&#34; rel=&#34;nofollow&#34;&#62;http://www.k-wave.org/documentation/example_ivp_heterogeneous_medium.php&#60;/a&#62;) shows how to define the sound speed and density matrices to have different values at different voxels. &#60;/p&#62;
&#60;p&#62;Setting up these matrices correctly might be tricky, as you need to match the shape to that of the transducer, but it is not conceptually hard - might just take some working out! Can you see how to do it?&#60;/p&#62;
&#60;p&#62;Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Hussain on "Additional information"</title>
			<link>http://www.k-wave.org/forum/topic/additional-information#post-455</link>
			<pubDate>Mon, 16 Apr 2012 20:32:13 +0000</pubDate>
			<dc:creator>Hussain</dc:creator>
			<guid isPermaLink="false">455@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello Mr Ben and Brad,&#60;/p&#62;
&#60;p&#62;In the earlier discussion (&#60;a href=&#34;http://www.k-wave.org/forum/topic/working-of-detector)&#34; rel=&#34;nofollow&#34;&#62;http://www.k-wave.org/forum/topic/working-of-detector)&#60;/a&#62;. Dr Ben has suggested that i could put bowl detectors on the front of a backing with different material properties (higher density and sound speed) which maybe designed to reflect away sound that comes from behind and also reflect the sound from the front from one transducer element to another.&#60;/p&#62;
&#60;p&#62;I am not able to follow how to add these bowl of detectors behind the existing detector. I would really appreciate if you could suggest me a way to carry out this. &#60;/p&#62;
&#60;p&#62;Thanks a lot,&#60;br /&#62;
Hussain
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
