<?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: kWaveArray distributed_source_signal and alternative source assignment methods</title>
		<link>http://www.k-wave.org/forum/topic/kwavearray-distributed_source_signal-and-alternative-source-assignment-methods</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 01:09:09 +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/kwavearray-distributed_source_signal-and-alternative-source-assignment-methods" rel="self" type="application/rss+xml" />

		<item>
			<title>vat on "kWaveArray distributed_source_signal and alternative source assignment methods"</title>
			<link>http://www.k-wave.org/forum/topic/kwavearray-distributed_source_signal-and-alternative-source-assignment-methods#post-8397</link>
			<pubDate>Tue, 21 Dec 2021 04:27:43 +0000</pubDate>
			<dc:creator>vat</dc:creator>
			<guid isPermaLink="false">8397@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Brad,&#60;/p&#62;
&#60;p&#62;For the example I indicate, is there a recommendation for routine or approach to most simply assign all the grid points on the disc element a particular velocity of given time varying amplitude in m/s? This amplitude is desired of the velocity component normal to the disc area, and all other velocity components would be 0 m/s. &#60;/p&#62;
&#60;p&#62;On your first question, there is a geometry difference but I do not understand why I still would not see the specified velocity on a monitoring node located at the array adding a modified function below in which changing the weights to 1 in the karray class:&#60;/p&#62;
&#60;p&#62;'function distributed_source_signal_unweighted = getDistributedSourceSignalUnweighted(obj, kgrid, source_signal)&#60;/p&#62;
&#60;p&#62;            % check the array has elements&#60;br /&#62;
            obj.checkForElements(dbstack);&#60;/p&#62;
&#60;p&#62;            % get the binary mask to count how many points contribute to&#60;br /&#62;
            % the source&#60;br /&#62;
            mask = obj.getArrayBinaryMask(kgrid);&#60;br /&#62;
            mask_ind = find(mask);&#60;br /&#62;
            num_source_points = sum(mask(:));&#60;/p&#62;
&#60;p&#62;            % number of time points in the signal&#60;br /&#62;
            Nt = size(source_signal, 2);&#60;/p&#62;
&#60;p&#62;            % initialise the source signal&#60;br /&#62;
            distributed_source_signal_unweighted = zeros(num_source_points, Nt);&#60;/p&#62;
&#60;p&#62;            % loop through the elements&#60;br /&#62;
            for ind = 1:obj.number_elements&#60;/p&#62;
&#60;p&#62;                % get the offgrid source weights&#60;br /&#62;
                source_weights = obj.getElementGridWeights(kgrid, ind);&#60;/p&#62;
&#60;p&#62;                % get indices of the non-zero points&#60;br /&#62;
                element_mask_ind = find(source_weights ~= 0);&#60;/p&#62;
&#60;p&#62;                % convert these to indices in the distributed source&#60;br /&#62;
                local_ind = ismember(mask_ind, element_mask_ind);&#60;/p&#62;
&#60;p&#62;                % add to distributed source - HERE I ADD SO THERE IS NO&#60;br /&#62;
                % WEIGHTING&#60;br /&#62;
                distributed_source_signal_unweighted(local_ind, :) = ...&#60;br /&#62;
                    distributed_source_signal_unweighted(local_ind, :) ...&#60;br /&#62;
                    + (1)* source_signal(ind, :);&#60;/p&#62;
&#60;p&#62;            end&#60;/p&#62;
&#60;p&#62;        end' &#60;/p&#62;
&#60;p&#62;But if you can make a recommendation on my first point, I care about that more urgently.&#60;/p&#62;
&#60;p&#62;Thanks for the attention.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "kWaveArray distributed_source_signal and alternative source assignment methods"</title>
			<link>http://www.k-wave.org/forum/topic/kwavearray-distributed_source_signal-and-alternative-source-assignment-methods#post-8375</link>
			<pubDate>Thu, 16 Dec 2021 11:12:46 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8375@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Vatche,&#60;/p&#62;
&#60;p&#62;Is some of the difference related to your use of disc elements in &#60;code&#62;kWaveArray&#60;/code&#62;, rather than rectangular ones (which are used in &#60;code&#62;kWaveTransducer&#60;/code&#62;)?&#60;/p&#62;
&#60;p&#62;One point to note, if you're using velocity sources and the physical array elements are not aligned with the grid, you'll have to consider how to assign the vector components of the velocity so the resulting field is still normal to the element surface.&#60;/p&#62;
&#60;p&#62;Brad
&#60;/p&#62;</description>
		</item>
		<item>
			<title>vat on "kWaveArray distributed_source_signal and alternative source assignment methods"</title>
			<link>http://www.k-wave.org/forum/topic/kwavearray-distributed_source_signal-and-alternative-source-assignment-methods#post-8327</link>
			<pubDate>Wed, 13 Oct 2021 19:20:37 +0000</pubDate>
			<dc:creator>vat</dc:creator>
			<guid isPermaLink="false">8327@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello,&#60;/p&#62;
&#60;p&#62;I am trying to resolve some discrepancy/ambiguity about input signal assignment using kWaveArray objects to define my transducer/array geometry.&#60;/p&#62;
&#60;p&#62;Previously I use kWaveTransducer object passing input in m/s to be assigned to particle velocities as follows:&#60;/p&#62;
&#60;p&#62;% create the input signal using toneBurst&#60;br /&#62;
input_signal = toneBurst(1/kgrid.dt, tone_burst_freq, tone_burst_cycles);&#60;/p&#62;
&#60;p&#62;% scale the source magnitude by the source strength in m/s&#60;br /&#62;
input_signal = source_velocity.*input_signal;&#60;/p&#62;
&#60;p&#62;...&#60;/p&#62;
&#60;p&#62;transducer.input_signal = input_signal;&#60;/p&#62;
&#60;p&#62;% create the transducer using the defined settings&#60;br /&#62;
transducer = kWaveTransducer(kgrid, transducer);&#60;/p&#62;
&#60;p&#62;Now a similar geometry defined kWaveArray has a different pressure output and I assume this relates partially to my use but perhaps to implementation? Here is essentially what I tried:&#60;/p&#62;
&#60;p&#62;karray = kWaveArray;&#60;/p&#62;
&#60;p&#62;% adding disc elements&#60;br /&#62;
for col=1:N&#60;br /&#62;
   for row=1:N&#60;br /&#62;
       karray.addDiscElement(elem_pos, diameter, [100,0,0]);&#60;br /&#62;
   end&#60;br /&#62;
end&#60;br /&#62;
...&#60;br /&#62;
% assign binary mask&#60;br /&#62;
source.p_mask = karray.getArrayBinaryMask(kgrid);&#60;br /&#62;
...&#60;br /&#62;
source_sig = repmat(input_signal,count,1);%for assigning to number elements count &#60;/p&#62;
&#60;p&#62;% get distributed source signals (this automatically returns a weighted&#60;br /&#62;
% source signal for each grid point that forms part of the source elements)&#60;br /&#62;
source.p = karray.getDistributedSourceSignal(kgrid, source_sig);&#60;/p&#62;
&#60;p&#62;Based on documentation &#60;a href=&#34;http://www.k-wave.org/documentation/example_us_defining_transducer.php&#34; rel=&#34;nofollow&#34;&#62;http://www.k-wave.org/documentation/example_us_defining_transducer.php&#60;/a&#62;&#60;br /&#62;
I assume the particle velocities/grid points are assigned the input_signal in m/s on my attempt to use kWaveTransducer but here the weighting scheme reduces the values at each of the grid points?&#60;/p&#62;
&#60;p&#62;Is there a recommended approach that assures grid points for all elements of the kWaveArray are assigned specific particle velocity time traces I would like to pass to them in source_sig or some other structure?   &#60;/p&#62;
&#60;p&#62;Thank you for the attention.&#60;/p&#62;
&#60;p&#62;Cheers,&#60;br /&#62;
Vatche
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
