<?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: Understanding Beamforming</title>
		<link>http://www.k-wave.org/forum/topic/understanding-beamforming</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 00:48:03 +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/understanding-beamforming" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "Understanding Beamforming"</title>
			<link>http://www.k-wave.org/forum/topic/understanding-beamforming#post-4368</link>
			<pubDate>Fri, 14 Mar 2014 13:04:41 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">4368@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Margot,&#60;/p&#62;
&#60;p&#62;If you are using the C++ code, the situation is slightly different. In this case, &#60;code&#62;sensor_data&#60;/code&#62; will contain one time trace for every grid point that forms part of the active elements of your transducer (rather than one time trace per element). If your transducer elements contain more than one grid point (which they normally will), then further processing is required to put the C++ output data in the correct format before using the &#60;code&#62;scan_line&#60;/code&#62; method. An additional method called &#60;code&#62;combine_sensor_data&#60;/code&#62; has been added to the &#60;code&#62;kWaveTransducer&#60;/code&#62; class ready for the next release. I have also copied a beta version of it below. You should add this to the &#34;general class methods&#34;. After running the C++ simulation, you can then call &#60;code&#62;sensor_data = transducer.combine_sensor_data(sensor_data)&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;Let me know if you have any problems,&#60;/p&#62;
&#60;p&#62;Brad.&#60;/p&#62;
&#60;pre&#62;&#60;code&#62;% function to average the individual time series recorded at each
% grid point of each transducer element (as returned by the C++
% code) and return a single time series per active transducer
% element (as returned by the MATLAB code)
function sensor_data_sum = combine_sensor_data(obj, sensor_data)

    % check the data is the correct size
    if size(sensor_data, 1) ~= (obj.number_active_elements * obj.element_width * obj.element_length)
        error(&#38;#39;The number of time series in the input sensor_data must match the number of grid points in the active tranducer elements.&#38;#39;);
    end

    % get index of which element each time series belongs to
    ind = obj.indexed_active_elements_mask(obj.indexed_active_elements_mask &#38;gt; 0);

    % create empty output
    sensor_data_sum = zeros(obj.number_active_elements, size(sensor_data, 2));

    % check if an elevation focus is set
    if isinf(obj.elevation_focus_distance)

        % loop over time series and sum
        for ii = 1:length(ind)
            sensor_data_sum(ind(ii), :) = sensor_data_sum(ind(ii), :) + sensor_data(ii, :);
        end

    else

        % get the elevation delay for each grid point of each
        % active transducer element (this is given in units of grid
        % points)
        dm = obj.delay_mask(2);
        dm = dm(obj.active_elements_mask ~= 0);

        % loop over time series, shift and sum
        for ii = 1:length(ind)
            sensor_data_sum(ind(ii), 1:end - dm(ii)) = sensor_data_sum(ind(ii), 1:end - dm(ii)) + sensor_data(ii, 1 + dm(ii):end);
        end

    end

    % divide by number of time series in each element
    sensor_data_sum = sensor_data_sum .* (1/ (obj.element_width * obj.element_length));

end&#60;/code&#62;&#60;/pre&#62;</description>
		</item>
		<item>
			<title>mgt_p on "Understanding Beamforming"</title>
			<link>http://www.k-wave.org/forum/topic/understanding-beamforming#post-4362</link>
			<pubDate>Fri, 07 Mar 2014 16:24:24 +0000</pubDate>
			<dc:creator>mgt_p</dc:creator>
			<guid isPermaLink="false">4362@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I can't edit my previous post, but in fact, I am interested in understanding lines 693 to 701 in kWaveTransducer.m . It is just before the summation to get an A-line. &#60;/p&#62;
&#60;p&#62;To me, it really doesn't look like the whole data gets through apodization and delays.&#60;br /&#62;
Is it because only the first line is linked to the element number? Or am I totally mistaken on sensor_data?&#60;/p&#62;
&#60;p&#62;Thanks !
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mgt_p on "Understanding Beamforming"</title>
			<link>http://www.k-wave.org/forum/topic/understanding-beamforming#post-4361</link>
			<pubDate>Fri, 07 Mar 2014 14:55:51 +0000</pubDate>
			<dc:creator>mgt_p</dc:creator>
			<guid isPermaLink="false">4361@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hello Bradley,&#60;/p&#62;
&#60;p&#62;Thanks for your answer.&#60;/p&#62;
&#60;p&#62;Yes, I am using the C++ code (so much faster !).
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Bradley Treeby on "Understanding Beamforming"</title>
			<link>http://www.k-wave.org/forum/topic/understanding-beamforming#post-4343</link>
			<pubDate>Tue, 25 Feb 2014 14:32:42 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">4343@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Margot,&#60;/p&#62;
&#60;p&#62;The transducer object that is created by &#60;code&#62;makeTransducer&#60;/code&#62; has two fields related to the number of elements. The first is &#60;code&#62;number_elements&#60;/code&#62; which sets the physical number of elements in the transducer. The second is &#60;code&#62;active_elements&#60;/code&#62; which defines which of the elements are actually used to generate or detect sound. When using a transducer as a sensor, the number of time series in &#60;code&#62;sensor_data&#60;/code&#62; should be &#60;code&#62;active_elements&#60;/code&#62;. Thus, the processing only applies to these time series.&#60;/p&#62;
&#60;p&#62;Note, if you're using the C++ code, this doesn't return a time trace per transducer element, but rather, a time trace per grid point. In this case, some additional processing is required. Let me know if this is the case and I'll give you the additional code required.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>mgt_p on "Understanding Beamforming"</title>
			<link>http://www.k-wave.org/forum/topic/understanding-beamforming#post-4332</link>
			<pubDate>Thu, 20 Feb 2014 14:21:22 +0000</pubDate>
			<dc:creator>mgt_p</dc:creator>
			<guid isPermaLink="false">4332@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;/p&#62;
&#60;p&#62;I don't quite understand how delays are applied to sensor_data in the kWaveTransducer.m.&#60;/p&#62;
&#60;p&#62;I understand the calculation, but it seems to me that only the first number_active_elements lines of it is modified. So a wide majority of values in sensor_data isn't modified...&#60;/p&#62;
&#60;p&#62;I suspect I don't understand exactly the meaning of sensor_data, but could somebody please take a minute to explain this to me?&#60;/p&#62;
&#60;p&#62;Thanks a lot,&#60;/p&#62;
&#60;p&#62;Margot
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
