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

		<item>
			<title>Bradley Treeby on "HRTF simulation help"</title>
			<link>http://www.k-wave.org/forum/topic/hrtf-simulation-help#post-117</link>
			<pubDate>Sun, 20 Mar 2011 22:56:56 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">117@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Matt,&#60;/p&#62;
&#60;p&#62;Thanks for your post. The simulations in k-Wave can go 'black' for two reasons. First, if the plot scale is not suitable. You can check this by setting &#60;code&#62;&#38;#39;PlotScale&#38;#39;&#60;/code&#62; to &#60;code&#62;&#38;#39;auto&#38;#39;&#60;/code&#62;. Second, if the simulation becomes unstable. This can happen for heterogeneous media if the time step is too large. In your case, it is the latter that is the problem.&#60;/p&#62;
&#60;p&#62;If &#60;code&#62;kgrid.t_array&#60;/code&#62; is not explicitly given, k-Wave calculates the time-step based on the Courant-Friedrichs-Lewy number, where &#60;code&#62;dt = CFL*dx/c_max&#60;/code&#62;. By default, a CFL level of 0.3 is used which provides a good compromise between speed and accuracy for weakly heterogeneous media. For strongly heterogeneous media, you can create your own time array or use a more stringent CFL. For example, in the example you mention, try adding the code:&#60;/p&#62;
&#60;p&#62;&#60;code&#62;CFL = 0.01;&#60;/code&#62;&#60;br /&#62;
&#60;code&#62;kgrid.t_array = makeTime(kgrid, medium.sound_speed, CFL);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;before running the simulation. You can adjust the CFL number to achieve the required balance between accuracy and computational time.&#60;/p&#62;
&#60;p&#62;To answer your second question, there is currently no explicit way in k-Wave to define impedance boundary conditions or model elastic solids. However, in your case the impedance difference between air and bone is already fairly significant (~ 420 Rayls vs ~ 6 megaRayls) so transmission from one medium to the other will be limited. In other words, if you just use the material properties for air and bone, the bone will already 'act' like a reasonably solid object, although keep in mind that k-Wave currently only models compressional acoustic waves.&#60;/p&#62;
&#60;p&#62;I hope that helps! Let us know if you have any other questions,&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Chesteta on "HRTF simulation help"</title>
			<link>http://www.k-wave.org/forum/topic/hrtf-simulation-help#post-114</link>
			<pubDate>Wed, 16 Mar 2011 19:44:10 +0000</pubDate>
			<dc:creator>Chesteta</dc:creator>
			<guid isPermaLink="false">114@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello, my name is Matt, I am an engineering student (taking my first MATLAB course this semester if that gives you an idea where my experience is at) trying to create a head-related transfer function dataset using k-wave in conjunction with data from a CT scan (or initially a generic head sized/shaped object) by creating an impulse at a point in space and then allowing that impulse to propagate through the medium.  My questions are:&#60;/p&#62;
&#60;p&#62;1) when I have a very large difference in density or velocity in my simulations I notice that the entire screen goes 'black' in the plot of the pressure distribution, this happens after one or two time slices... Is there any reason for this or way to fix it? To see what is going on, try do the demo here with the following change:&#60;/p&#62;
&#60;p&#62;&#60;a href=&#34;http://www.k-wave.org/documentation/example_ps_heterogeneous_medium.php&#34; rel=&#34;nofollow&#34;&#62;http://www.k-wave.org/documentation/example_ps_heterogeneous_medium.php&#60;/a&#62;&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
medium.sound_speed = 1500*ones(Nz, Nx); % [m/s]&#60;br /&#62;
medium.sound_speed(1:Nz/2, :) = 1800;   % [m/s]&#60;br /&#62;
medium.density = 1000*ones(Nz, Nx);     % [kg/m^3]&#60;br /&#62;
medium.density(:, Nx/4:end) = 1;     % [kg/m^3]**changed value from 1200 to 1&#60;/p&#62;
&#60;p&#62;I notice that when there is more than a ~1000:1 ratio in density, the simulation fails.&#60;br /&#62;
----------------------------------------------------&#60;br /&#62;
2) Is there a way to define 'solid' objects, I was planning to try and setup bones which are more rigid than fluid like: if all else failed, I figure I could just set their density to almost infinite so it would 'act' like a solid object...&#60;/p&#62;
&#60;p&#62;I appreciate any advice or help you can provide.  Thank you for all your time, knowledge, and work that you have put into K-Wave.  I appreciate it very much.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
