<?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: How to define the best sensor.directivity_size for 2D simulation?</title>
		<link>http://www.k-wave.org/forum/topic/how-to-define-the-best-sensordirectivity_size-for-2d-simulation</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 23:40: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/how-to-define-the-best-sensordirectivity_size-for-2d-simulation" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "How to define the best sensor.directivity_size for 2D simulation?"</title>
			<link>http://www.k-wave.org/forum/topic/how-to-define-the-best-sensordirectivity_size-for-2d-simulation#post-8766</link>
			<pubDate>Sun, 21 May 2023 13:49:23 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8766@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;This is the physical size of the detecting element. There is some discussion in &#60;a href=&#34;http://www.k-wave.org/papers/2010-Cox-SPIE.pdf&#34;&#62;this paper&#60;/a&#62;.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>hyaocai on "How to define the best sensor.directivity_size for 2D simulation?"</title>
			<link>http://www.k-wave.org/forum/topic/how-to-define-the-best-sensordirectivity_size-for-2d-simulation#post-8733</link>
			<pubDate>Fri, 24 Mar 2023 23:22:20 +0000</pubDate>
			<dc:creator>hyaocai</dc:creator>
			<guid isPermaLink="false">8733@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Dear Ben and Brad,&#60;/p&#62;
&#60;p&#62;I'm currently doing 2D simulation on k-wave, an professional tool for photoacoustics.I notice the simulation results vary based on different 'sensor.directivity_size' parameters. Could you please explain in more detail how to define the best sensor.directivity_size?&#60;/p&#62;
&#60;p&#62;To make my question specific, I post my model below:&#60;/p&#62;
&#60;p&#62;% define the properties of the propagation medium&#60;br /&#62;
medium.sound_speed = 1500;	% [m/s]&#60;br /&#62;
PML_size = 10;&#60;br /&#62;
Nx = 320 - 2 * PML_size;&#60;br /&#62;
Ny = 520 - 2 * PML_size;&#60;br /&#62;
dx = 0.0005;     % m&#60;br /&#62;
dy = dx;&#60;br /&#62;
kgrid = kWaveGrid(Nx, dx, Ny, dy);&#60;/p&#62;
&#60;p&#62;% create the time array&#60;br /&#62;
kgrid.makeTime(medium.sound_speed);&#60;/p&#62;
&#60;p&#62;source.p0 = zeros(Nx,Ny);&#60;br /&#62;
source.p0(100,100) = 100;&#60;br /&#62;
sensor.mask = zeros(Nx, Ny);&#60;br /&#62;
sensor.mask(39:262,1) = 1;&#60;/p&#62;
&#60;p&#62;% define the angle of max directivity for each sensor point:&#60;br /&#62;
dir_angles = (67.5:45/223:112.5)'/180*pi;&#60;/p&#62;
&#60;p&#62;% assign to the directivity mask&#60;br /&#62;
sensor.directivity_angle = zeros(Nx, Ny);&#60;br /&#62;
sensor.directivity_angle(sensor.mask == 1) = dir_angles;&#60;/p&#62;
&#60;p&#62;% define the directivity pattern&#60;br /&#62;
sensor.directivity_pattern = 'pressure';&#60;/p&#62;
&#60;p&#62;% define the directivity size&#60;br /&#62;
sensor.directivity_size = 16 * kgrid.dx;&#60;/p&#62;
&#60;p&#62;% define the frequency response of the sensor elements&#60;br /&#62;
center_freq = 0.35e6;      % [Hz]&#60;br /&#62;
bandwidth = 50;         % [%]&#60;br /&#62;
sensor.frequency_response = [center_freq, bandwidth];&#60;/p&#62;
&#60;p&#62;% set the input arguements&#60;br /&#62;
input_args = {'PMLSize', PML_size, 'PMLInside', false, 'PlotPML', false, ...&#60;br /&#62;
    'Smooth', false, 'DataCast', 'single', 'CartInterp', 'nearest'};&#60;/p&#62;
&#60;p&#62;% run the simulation&#60;br /&#62;
sensor_data = kspaceFirstOrder2D(kgrid, medium, source, sensor, input_args{:});
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
