<?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: &#039;Real&#039; directivity</title>
		<link>http://www.k-wave.org/forum/topic/real-directivity</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 00:11:02 +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/real-directivity" rel="self" type="application/rss+xml" />

		<item>
			<title>bencox on "&#039;Real&#039; directivity"</title>
			<link>http://www.k-wave.org/forum/topic/real-directivity#post-957</link>
			<pubDate>Thu, 01 Nov 2012 12:12:40 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">957@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Erik,&#60;/p&#62;
&#60;p&#62;A directivity pattern indicates how a sensor responds to plane waves arriving at different angles. In kspaceFirstOrder2D (but not kspaceFirstOrder3D) we apply directivity patterns by decomposing the pressure field into its constituent plane waves (simply using a 2D FFT) and multiplying the amplitudes of each plane wave by the directivity pattern. So, for example, the directivity pattern associated with spatial averaging across the sensor is &#60;code&#62;sinc(k*element_size/2)&#60;/code&#62; where &#60;code&#62;k&#60;/code&#62; is the magnitude of the wavevector along the element face. If you define &#60;code&#62;sensor.directivity_pattern = &#38;#39;pressure&#38;#39;;&#60;/code&#62; it is this function that is used. You have noticed that it is equivalent to spatial averaging. The other directivity pattern included &#60;code&#62;&#38;#39;gradient&#38;#39;&#60;/code&#62; weights the plane waves according to how well they would be detected by a sensor element that detected pressure gradient rather than pressure (for example, the plane waves travelling perpendicular to the sensor face will not be detected at all). In practice, an ultrasound transducer's directivity response will depend on what in the field it is sensitive to (i.e.. pressure, pressure gradient, ...) and how it spatially averages. The details of this are in the function &#60;code&#62;directionalResponse.m&#60;/code&#62; in the 'private' folder in the Toolbox (you could add other directional responses here, if you wanted too, even measured ones). &#60;/p&#62;
&#60;p&#62;The drawback of this approach is that the field at every timestep needs to be multiplied by the directivity pattern before the result is sampled at the sensor points, which makes it slow - especially if different sensor points have different directivity patterns. That's the main reason we haven't added this functionality to the 3D model &#60;code&#62;kspaceFirstOrder3D&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;By taking the dot product of the velocity vector with a direction vector you are effectively saying your sensor is sensitive to just a single plane wave; no real sensors would be that directional.&#60;/p&#62;
&#60;p&#62;Hope that helps,&#60;/p&#62;
&#60;p&#62;Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>styxed on "&#039;Real&#039; directivity"</title>
			<link>http://www.k-wave.org/forum/topic/real-directivity#post-946</link>
			<pubDate>Wed, 31 Oct 2012 17:58:52 +0000</pubDate>
			<dc:creator>styxed</dc:creator>
			<guid isPermaLink="false">946@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;Thanks for the quick reply. I am working in 2D now.&#60;br /&#62;
I wasn't aware of the 'ReturnVelocity' option; it indeed gives a neat solution to my problem. This is what I considered directivity.&#60;/p&#62;
&#60;p&#62;I have to dive a little deeper into the first thing you mention. Because it looks to me that the example which we both mentioned,&#60;br /&#62;
a) either does spatial averaging by enlarging the sensor element with &#60;code&#62;sensor.directivity_size&#60;/code&#62; on both sides, perpendicular to the directivity angle; and then averages over the enlarged sensor element. Or,&#60;br /&#62;
b) does not seem to be influenced much by the directivity settings.&#60;/p&#62;
&#60;p&#62;Let me explain on the basis of how I used the example to come to these conclusions:&#60;br /&#62;
at the visualization part of the initial value problem, add the codelines:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;% plot pressure distribution over time, sensed by individual elements
figure, plot(sensor_data(1:3:16,:)&#38;#39;); grid;
break;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;which plots the pressure felt by 6 of the left elements (1 to 16). With &#60;code&#62;sensor.directivity_pattern = &#38;#39;pressure&#38;#39;;&#60;/code&#62;&#60;br /&#62;
and&#60;br /&#62;
&#60;code&#62;sensor.directivity_size = 16*kgrid.dx;&#60;/code&#62;&#60;br /&#62;
you can clearly see that the leftmost element sensed the pressure wave 16 pixels earlier than the center element. Which leads me to conclude point a)&#60;/p&#62;
&#60;p&#62;Without setting &#60;code&#62;sensor.directivity_pattern&#60;/code&#62; and &#60;code&#62;sensor.directivity_size&#60;/code&#62; (just commenting them out) I would expect to see the same directivity as I did now via multiplying the velocity output with the directivity vector which I did like this:&#60;br /&#62;
&#60;code&#62;rx_signal = sensor_data.ux.*cos([(-1:1/15:1)*pi/2]&#38;#39;) + sensor_data.uy.*sin([(-1:1/15:1)*pi/2]&#38;#39;);&#60;/code&#62;&#60;br /&#62;
Instead, in the example I get 6 times the pressure distribution of the initial pressure wave which are almost similar to each other.&#60;/p&#62;
&#60;p&#62;Can you explain me with this example what ´a directivity pattern which is applied in k-space´ means?&#60;/p&#62;
&#60;p&#62;____&#60;/p&#62;
&#60;p&#62;In order to compare the two ideas of directivity I wanted to plot the systems next to each other. But somehow in this example I can't run kspaceFirstOrder2D with the 'ReturnVelocity' option when I haven't commented out the directivity entries.&#60;br /&#62;
I ended up with this:&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;% define the angle of max directivity for each single-element sensor
% 0 = max sensitivity in x direction (up/down)
% pi/2 or -pi/2 = max sensitivity in y direction (left/right)
%sensor.directivity_angle = zeros(Nx,Ny);
%sensor.directivity_angle(24,2:2:63) = (-1:1/15:1)*pi/2;

% define the directivity pattern
%sensor.directivity_pattern = &#38;#39;pressure&#38;#39;;

% define the directivity size
%sensor.directivity_size = 16*kgrid.dx;

% =========================================================================
% SIMULATION AND VISUALISATION FOR AN INITIAL VALUE PROBLEM
% =========================================================================

% define the initial pressure distribution
source.p0 = zeros(Nx,Ny);
source.p0(39:41,:) = 2;

% run the simulation
[sensor_data, p_final] = kspaceFirstOrder2D(kgrid, medium, source, sensor, &#38;#39;PMLAlpha&#38;#39;, [2 0], &#38;#39;ReturnVelocity&#38;#39;, true);

% calculate &#38;#39;real&#38;#39; directivity
rx_signal = sensor_data.ux.*cos([(-1:1/15:1)*pi/2]&#38;#39;) + sensor_data.uy.*sin([(-1:1/15:1)*pi/2]&#38;#39;);

% plot pressure distribution over time, sensed by individual elements
figure;
%subplot(211); plot(sensor_data.p(1:3:16,:)&#38;#39;); grid; % doesn&#38;#39;t work
subplot(212); plot(rx_signal(1:3:16,:)&#38;#39;); grid; title(&#38;#39;real directivity&#38;#39;);
break;&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>bencox on "&#039;Real&#039; directivity"</title>
			<link>http://www.k-wave.org/forum/topic/real-directivity#post-944</link>
			<pubDate>Wed, 31 Oct 2012 12:59:09 +0000</pubDate>
			<dc:creator>bencox</dc:creator>
			<guid isPermaLink="false">944@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Erik,&#60;/p&#62;
&#60;p&#62;Are you working in 2D or 3D? In 2D an individual element can be assigned a directivity pattern which is applied in k-space (so not spatial averaging in the spatial domain). See&#60;code&#62;Sensor Element Directivity in 2D Example&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;You could obtain the sort of directional response you describe with a simple post-processing step: set the option 'ReturnVelocity' to be true and the vector particle velocity will be returned. From this you can calculate the component in which ever direction you like using a dot product. (Note that in the forthcoming release the notation for kspaceFirstOrder1D/2D/3D will change slightly to allow you to choose from a variety of outputs more easily.)&#60;/p&#62;
&#60;p&#62;Ben
&#60;/p&#62;</description>
		</item>
		<item>
			<title>styxed on "&#039;Real&#039; directivity"</title>
			<link>http://www.k-wave.org/forum/topic/real-directivity#post-937</link>
			<pubDate>Tue, 30 Oct 2012 17:18:10 +0000</pubDate>
			<dc:creator>styxed</dc:creator>
			<guid isPermaLink="false">937@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;Today I wanted to do simulations on single elements sensors with a specific directionality. I was happy to see that directivity was implemented (Sensor Element Directivity in 2D Example). Only to find out that it was just a big cheat. Sorry, maybe not the correct use of words. I was expecting something else.&#60;/p&#62;
&#60;p&#62;From the documentation of the example I understood that the 'gradient' and 'pressure' were something additional; which would be useful if you want a spatial averaging function. When I plotted the sensor_data of a single sensor element over time, I realized you increase the sensor element to a set of elements, perpendicular to the directivity angle, with a width of sensor.directivity_size to average over all of those elements. So for example the left element already senses the pressure wave sensor.directivity_size pixels earlier that when the wave is supposed to be on the element.&#60;/p&#62;
&#60;p&#62;What I expected is what I am now posting as feature request:&#60;br /&#62;
Directivity in which a sensor output is given by the velocity of the medium in that point (differential of pressure), multiplied (inner product) by the directionality vector of the sensor. (So the inverse of creating a velocity source)&#60;/p&#62;
&#60;p&#62;Is that possible?&#60;/p&#62;
&#60;p&#62;Erik
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
