<?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: On the Problem of Adding the Elements Using kWaveArray</title>
		<link>http://www.k-wave.org/forum/topic/on-the-problem-of-adding-the-elements-using-kwavearray</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Tue, 12 May 2026 22:32:19 +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/on-the-problem-of-adding-the-elements-using-kwavearray" rel="self" type="application/rss+xml" />

		<item>
			<title>Bear_Leisure on "On the Problem of Adding the Elements Using kWaveArray"</title>
			<link>http://www.k-wave.org/forum/topic/on-the-problem-of-adding-the-elements-using-kwavearray#post-9051</link>
			<pubDate>Mon, 18 Mar 2024 07:34:33 +0000</pubDate>
			<dc:creator>Bear_Leisure</dc:creator>
			<guid isPermaLink="false">9051@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I see,Thank you,Professor Trebby.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "On the Problem of Adding the Elements Using kWaveArray"</title>
			<link>http://www.k-wave.org/forum/topic/on-the-problem-of-adding-the-elements-using-kwavearray#post-8960</link>
			<pubDate>Fri, 24 Nov 2023 17:43:26 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8960@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;First, check if your source signal has two signals, one for each element. The size should be &#60;code&#62;[number_elements, Nt]&#60;/code&#62;. Otherwise, can you post a complete example that reproduces the problem, and I'll take a look.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bear_Leisure on "On the Problem of Adding the Elements Using kWaveArray"</title>
			<link>http://www.k-wave.org/forum/topic/on-the-problem-of-adding-the-elements-using-kwavearray#post-8913</link>
			<pubDate>Thu, 21 Sep 2023 10:47:47 +0000</pubDate>
			<dc:creator>Bear_Leisure</dc:creator>
			<guid isPermaLink="false">8913@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello, professor Treeby. I tried to adding two concave sphere elements Using kWaveArray.addBowlElement. The specific implementation process is as follows:&#60;br /&#62;
% --------------------&#60;br /&#62;
% SOURCE&#60;br /&#62;
% --------------------&#60;/p&#62;
&#60;p&#62;% create time varying source&#60;br /&#62;
source_sig = createCWSignals(kgrid.t_array, source_f0, source_amp, 0);&#60;/p&#62;
&#60;p&#62;% set bowl 1 position and orientation&#60;br /&#62;
bowl_pos = [kgrid.x_vec(1), 0, 0];&#60;br /&#62;
focus_pos = [kgrid.x_vec(end), 0, 0];&#60;/p&#62;
&#60;p&#62;% create empty kWaveArray&#60;br /&#62;
karray = kWaveArray('BLITolerance', bli_tolerance, 'UpsamplingRate', upsampling_rate, 'SinglePrecision', true);&#60;/p&#62;
&#60;p&#62;% add bowl 1 shaped element&#60;br /&#62;
karray.addBowlElement(bowl_pos, source_roc, source_diameter, focus_pos);&#60;/p&#62;
&#60;p&#62;% set bowl 2 position and orientation&#60;br /&#62;
bowl_pos = [kgrid.x_vec(end), 0, 0];&#60;br /&#62;
focus_pos = [kgrid.x_vec(1), 0, 0];&#60;/p&#62;
&#60;p&#62;% add bowl 2 shaped element&#60;br /&#62;
karray.addBowlElement(bowl_pos, source_roc, source_diameter, focus_pos);&#60;/p&#62;
&#60;p&#62;% assign binary mask&#60;br /&#62;
source.p_mask = karray.getArrayBinaryMask(kgrid);&#60;/p&#62;
&#60;p&#62;% assign source signals&#60;br /&#62;
source.p = karray.getDistributedSourceSignal(kgrid, source_sig);&#60;/p&#62;
&#60;p&#62;  Although the addition was successful, an error occurred when using karray.getDistributedSourceSignal assign source signals. The error is following as:&#60;br /&#62;
Example_CustomedPhaseArray&#60;br /&#62;
Computing distributed source signal...&#60;br /&#62;
  calculating binary mask...                  completed in 52.835s&#60;br /&#62;
  approximate size of source matrix:          790 MB (single precision)&#60;br /&#62;
  calculating element 1 grid weights...       completed in 21.28s&#60;br /&#62;
  calculating element 1 distributed source... completed in 0.691s&#60;br /&#62;
  calculating element 2 grid weights...       completed in 46.656s&#60;br /&#62;
  calculating element 2 distributed source... The index at position 1 exceeds the array boundary. The index cannot exceed 1.&#60;/p&#62;
&#60;p&#62;Error kWaveArray/getDistributedSourceSignal (Line 1057)&#60;br /&#62;
                    + bsxfun(@times, source_weights(element_mask_ind), source_signal(ind, :));&#60;/p&#62;
&#60;p&#62;Error Example_CustomedPhaseArray (Line 92)&#60;br /&#62;
source.p = karray.getDistributedSourceSignal(kgrid, source_sig);&#60;br /&#62;
  I tried to find the causefrom kwavearray, but failed! Thus, I would like to consult with the professor!&#60;/p&#62;
&#60;p&#62;  Thank you for the attention.&#60;br /&#62;
Jiupeng Xiong
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
