<?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: Zero matrix computed in scanConversion</title>
		<link>http://www.k-wave.org/forum/topic/zero-matrix-computed-in-scanconversion</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Fri, 15 May 2026 06:30:13 +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/zero-matrix-computed-in-scanconversion" rel="self" type="application/rss+xml" />

		<item>
			<title>mario7lorenzo on "Zero matrix computed in scanConversion"</title>
			<link>http://www.k-wave.org/forum/topic/zero-matrix-computed-in-scanconversion#post-8309</link>
			<pubDate>Tue, 21 Sep 2021 03:28:58 +0000</pubDate>
			<dc:creator>mario7lorenzo</dc:creator>
			<guid isPermaLink="false">8309@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi guys,&#60;/p&#62;
&#60;p&#62;I am new to this k-Wave library. My aim is to create a sector scan image using &#60;code&#62;scanConversion&#60;/code&#62; method. I have the signal data for several plane wave angles with time. I have arranged the data into a matrix of sized &#60;code&#62;nAngles vs Time&#60;/code&#62; as required in the documentation. I have also specified what are the scan angles used in the data, the time difference between samples, and the image size. However, somehow the result is all zero matrix. I could not think of what potential issues that happens here. Looking forward for your insights!&#60;/p&#62;
&#60;p&#62;Thanks!&#60;/p&#62;
&#60;p&#62;Btw, here is the code:&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;function result = process()
    load(&#38;#39;data.mat&#38;#39;);

    % Compute the time delay
    % Reference point: The left most element as the first element
    dx = 10; % in mm
    theta = [-10 -5 0 5 10]; % in degrees
    na = 5; % no of steering angles
    c = 6300; % speed of sound in m/s
    thetaradian = theta * pi/180;
    Fs = Receive(1).decimSampleRate * 1e6;
    ts = 1/Fs;
    tStart = 0;
    N = Receive(1).endSample;
    t = tStart + (0:N-1)*ts;
    example = RcvData{1}(Receive(1).startSample:Receive(1).endSample, 1, 1);
    sz = size(example);

    scanLines = zeros([na sz(1)]);
    for j = 1:5
        accumulated = RcvData{1}(Receive(j).startSample:Receive(j).endSample, 1, 1);
        accumulated = double(accumulated);
        sz = size(accumulated);
        dt = dx * 1e-3 * sin(thetaradian(j))/c; % time delay per elem, in s
        for i = 2:3
            curr = RcvData{1}(Receive(j).startSample:Receive(j).endSample, i, 1);
            zipped = [t&#38;#39; double(curr)];
            td = (i-1) * dt;
            zipped(:,1) = zipped(:,1) - td;
            zipped = zipped(zipped(:,1) &#38;gt;= t(1) &#38;amp; zipped(:,1) &#38;lt;= t(end),:);
            filtered = zipped(:,2);
            szFiltered = size(filtered);
            if (td &#38;lt; 0)
                padded = [zeros([sz(1) - szFiltered(1) 1]); filtered];
            else
                padded = [filtered; zeros([sz(1) - szFiltered(1) 1])];
            end

            accumulated = accumulated + padded;
        end

%         post processing
%         1. High pass filtering
        accumulated = highpass(accumulated, 10000, Fs);
%         2. Rectification
        accumulated = abs(accumulated);
%         3. Enveloping
        [accumulated, dummy] = envelope(accumulated,300,&#38;#39;peak&#38;#39;);
        scanLines(j,:) = accumulated&#38;#39;;
    end

%     k-Wave scanConversion part
    image_size = [480 480];
    b_mode = scanConversion(scanLines, theta, image_size, c, t(2)-t(1));
    result = b_mode;
end&#60;/code&#62;&#60;/pre&#62;</description>
		</item>

	</channel>
</rss>
