<?xml version="1.0" encoding="iso-8859-1" ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" 
"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd" > 
<?xml-stylesheet type="text/css" href="userman.css"?> 
<html  
xmlns="http://www.w3.org/1999/xhtml"  
><head><title>User Manual for the DREAM Toolbox
Version 2.1.3
An ultrasound simulation software for use with Matlab and GNU Octave</title> 
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> 
<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> 
<meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> 
<!-- xhtml,mathml-,mozilla,html --> 
<meta name="src" content="userman.tex" /> 
<meta name="date" content="2009-11-13 15:37:00" /> 
<link rel="stylesheet" type="text/css" href="userman.css" /> 
</head><body 
>
   <div class="maketitle">
                                                                                       
                                                                                       
                                                                                       
                                                                                       

<h2 class="titleHead">User Manual for the DREAM Toolbox<br />
Version 2.1.3<br />
An ultrasound simulation software for use with <a 
href="http://www.mathworks.com" >Matlab</a> and
<a 
href="http://www.octave.org" >GNU Octave</a></h2>
<div class="author" ><span 
class="cmr-12">Fredrik Lingvall</span><span class="thank-mark"><a 
href="#tk-1"><!--l. 260--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2217;</mo></math></a></span></div>
<br />
<div class="date" ><span 
class="cmr-12">November 13, 2009</span></div>
   <div class="thanks" ><br /><a 
 id="tk-1"></a><span class="thank-mark"><!--l. 260--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2217;</mo></math></span>E-mail:<span 
class="cmtt-10">Fredrik.Lingvall@ifi.uio.no</span></div></div>
<!--l. 283--><p class="indent" >
                                                                                       
                                                                                       
</p>
   <h3 class="likesectionHead"><a 
 id="x1-1000"></a>Contents</h3>
   <div class="tableofcontents">
   <span class="sectionToc" >1 <a 
href="#x1-20001" id="QQ2-1-2">Introduction</a></span>
<br />   <span class="sectionToc" >2 <a 
href="#x1-30002" id="QQ2-1-3">Copyright</a></span>
<br />   &#x00A0;<span class="subsectionToc" >2.1 <a 
href="#x1-40002.1" id="QQ2-1-4">Disclaimer</a></span>
<br />   <span class="sectionToc" >3 <a 
href="#x1-50003" id="QQ2-1-5">System Requirements</a></span>
<br />   <span class="sectionToc" >4 <a 
href="#x1-60004" id="QQ2-1-6">Installation</a></span>
<br />   &#x00A0;<span class="subsectionToc" >4.1 <a 
href="#x1-70004.1" id="QQ2-1-7">Binary Installation (Matlab only)</a></span>
<br />   &#x00A0;<span class="subsectionToc" >4.2 <a 
href="#x1-80004.2" id="QQ2-1-8">Windows Specific Installation Notes</a></span>
<br />   &#x00A0;<span class="subsectionToc" >4.3 <a 
href="#x1-90004.3" id="QQ2-1-9">MacOS X Specific Installation Notes</a></span>
<br />   &#x00A0;<span class="subsectionToc" >4.4 <a 
href="#x1-100004.4" id="QQ2-1-10">Octave Specific Installation Notes</a></span>
<br />   &#x00A0;<span class="subsectionToc" >4.5 <a 
href="#x1-110004.5" id="QQ2-1-11">Installation from Source</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >4.5.1 <a 
href="#x1-120004.5.1" id="QQ2-1-12">Build DREAM for Linux/Unix</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >4.5.2 <a 
href="#x1-130004.5.2" id="QQ2-1-13">Build the DREAM mex-files for MacOS X (Intel Macs)</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >4.5.3 <a 
href="#x1-140004.5.3" id="QQ2-1-14">Build the DREAM Matlab 32-bit <span 
class="cmtt-10">mex</span>-files for Windows</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >4.5.4 <a 
href="#x1-150004.5.4" id="QQ2-1-15">Build the DREAM Octave 32-bit <span 
class="cmtt-10">oct</span>-files for Windows using the
MinGW Compiler</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >4.5.5 <a 
href="#x1-160004.5.5" id="QQ2-1-16">Build the DREAM 32-bit Octave <span 
class="cmtt-10">oct</span>-files for Windows using the
MSVC compiler (depreciated)</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >4.5.6 <a 
href="#x1-170004.5.6" id="QQ2-1-17">Build the DREAM matlab <span 
class="cmtt-10">mex</span>-files for 64-bit Windows</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >4.5.7 <a 
href="#x1-180004.5.7" id="QQ2-1-18">Build the DREAM Octave <span 
class="cmtt-10">oct</span>-files for 64-bit Windows</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >4.5.8 <a 
href="#x1-190004.5.8" id="QQ2-1-19">Compile with FFTW support for the Attenuation Code</a></span>
<br />   <span class="sectionToc" >5 <a 
href="#x1-200005" id="QQ2-1-20">An Introduction to The Impulse Response Method</a></span>
<br />   &#x00A0;<span class="subsectionToc" >5.1 <a 
href="#x1-210005.1" id="QQ2-1-21">The Baffled Piston Model and the Rayleigh integral</a></span>
<br />   &#x00A0;<span class="subsectionToc" >5.2 <a 
href="#x1-220005.2" id="QQ2-1-25">Discrete-time Spatial Impulse Responses</a></span>
<br />   &#x00A0;<span class="subsectionToc" >5.3 <a 
href="#x1-230005.3" id="QQ2-1-27">The Discrete Representation (DR) Computational Concept</a></span>
<br />   &#x00A0;<span class="subsectionToc" >5.4 <a 
href="#x1-240005.4" id="QQ2-1-29">Lossy Media</a></span>
<br />   <span class="sectionToc" >6 <a 
href="#x1-250006" id="QQ2-1-31">A Quick Start to DREAM Simulations</a></span>
<br />   <span class="sectionToc" >7 <a 
href="#x1-260007" id="QQ2-1-32">Transducer Function Reference</a></span>
<br />   &#x00A0;<span class="subsectionToc" >7.1 <a 
href="#x1-270007.1" id="QQ2-1-34">Input Parameters Common to all Transducer Functions</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.1.1 <a 
href="#x1-280007.1.1" id="QQ2-1-35">Observation Point(s) Parameter</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.1.2 <a 
href="#x1-290007.1.2" id="QQ2-1-36">Sampling Parameters</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.1.3 <a 
href="#x1-300007.1.3" id="QQ2-1-37">The Delay Parameter</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.1.4 <a 
href="#x1-310007.1.4" id="QQ2-1-38">Material Parameters</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.1.5 <a 
href="#x1-320007.1.5" id="QQ2-1-39">Focusing parameters</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.1.6 <a 
href="#x1-330007.1.6" id="QQ2-1-40">Error Handling</a></span>
<br />   &#x00A0;<span class="subsectionToc" >7.2 <a 
href="#x1-340007.2" id="QQ2-1-41">Output Parameters Common to all Transducer Functions</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.2.1 <a 
href="#x1-350007.2.1" id="QQ2-1-42">The SIR Output Argument</a></span>
                                                                                       
                                                                                       
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.2.2 <a 
href="#x1-360007.2.2" id="QQ2-1-43">The Error Output Argument</a></span>
<br />   &#x00A0;<span class="subsectionToc" >7.3 <a 
href="#x1-370007.3" id="QQ2-1-44">Single Element Transducers</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.3.1 <a 
href="#x1-380007.3.1" id="QQ2-1-45">Line (strip) Transducer</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.3.2 <a 
href="#x1-390007.3.2" id="QQ2-1-46">Rectangular Transducer</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.3.3 <a 
href="#x1-400007.3.3" id="QQ2-1-47">Rectangular Focused Transducer</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.3.4 <a 
href="#x1-410007.3.4" id="QQ2-1-48">Circular Transducer</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.3.5 <a 
href="#x1-420007.3.5" id="QQ2-1-49">Focused Circular Transducer</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.3.6 <a 
href="#x1-430007.3.6" id="QQ2-1-50">Spherical Concave Transducer</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.3.7 <a 
href="#x1-440007.3.7" id="QQ2-1-51">Spherical Convex Transducer</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.3.8 <a 
href="#x1-450007.3.8" id="QQ2-1-52">Cylindrical Concave Transducer</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.3.9 <a 
href="#x1-460007.3.9" id="QQ2-1-53">Cylindrical Convex Transducer</a></span>
<br />   &#x00A0;<span class="subsectionToc" >7.4 <a 
href="#x1-470007.4" id="QQ2-1-54">Input Parameters Common to the Array Functions</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.4.1 <a 
href="#x1-480007.4.1" id="QQ2-1-55">The Array Grid Matrix</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.4.2 <a 
href="#x1-490007.4.2" id="QQ2-1-56">Array Focusing</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.4.3 <a 
href="#x1-500007.4.3" id="QQ2-1-57">Beam Steering Parameters</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.4.4 <a 
href="#x1-510007.4.4" id="QQ2-1-58">Apodization Parameters</a></span>
<br />   &#x00A0;<span class="subsectionToc" >7.5 <a 
href="#x1-520007.5" id="QQ2-1-60">Array Transducers</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.5.1 <a 
href="#x1-530007.5.1" id="QQ2-1-61">Array with Rectangular Elements</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.5.2 <a 
href="#x1-540007.5.2" id="QQ2-1-62">Array with Circular Elements</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.5.3 <a 
href="#x1-550007.5.3" id="QQ2-1-63">Array with Cylindrical Concave Elements</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.5.4 <a 
href="#x1-560007.5.4" id="QQ2-1-64">Array with Cylindrical Convex Elements</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >7.5.5 <a 
href="#x1-570007.5.5" id="QQ2-1-65">Annular Array</a></span>
<br />   <span class="sectionToc" >8 <a 
href="#x1-580008" id="QQ2-1-66">Parallel Processing Support</a></span>
<br />   <span class="sectionToc" >9 <a 
href="#x1-590009" id="QQ2-1-68">Analytic Transducer Functions</a></span>
<br />   <span class="sectionToc" >10 <a 
href="#x1-6000010" id="QQ2-1-69">Misc Functions</a></span>
<br />   &#x00A0;<span class="subsectionToc" >10.1 <a 
href="#x1-6100010.1" id="QQ2-1-70">Apodization Windows</a></span>
<br />   &#x00A0;<span class="subsectionToc" >10.2 <a 
href="#x1-6200010.2" id="QQ2-1-71">Attenuation Response</a></span>
<br />   &#x00A0;<span class="subsectionToc" >10.3 <a 
href="#x1-6300010.3" id="QQ2-1-72">One Dimensional Matrix Convolution Functions</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >10.3.1 <a 
href="#x1-6400010.3.1" id="QQ2-1-73">Using Pre-computed FFTW Plans</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >10.3.2 <a 
href="#x1-6500010.3.2" id="QQ2-1-74">Using the In-place Mode</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >10.3.3 <a 
href="#x1-6600010.3.3" id="QQ2-1-75">Computing Array Responses for Arbitrary Input Signals</a></span>
<br />   &#x00A0;<span class="subsectionToc" >10.4 <a 
href="#x1-6700010.4" id="QQ2-1-76">Parallel Matrix Copy</a></span>
<br />   &#x00A0;<span class="subsectionToc" >10.5 <a 
href="#x1-6800010.5" id="QQ2-1-77">The Speed of Sound in Water</a></span>
<br />   <span class="sectionToc" >11 <a 
href="#x1-6900011" id="QQ2-1-78">Signal Processing Examples</a></span>
<br />   &#x00A0;<span class="subsectionToc" >11.1 <a 
href="#x1-7000011.1" id="QQ2-1-79">Double-path Modeling</a></span>
<br />   &#x00A0;<span class="subsectionToc" >11.2 <a 
href="#x1-7100011.2" id="QQ2-1-80">Synthetic Aperture Imaging &#x2014; The Synthetic Aperture Focusing Technique</a></span>
<br />   &#x00A0;<span class="subsectionToc" >11.3 <a 
href="#x1-7200011.3" id="QQ2-1-82">Delay-and-sum Imaging</a></span>
<br />   &#x00A0;<span class="subsectionToc" >11.4 <a 
href="#x1-7300011.4" id="QQ2-1-83">Model Based Ultrasonic Array Imaging</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >11.4.1 <a 
href="#x1-7400011.4.1" id="QQ2-1-84">The Matched Filter</a></span>
<br />   &#x00A0;&#x00A0;<span class="subsubsectionToc" >11.4.2 <a 
href="#x1-7500011.4.2" id="QQ2-1-85">The Optimal Linear Estimator</a></span>
                                                                                       
                                                                                       
<br />   <span class="sectionToc" >12 <a 
href="#x1-7600012" id="QQ2-1-86">The Graphical User Interface (Matlab only)</a></span>
<br />   <span class="sectionToc" >13 <a 
href="#x1-7700013" id="QQ2-1-88">Known Issues</a></span>
<br />   <span class="sectionToc" ><a 
href="#Q1-1-89">Bibliography</a></span>
<br />   <span class="sectionToc" >A <a 
href="#x1-79000A" id="QQ2-1-91">Building the Pthreads Library for 32 and 64 bit Windows</a></span>
<br />   <span class="sectionToc" >B <a 
href="#x1-80000B" id="QQ2-1-92">Building the FFTW Library for 32 and 64 bit Windows</a></span>
   </div>
<!--l. 287--><p class="indent" >
                                                                                       
                                                                                       
</p>
   <h3 class="sectionHead"><span class="titlemark">1   </span> <a 
 id="x1-20001"></a>Introduction</h3>
    <!--l. 296--><p class="noindent" ><span 
class="cmr-10x-x-277">T</span>HE DREAM (Discrete REpresentation Array Modeling) toolbox is an open source software, released
    under the GNU General Public License (GPL), for both <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;and Octave for simulating acoustic fields
radiated from common ultrasonic transducer types and arbitrarily complicated ultrasonic transducers arrays.
The DREAM toolbox enables analysis of beam steering, beam focusing, and apodization for wide band (pulse)
excitation both in near and far fields. The toolbox is also provided with a user friendly graphical user interface
(GUI).
</p><!--l. 303--><p class="indent" >   The toolbox consists of a set of routines for computing (discrete) spatial impulse response (SIRs) for various
single-element transducer geometries as well as multi-element transducer arrays. Based on linear systems theory,
these SIR functions can then be convolved with the transducer&#x2019;s electrical impulse response to obtain the
acoustic field at an observation point. Using the DREAM toolbox one can simulate ultrasonic measurement
systems for many configurations including phased arrays and measurements performed in lossy
media.
</p><!--l. 312--><p class="indent" >   The DREAM toolbox uses a numerical procedure based on based on the discrete representation (DR)
computational concept&#x00A0;[<a 
href="#XPiwakowski1989">1</a>, <a 
href="#XPiwakowski1999">2</a>] which is a method based on the general approach of the spatial impulse
responses&#x00A0;[<a 
href="#XTupholme1969">3</a>, <a 
href="#XStepanishen1971a">4</a>].
</p><!--l. 324--><p class="noindent" >
</p>
   <h3 class="sectionHead"><span class="titlemark">2   </span> <a 
 id="x1-30002"></a>Copyright</h3>
    <!--l. 326--><p class="noindent" ><span 
class="cmr-10x-x-277">T</span>HE DREAM toolbox is an open source software and the source code for the toolbox is freely redistributable
    under the terms of the GNU General Public License (GPL) as published by the Free Software
Foundation (<a 
href="http://www.gnu.org" class="url" ><span 
class="cmtt-10">http://www.gnu.org</span></a>). See also the file <span 
class="cmtt-10">COPYING </span>which is distributed with the DREAM
Toolbox.
</p><!--l. 331--><p class="indent" >   The DREAM Toolbox can be downloaded at: <a 
href="http://www.signal.uu.se/Toolbox/dream/" class="url" ><span 
class="cmtt-10">http://www.signal.uu.se/Toolbox/dream/</span></a>. At this website
you can also find information how to contact the authors and report bugs etc.
</p><!--l. 338--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">2.1   </span> <a 
 id="x1-40002.1"></a>Disclaimer</h4>
<!--l. 341--><p class="noindent" >The DREAM toolbox is distributed in the hope that it will be useful but WITHOUT ANY WARRANTY. More
specifically:
     </p><div class="quote">
     <!--l. 345--><p class="noindent" ><span 
class="cmr-8">THE PROGRAM IS PROVIDED &#x201C;AS-IS&#x201D; WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS</span>
     <span 
class="cmr-8">OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OR CONDITIONS</span>
     <span 
class="cmr-8">OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL ANY</span>
     <span 
class="cmr-8">OF THE AUTHORS OF THE DREAM TOOLBOX AND/OR THE DEPARTMENT OF ENGINEERING</span>
     <span 
class="cmr-8">SCIENCES  AT  UPPSALA  UNIVERSITY,  SWEDEN,  OR  THE  INSTITUT  D&#x2019;ELECTRONIQUE  ET</span>
     <span 
class="cmr-8">DE  MICRU-ELECTRONIQUE  DU  NORD  (IEMN-DOAE-UMR  CNRS  9929),  ECOLE  CENTRALE  DE</span>
     <span 
class="cmr-8">LILLE, FRANCE, BE LIABLE FOR ANY SPECIAL, INCIDENTAL, INDIRECT, OR CONSEQUENTIAL</span>
     <span 
class="cmr-8">DAMAGES OF ANY KIND, OR DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA,</span>
     <span 
class="cmr-8">OR  PROFITS,  WHETHER  OR  NOT  THE  AUTHORS  OF  THE  DREAM  TOOLBOX  HAVE  BEEN</span>
     <span 
class="cmr-8">ADVISED OF THE POSSIBILITY OF SUCH DAMAGES, AND/OR ON ANY THEORY OF LIABILITY</span>
                                                                                       
                                                                                       
     <span 
class="cmr-8">ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.</span></p></div>
<!--l. 356--><p class="noindent" >
</p>
   <h3 class="sectionHead"><span class="titlemark">3   </span> <a 
 id="x1-50003"></a>System Requirements</h3>
<!--l. 358--><p class="noindent" >
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-5002x1"><span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;<!--l. 360--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mo 
class="MathClass-rel">&#x2265;</mo></math>
     7.1 or,
     </li>
     <li 
  class="enumerate" id="x1-5004x2"><a 
href="http://www.octave.org" >Octave</a> <!--l. 362--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mo 
class="MathClass-rel">&#x2265;</mo></math>
     2.9.12 ( <!--l. 362--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mo 
class="MathClass-rel">&#x2265;</mo></math>
     3.2.0 recommended).<span class="footnote-mark"><a 
href="userman2.xml#fn1x0"><sup class="textsuperscript">1</sup></a></span><a 
 id="x1-5005f1"></a> 
     </li>
     <li 
  class="enumerate" id="x1-5007x3"><a 
href="http://www.fftw.org" >FFTW</a> <!--l. 368--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mo 
class="MathClass-rel">&#x2265;</mo></math>
     3.0.1 (optional).<span class="footnote-mark"><a 
href="userman3.xml#fn2x0"><sup class="textsuperscript">2</sup></a></span><a 
 id="x1-5008f2"></a> 
     </li>
     <li 
  class="enumerate" id="x1-5010x4">Pthread.<span class="footnote-mark"><a 
href="userman4.xml#fn3x0"><sup class="textsuperscript">3</sup></a></span><a 
 id="x1-5011f3"></a> 
     </li></ol>
<!--l. 377--><p class="noindent" >
</p>
   <h3 class="sectionHead"><span class="titlemark">4   </span> <a 
 id="x1-60004"></a>Installation</h3>
    <!--l. 379--><p class="noindent" ><span 
class="cmr-10x-x-277">T</span>HE DREAM Toolbox can be installed both using pre-compiled binaries and from source code. Binaries are
    currently available for Linux (x86/x86_64), Windows (x86), and for Intel Macs (Mac OS X). The binaries
are compiled using generic compiler flags and without support for the fftw library (for the transducer functions)
and should, therefore, run on most setups.
</p><!--l. 384--><p class="indent" >   If you want higher performance then it is recommended that you compile DREAM from source. There is a
bash script and m-files included in the source distribution to facilitate building the toolbox and,
furthermore, the <span 
class="cmtt-10">Makefile</span>s used in build process can easily be edited for further fine tuning of the
performance.
                                                                                       
                                                                                       
</p><!--l. 389--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">4.1   </span> <a 
 id="x1-70004.1"></a>Binary Installation (Matlab only)</h4>
<!--l. 391--><p class="noindent" >
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-7002x1">Download the <span 
class="cmtt-10">dream-xxx-2.x.x.tgz </span>file, or <span 
class="cmtt-10">dream-xxx-2.x.x.zip </span>file, using your favorite browser
     (where <span 
class="cmtt-10">xxx </span>replaced by the hardware architecture (<span 
class="cmtt-10">unix </span>[32/64], <span 
class="cmtt-10">win</span>, or <span 
class="cmtt-10">maci</span>) and the <span 
class="cmtt-10">2.x.x </span>is
     replaced by the actual version number of the toolbox).
     </li>
     <li 
  class="enumerate" id="x1-7004x2">Copy the file to a suitable directory on your disk and uncompress the file:
         <dl class="description"><dt class="description">
     <span 
class="cmbx-10">Windows:</span> </dt><dd 
class="description">Use <span 
class="cmtt-10">Winzip </span>or <span 
class="cmtt-10">Winrar</span>.
         </dd><dt class="description">
     <span 
class="cmbx-10">Linux:</span> </dt><dd 
class="description">Type <span 
class="cmtt-10">tar xvzf dream-xxx-2.x.x.tgz </span>(or <span 
class="cmtt-10">gunzip dream-xxx-2.x.x.zip</span>).</dd></dl>
     </li>
     <li 
  class="enumerate" id="x1-7006x3">Add the new directory into the <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>path. This can be performed by choosing the <span 
class="cmti-10">Set Path </span>command
     from the <span 
class="cmbx-10">File menu </span>(<span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;only) or using the <span 
class="cmtt-10">addpath </span>command. On Linux you can add the line
     <span 
class="cmtt-10">addpath(&#x2019;/</span><span 
class="cmti-10">your</span><span 
class="cmti-10">_installation</span><span 
class="cmti-10">_dir</span><span 
class="cmtt-10">/)&#x2019; </span>to your <span 
class="cmtt-10">startup.m </span>file.</li></ol>
<!--l. 410--><p class="noindent" >Note: since the oct-API often changes between releases of Octave the binaries will probably only work for the
version of Octave that they were compiled for. For this reason binaries for Octave are no longer available and
you need to install the toolbox from source which easily can be done with the Octave <span 
class="cmtt-10">pkg </span>command (see
Section&#x00A0;<a 
href="#x1-100004.4">4.4<!--tex4ht:ref: sec:oct-install --></a>).
</p><!--l. 415--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">4.2   </span> <a 
 id="x1-80004.2"></a>Windows Specific Installation Notes</h4>
<!--l. 418--><p class="noindent" >If you want to use the parallel (threaded) DREAM functions you need to install the Pthreads-Win32 library.
Download the library from: <a 
href="http://sourceware.org/pthreads-win32/" class="url" ><span 
class="cmtt-10">http://sourceware.org/pthreads-win32/</span></a> and put the <br 
class="newline" /><a 
href="ftp://sourceware.org/pub/pthreads-win32/dll-latest/lib/pthreadGC2.dll" >pthreadGC2.dll</a> file in a suitable directory, such as,
<span 
class="cmtt-10">C:</span><!--l. 426--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">WINDOWS</span><!--l. 426--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">System32</span>;
this file is now also available on the DREAM web page. If you want to build the Pthreads library for Windows
from source then you can find instructions in Appendix&#x00A0;<a 
href="#x1-79000A">A<!--tex4ht:ref: sec:build_pthreads-windows --></a>.
</p><!--l. 431--><p class="indent" >   The <span 
class="cmtt-10">fftconv</span><span 
class="cmtt-10">_p </span>and <span 
class="cmtt-10">sum</span><span 
class="cmtt-10">_fftconv</span><span 
class="cmtt-10">_p </span>use the FFTW3 library (see Section&#x00A0;<a 
href="#x1-6300010.3">10.3<!--tex4ht:ref: sec:misc-conv --></a>). A Windows
version of this library can be found at: <a 
href="http://www.fftw.org/install/windows.html" class="url" ><span 
class="cmtt-10">http://www.fftw.org/install/windows.html</span></a>
but it is now also available on the DREAM web page. Copy the <span 
class="cmtt-10">libfftw3-3.dll </span>file to
<span 
class="cmtt-10">C:</span><!--l. 441--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">WINDOWS</span><!--l. 441--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">System32</span>.
If you want to build the FFTW library for Windows from source then you can find instructions in
Appendix&#x00A0;<a 
href="#x1-80000B">B<!--tex4ht:ref: sec:build_fftw-windows --></a>.
</p><!--l. 445--><p class="indent" >   To install DREAM for Octave on Windows see Sections&#x00A0;<a 
href="#x1-150004.5.4">4.5.4<!--tex4ht:ref: sec:win_octave_mingw --></a> and&#x00A0;<a 
href="#x1-160004.5.5">4.5.5<!--tex4ht:ref: sec:win_octave_msvc --></a>.
</p><!--l. 447--><p class="noindent" >
</p>
                                                                                       
                                                                                       
   <h4 class="subsectionHead"><span class="titlemark">4.3   </span> <a 
 id="x1-90004.3"></a>MacOS X Specific Installation Notes</h4>
<!--l. 450--><p class="noindent" >The <span 
class="cmtt-10">fftconv</span><span 
class="cmtt-10">_p </span>and <span 
class="cmtt-10">sum</span><span 
class="cmtt-10">_fftconv</span><span 
class="cmtt-10">_p </span>functions use the FFTW3 library (see Section&#x00A0;<a 
href="#x1-6300010.3">10.3<!--tex4ht:ref: sec:misc-conv --></a>). Instructions for
installing fftw on MacOS X can be found at:
</p><!--l. 453--><p class="indent" >   <a 
href="http://www.fftw.org/install/mac.html" class="url" ><span 
class="cmtt-10">http://www.fftw.org/install/mac.html</span></a>
</p><!--l. 458--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">4.4   </span> <a 
 id="x1-100004.4"></a>Octave Specific Installation Notes</h4>
<!--l. 461--><p class="noindent" >As mentioned above, the DREAM Toolbox must be installed from sources for Octave. Recent versions of Octave
have a package manager tool (<span 
class="cmtt-10">pkg</span>) for that purpose. Given that you have the developer tools for your
system installed (for Windows see Sections&#x00A0;<a 
href="#x1-150004.5.4">4.5.4<!--tex4ht:ref: sec:win_octave_mingw --></a> and&#x00A0;<a 
href="#x1-160004.5.5">4.5.5<!--tex4ht:ref: sec:win_octave_msvc --></a>) you should be able to install DREAM
by,
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-10002x1">Download the special DREAM source code file for the Octave package manager,
     </li>
     <li 
  class="enumerate" id="x1-10004x2">type: <span 
class="cmtt-10">pkg install dream-2.x.x.tar.gz </span>at the Octave command line.<span class="footnote-mark"><a 
href="userman5.xml#fn4x0"><sup class="textsuperscript">4</sup></a></span><a 
 id="x1-10005f4"></a> 
     </li></ol>
<!--l. 474--><p class="noindent" >You should now be able to see the DREAM packege by typing:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-1">
&#x00A0;&#x00A0;pkg&#x00A0;list
</div>
<!--l. 477--><p class="nopar" > at the Octave command line.
</p><!--l. 481--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">4.5   </span> <a 
 id="x1-110004.5"></a>Installation from Source</h4>
<!--l. 484--><p class="noindent" >To build the DREAM Toolbox from sources you need to have developer tools installed for your system
(compiler, linker, etc.). Start with downloading (and uncompressing) the (full) source <span 
class="cmtt-10">DREAM-2.x.x.tgz </span>file.
This file contains the source code, the documentation (the user manual), and the html code for the web pages.
The build process is based on Makefiles both for C/C++ code and for building the (<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span 
class="E">E</span>X</span></span>) user manual and
html documentation. Therefore, to build the documentation you need to have <span class="TEX">T<span 
class="E">E</span>X</span>/<span class="LATEX">L<span class="A">A</span><span class="TEX">T<span 
class="E">E</span>X</span></span>&#x00A0;installed
and, furthermore, to build the html documentation you also need the <a 
href="http://www.cse.ohio-state.edu/~gurari/TeX4ht/mn.html" >tex4ht</a> and <a 
href="http://www.andre-simon.de/" >highlight</a>
tools.<span class="footnote-mark"><a 
href="userman6.xml#fn5x0"><sup class="textsuperscript">5</sup></a></span><a 
 id="x1-11001f5"></a> 
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">4.5.1   </span> <a 
 id="x1-120004.5.1"></a>Build DREAM for Linux/Unix</h5>
<!--l. 501--><p class="noindent" >There are three methods that can be used to build the DREAM Toolbox on unix from sources. The first,
and simplest, is to use the m-script <span 
class="cmtt-10">build</span><span 
class="cmtt-10">_mexfiles</span><span 
class="cmtt-10">_unix.m</span>, the second is to use the bash script
<span 
class="cmtt-10">build</span><span 
class="cmtt-10">_dream.sh </span>and the third is to manually edit the build configuration file <span 
class="cmtt-10">Make.inc </span>and then compile the
sources.
</p><!--l. 506--><p class="noindent" ><span 
class="cmti-10">Method 1: </span>Using the <span 
class="cmtt-10">build</span><span 
class="cmtt-10">_mexfiles</span><span 
class="cmtt-10">_unix.m </span>script.
</p><!--l. 508--><p class="indent" >   This is the simplest method but there is no optimization for the used architecture and the attenuation code
is build without fftw support (see Section&#x00A0;<a 
href="#x1-190004.5.8">4.5.8<!--tex4ht:ref: sec:fftw --></a>). This will also only build the mex-files (not the
oct-files).
</p><!--l. 512--><p class="indent" >
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-12002x1">Install <a 
href="http://www.fftw.org" >fftw</a> (if it is not already installed).
     </li>
     <li 
  class="enumerate" id="x1-12004x2">Start <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;and select compiler (gcc is recommended) with <span 
class="cmtt-10">mex -setup </span>(if you have not already
     done so).
     </li>
     <li 
  class="enumerate" id="x1-12006x3">Remove the <span 
class="cmtt-10">-ansi </span>flag from your
                                                                                       
                                                                                       
     <div class="verbatim" id="verbatim-2">
     ~/.matlab/R200Xx/mexopts.sh
</div>
     <!--l. 520--><p class="nopar" > file (the DREAM sources contain C++ style comments and they will not compile with <span 
class="cmtt-10">-ansi</span>).
     </p></li>
     <li 
  class="enumerate" id="x1-12008x4">Run the m-script: <span 
class="cmtt-10">build</span><span 
class="cmtt-10">_mexfiles</span><span 
class="cmtt-10">_unix</span>
     </li>
     <li 
  class="enumerate" id="x1-12010x5">Copy the files in the <span 
class="cmtt-10">gui </span>and <span 
class="cmtt-10">help</span><span 
class="cmtt-10">_m</span><span 
class="cmtt-10">_files </span>directories to your DREAM install directory.
     </li>
     <li 
  class="enumerate" id="x1-12012x6">Add your DREAM install directory to the <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;path. That is, add<br 
class="newline" /><span 
class="cmtt-10">addpath(&#x2019;/</span><span 
class="cmti-10">your</span><span 
class="cmti-10">_installation</span><span 
class="cmti-10">_dir</span><span 
class="cmtt-10">/&#x2019;)</span>to your <span 
class="cmtt-10">matlab/startup.m </span>file.
     </li></ol>
<!--l. 536--><p class="noindent" ><span 
class="cmti-10">Method 2: </span>Using the <span 
class="cmtt-10">build</span><span 
class="cmtt-10">_dream.sh </span>bash script.
</p><!--l. 538--><p class="indent" >   The bash script <span 
class="cmtt-10">build</span><span 
class="cmtt-10">_dream.sh </span>will probe the machine for cpu, architecture (32 or 64 bits) and then use a
pre-defined set of compiler flags for the machine (currently only x86 is supported). This script will both build the
mex-/oct-interfaces and the documentation for DREAM. It is assumed that <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;is installed in
<span 
class="cmtt-10">/usr/local/matlab</span>. If you have installed <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;somewhere else then you can create a symbolic link to the
<span 
class="cmtt-10">/usr/local/matlab </span>dir. Usage:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-3">
./build_dream.sh
</div>
<!--l. 546--><p class="nopar" > Then add your DREAM install directory to the <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>/Octave path(s). That is, add<br 
class="newline" /><span 
class="cmtt-10">addpath(&#x2019;/</span><span 
class="cmti-10">your</span><span 
class="cmti-10">_installation</span><span 
class="cmti-10">_dir</span><span 
class="cmtt-10">/&#x2019;) </span>to your <span 
class="cmtt-10">matlab/startup.m </span>file and/or <span 
class="cmtt-10">.octaverc </span>file.
</p><!--l. 552--><p class="noindent" ><span 
class="cmti-10">Method 3: </span>Manual configuration.
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-12014x1">Copy <span 
class="cmtt-10">Make.default </span>to <span 
class="cmtt-10">Make.inc</span>, and open the <span 
class="cmtt-10">Make.inc </span>file with a text-editor.
     </li>
     <li 
  class="enumerate" id="x1-12016x2">Change the paths for Matlab and/or Octave in <span 
class="cmtt-10">Make.inc </span>to fit your installation.
     </li>
     <li 
  class="enumerate" id="x1-12018x3">Change <span 
class="cmtt-10">INSTALL</span><span 
class="cmtt-10">_DIR</span>, <span 
class="cmtt-10">MEX</span><span 
class="cmtt-10">_EXT </span>(if you use <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>), <span 
class="cmtt-10">CFLAGS</span>, and <span 
class="cmtt-10">OCTVER </span>(if you use Octave) in
     <span 
class="cmtt-10">Make.inc </span>to fit your architecture.
     </li>
     <li 
  class="enumerate" id="x1-12020x4">If you don&#x2019;t have both Matlab and Octave then open the <span 
class="cmtt-10">Makefile </span>and remove the corresponding
     software on the line &#x201C;<span 
class="cmtt-10">all: matlab octave doc</span>&#x201D; that you don&#x2019;t use.
     </li>
     <li 
  class="enumerate" id="x1-12022x5">Type <span 
class="cmtt-10">make</span>
     </li>
     <li 
  class="enumerate" id="x1-12024x6">Add your DREAM install dir to the <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>/Octave path(s). That is, add<br 
class="newline" /><span 
class="cmtt-10">addpath(&#x2019;/</span><span 
class="cmti-10">your</span><span 
class="cmti-10">_installation</span><span 
class="cmti-10">_dir</span><span 
class="cmtt-10">/&#x2019;) </span>to your <span 
class="cmtt-10">matlab/startup.m </span>file and/or <span 
class="cmtt-10">.octaverc </span>file.</li></ol>
<!--l. 575--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">4.5.2   </span> <a 
 id="x1-130004.5.2"></a>Build the DREAM mex-files for MacOS X (Intel Macs)</h5>
<!--l. 577--><p class="noindent" >There is currently only one method to build the DREAM mex-files for MacOS X and that is to use the
<span 
class="cmtt-10">build</span><span 
class="cmtt-10">_mexfiles</span><span 
class="cmtt-10">_unix.m </span>script (the <span 
class="cmtt-10">Makefile</span>s do not currently work under Mac OS X).
</p><!--l. 581--><p class="indent" >
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-13002x1">Install <a 
href="http://www.fftw.org/install/mac.html" >fftw</a> (if it is not already installed).
     </li>
     <li 
  class="enumerate" id="x1-13004x2">Start <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;and select compiler (gcc is recommended) with <span 
class="cmtt-10">mex -setup </span>(if you have not already
     done so).
     </li>
     <li 
  class="enumerate" id="x1-13006x3">Remove the <span 
class="cmtt-10">-ansi </span>flag from your
                                                                                       
                                                                                       
     <div class="verbatim" id="verbatim-4">
     ~/.matlab/R200Xx/mexopts.sh
</div>
     <!--l. 590--><p class="nopar" > file (the DREAM sources contain C++ style comments which will not compile with <span 
class="cmtt-10">-ansi</span>).
     </p></li>
     <li 
  class="enumerate" id="x1-13008x4">Run the m-script: <span 
class="cmtt-10">build</span><span 
class="cmtt-10">_mexfiles</span><span 
class="cmtt-10">_unix</span>
     </li>
     <li 
  class="enumerate" id="x1-13010x5">Copy the files in the <span 
class="cmtt-10">gui </span>and <span 
class="cmtt-10">help</span><span 
class="cmtt-10">_m</span><span 
class="cmtt-10">_files </span>directories to your DREAM install directory.
     </li>
     <li 
  class="enumerate" id="x1-13012x6">Add your DREAM install directory to your <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;path. That is, add <br 
class="newline" /><span 
class="cmtt-10">addpath(&#x2019;/</span><span 
class="cmti-10">your</span><span 
class="cmti-10">_installation</span><span 
class="cmti-10">_dir </span>to your <span 
class="cmtt-10">matlab/startup.m </span>file (or use the menu in the
     <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;GUI).
     </li></ol>
<!--l. 607--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">4.5.3   </span> <a 
 id="x1-140004.5.3"></a>Build the DREAM Matlab 32-bit <span 
class="cmtt-10">mex</span>-files for Windows</h5>
<!--l. 609--><p class="noindent" ><span 
class="cmti-10">Method 1: </span>Using the MinGW/Gnumex Tools.
</p><!--l. 613--><p class="indent" >
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-14002x1"><a 
href="http://www.signal.uu.se/Toolbox/dream/download.shtml" >Download</a> the DREAM Toolbox full source package and uncompress it.
     </li>
     <li 
  class="enumerate" id="x1-14004x2">Install MinGW and the Gnumex tools (see <a 
href="http://www.mingw.org/" class="url" ><span 
class="cmtt-10">http://www.mingw.org/</span></a> and <br 
class="newline" /><a 
href="http://gnumex.sourceforge.net/" class="url" ><span 
class="cmtt-10">http://gnumex.sourceforge.net/</span></a>).
     </li>
     <li 
  class="enumerate" id="x1-14006x3">Gnumex is normally setup by running the <span 
class="cmtt-10">gnumex.m </span>script, which is located in the main Gnumex
     directory, from the Matlab promt which generates a <span 
class="cmtt-10">mexopts.bat </span>file for the Matlab <span 
class="cmtt-10">mex </span>command.
     The <span 
class="cmtt-10">windows/mexopts/ </span>directory contains three pre-build <span 
class="cmtt-10">bat</span>-files (for MinGW 3.4.5 and Gnumex
     2.1.0) which is used to build the toolbox and link with the fftw and Pthread-Win32 libs. You need
     to edit the <span 
class="cmtt-10">mexopts</span><span 
class="cmtt-10">_mingw.bat</span>, <span 
class="cmtt-10">mexopts</span><span 
class="cmtt-10">_pthread</span><span 
class="cmtt-10">_mingw.bat</span>, and <br 
class="newline" /><span 
class="cmtt-10">mexopts</span><span 
class="cmtt-10">_pthread</span><span 
class="cmtt-10">_fftw</span><span 
class="cmtt-10">_mingw.bat </span>files for your installation, that is, set paths to your DREAM
     source directory, MinGW directories, and Gnumex directories, respectively. The lines you need to
     make changes in are indicated with numbers 1)&#x2013;7) in the respective <span 
class="cmtt-10">bat</span>-file.
     </li>
     <li 
  class="enumerate" id="x1-14008x4">Start  <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;and  run  the  m-script  <span 
class="cmtt-10">build</span><span 
class="cmtt-10">_mexfiles</span><span 
class="cmtt-10">_mingw.m </span>(in  the  main  DREAM  source
     directory).<span class="footnote-mark"><a 
href="userman7.xml#fn6x0"><sup class="textsuperscript">6</sup></a></span><a 
 id="x1-14009f6"></a> 
                                                                                       
                                                                                       
     </li>
     <li 
  class="enumerate" id="x1-14011x5">Copy the files in the <span 
class="cmtt-10">gui </span>and <span 
class="cmtt-10">help</span><span 
class="cmtt-10">_m</span><span 
class="cmtt-10">_files </span>directory to your DREAM install directory.
     </li>
     <li 
  class="enumerate" id="x1-14013x6">Add your DREAM install directory to your <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;path. That is, add <br 
class="newline" /><span 
class="cmtt-10">addpath(&#x2019;/</span><span 
class="cmti-10">your</span><span 
class="cmti-10">_installation</span><span 
class="cmti-10">_dir  </span><span 
class="cmtt-10">&#x2019;) </span>to  your  <span 
class="cmtt-10">matlab/startup.m </span>file  (or  use  the  menu  in  the
     <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;GUI).
     </li>
     <li 
  class="enumerate" id="x1-14015x7">Copy the files <span 
class="cmtt-10">pthreadGC2.dll </span>(for gcc) and <span 
class="cmtt-10">libfftw3-3.dll </span>to <span 
class="cmtt-10">C:</span><!--l. 660--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">WINDOWS</span><!--l. 660--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">System32</span>.
     </li></ol>
<!--l. 664--><p class="noindent" ><span 
class="cmti-10">Method 2: </span>Using the MSVC 2008 Express Edition
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-14017x1"><a 
href="http://www.signal.uu.se/Toolbox/dream/download.shtml" >Download</a> the DREAM Toolbox full source package and uncompress it.
     </li>
     <li 
  class="enumerate" id="x1-14019x2">Start <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;and select compiler with <span 
class="cmtt-10">mex -setup </span>(if you have not already done so). If Matlab
     cannot find the MSVC 2008 compiler then read this   <a 
href="http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=18508" >page</a>.   Then, after you have installed the
     <span 
class="cmtt-10">bat</span>-files in their corresponding directories, you need to set the env variable <span 
class="cmtt-10">MSSdk </span>for the Windows
     SDK to, for example, <span 
class="cmtt-10">C:</span><!--l. 681--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">Program</span>
     <span 
class="cmtt-10">Files</span><!--l. 681--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">Microsoft</span>
     <span 
class="cmtt-10">SDKs</span><!--l. 681--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">Windows</span><!--l. 681--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">v6.1</span>.
     On Windows XP, this is done by first &#x201C;right-clicking&#x201D; on<br 
class="newline" /><span 
class="cmti-10">My Computer </span>and then selecting <span 
class="cmti-10">Properties</span><!--l. 683--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mo 
class="MathClass-rel">&#x2192;</mo></math><span 
class="cmti-10">Advanced</span><!--l. 683--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mo 
class="MathClass-rel">&#x2192;</mo></math><span 
class="cmti-10">Environment</span>
     <span 
class="cmti-10">Variables</span><!--l. 683--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mo 
class="MathClass-rel">&#x2192;</mo></math><span 
class="cmti-10">New</span>
     and, second, add the <span 
class="cmtt-10">MSSdk </span>variable and the path to the Windows SDK that you use (you may need
     to reboot to make the new variable visible). On Windows Vista, go to the start meny, &#x201C;right-click&#x201D; on
     <span 
class="cmti-10">Computer </span>and then select <span 
class="cmti-10">Properties</span><!--l. 686--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mo 
class="MathClass-rel">&#x2192;</mo></math><span 
class="cmti-10">Advanced</span>
     <span 
class="cmti-10">system settings</span><!--l. 686--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mo 
class="MathClass-rel">&#x2192;</mo></math><span 
class="cmti-10">Environment</span>
     <span 
class="cmti-10">Variables...</span><!--l. 686--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mo 
class="MathClass-rel">&#x2192;</mo></math><span 
class="cmti-10">New...</span>
     and add <span 
class="cmtt-10">MSSdk </span>and the path to the Windows SDK.
     </li>
     <li 
  class="enumerate" id="x1-14021x3">Run the m-script: <span 
class="cmtt-10">build</span><span 
class="cmtt-10">_mexfiles</span><span 
class="cmtt-10">_msvc.m</span>
     </li>
     <li 
  class="enumerate" id="x1-14023x4">Copy the files in the <span 
class="cmtt-10">gui </span>and <span 
class="cmtt-10">help</span><span 
class="cmtt-10">_m</span><span 
class="cmtt-10">_files </span>directories to your DREAM install directory.
     </li>
     <li 
  class="enumerate" id="x1-14025x5">Add your DREAM install directory to your <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;path. That is, add <br 
class="newline" /><span 
class="cmtt-10">addpath(&#x2019;/</span><span 
class="cmti-10">your</span><span 
class="cmti-10">_installation</span><span 
class="cmti-10">_dir  </span><span 
class="cmtt-10">&#x2019;) </span>to  your  <span 
class="cmtt-10">matlab/startup.m </span>file  (or  use  the  menu  in  the
     <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;GUI).
     </li>
     <li 
  class="enumerate" id="x1-14027x6">Copy the files <span 
class="cmtt-10">pthreadGC2.dll </span>and <span 
class="cmtt-10">libfftw3-3.dll </span>to <span 
class="cmtt-10">C:</span><!--l. 698--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">WINDOWS</span><!--l. 698--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">System32</span>.
     </li></ol>
<!--l. 702--><p class="noindent" ><span 
class="cmti-10">Method 3: </span>Matlab&#x2019;s build-in LCC compiler (depreciated).
</p><!--l. 704--><p class="indent" >
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-14029x1"><a 
href="http://www.signal.uu.se/Toolbox/dream/download.shtml" >Download</a> the DREAM Toolbox full source package and uncompress it.
                                                                                       
                                                                                       
     </li>
     <li 
  class="enumerate" id="x1-14031x2">Start <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;and select compiler with <span 
class="cmtt-10">mex -setup </span>(if you have not already done so).
     </li>
     <li 
  class="enumerate" id="x1-14033x3">Run the m-script: <span 
class="cmtt-10">build</span><span 
class="cmtt-10">_mexfiles</span><span 
class="cmtt-10">_windows.m</span>
     </li>
     <li 
  class="enumerate" id="x1-14035x4">Copy the files in the <span 
class="cmtt-10">gui </span>and <span 
class="cmtt-10">help</span><span 
class="cmtt-10">_m</span><span 
class="cmtt-10">_files </span>directories to your DREAM install directory.
     </li>
     <li 
  class="enumerate" id="x1-14037x5">Add your DREAM install directory to your <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;path. That is, add <br 
class="newline" /><span 
class="cmtt-10">addpath(&#x2019;/</span><span 
class="cmti-10">your</span><span 
class="cmti-10">_installation</span><span 
class="cmti-10">_dir</span><span 
class="cmtt-10">&#x2019;) </span>to  your  <span 
class="cmtt-10">matlab/startup.m </span>file  (or  use  the  menu  in  the
     <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;GUI).
     </li></ol>
<!--l. 721--><p class="indent" >   Note the LCC compiler, at least LCC for Matlab R2007b, cannot build the parallel <span 
class="cmtt-10">mex</span>-functions since the
compiler cannot parse the Pthread-Win32 header files. All parallel functions will, therefore, be unavailable if you
are using the LCC compiler.
</p><!--l. 729--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">4.5.4   </span> <a 
 id="x1-150004.5.4"></a>Build the DREAM Octave 32-bit <span 
class="cmtt-10">oct</span>-files for Windows using the MinGW Compiler</h5>
<!--l. 732--><p class="noindent" >The pkg source can be build also on Windows with resent versions of Octave (tested with Octave 3.2.3
[MinGW 4.4.0]). To do this, using the native Windows Octave from <a 
href="http://octave.sourceforge.net" >octave-forge</a>, you only need to
install Octave since fftw, the MinGW compiler, and the pthread libs are included in the Octave
package).
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-15002x1"><a 
href="http://www.signal.uu.se/Toolbox/dream/download.shtml" >Download</a> the DREAM Toolbox <span 
class="cmtt-10">pkg </span>source package (i.e., the file <span 
class="cmtt-10">dream-2.x.x.tar.gz</span>).
     </li>
     <li 
  class="enumerate" id="x1-15004x2">Download the Windows <a 
href="http://octave.sourceforge.net" >Octave</a> installer.
     </li>
     <li 
  class="enumerate" id="x1-15006x3">Install Octave in <span 
class="cmtt-10">C:</span><!--l. 744--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">Octave</span>;
     do not install in <span 
class="cmtt-10">C:</span><!--l. 745--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">Program</span>
     <span 
class="cmtt-10">Files</span><!--l. 745--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">Octave</span>
     since the <span 
class="cmtt-10">mkoctfile </span>script that is used to compile the C++ code in the DREAM toolbox do work
     well with white spaces in the path (the default install location should be OK).
     </li>
     <li 
  class="enumerate" id="x1-15008x4">Build and install the DREAM Toolbox with: <span 
class="cmtt-10">pkg install dream-2.x.x.tar.gz</span>.
     </li></ol>
<!--l. 775--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">4.5.5   </span> <a 
 id="x1-160004.5.5"></a>Build the DREAM 32-bit Octave <span 
class="cmtt-10">oct</span>-files for Windows using the MSVC compiler (depreciated)</h5>
                                                                                       
                                                                                       
<!--l. 778--><p class="noindent" >This section describes how to build the DREAM oct-files for Windows using the MSVC compiler. But note that,
as of spring 2009, Octave binaries build with the MSVC compiler are no longer available at <a 
href="http://octave.sourceforge.net" >octave-forge</a> due to
license issues. It is therefore recomended that the MinGW compiler is used instead as described in
Section&#x00A0;<a 
href="#x1-150004.5.4">4.5.4<!--tex4ht:ref: sec:win_octave_mingw --></a>! To use MSVC one therefore needs an older MSVC build binary of Octave or one has to
build Octave (and all its dependencies) using the MSVC compiler and then follow the procedure
below:
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-16002x1"><a 
href="http://www.signal.uu.se/Toolbox/dream/download.shtml" >Download</a> the DREAM Toolbox <span 
class="cmtt-10">pkg </span>source package and uncompress it.
     </li>
     <li 
  class="enumerate" id="x1-16004x2">Download the <a 
href="http://octave.sourceforge.net" >MSVC version of Octave</a> (build with the Microsoft Visual C++ 2008 Express Edition
     compiler).
     </li>
     <li 
  class="enumerate" id="x1-16006x3">Install Octave in <span 
class="cmtt-10">C:</span><!--l. 795--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">Octave</span>;
     do not install in <span 
class="cmtt-10">C:</span><!--l. 796--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">Program</span>
     <span 
class="cmtt-10">Files</span><!--l. 796--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">Octave</span>
     since the <span 
class="cmtt-10">mkoctfile </span>script that is used to compile the C++ code in the DREAM toolbox do work
     well with white spaces in the path.
     </li>
     <li 
  class="enumerate" id="x1-16008x4">Install <a 
href="http://msdn.microsoft.com/vstudio/express/visualc/" >Microsoft Visual C++ 2008 Express Edition</a>
     </li>
     <li 
  class="enumerate" id="x1-16010x5">Get the <span 
class="cmtt-10">fftw3.h </span>file (for version 3.2.2) from <a 
href="http://www.fftw.org" class="url" ><span 
class="cmtt-10">http://www.fftw.org</span></a>, or from <a 
href="http://www.signal.uu.se/Toolbox/dream/download.shtml" >DREAM web page</a>, and
     copy it to <span 
class="cmtt-10">C:</span><!--l. 805--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">Octave</span><!--l. 805--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">include</span><!--l. 805--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math>;
     you don&#x2019;t need to install the fftw3 <span 
class="cmtt-10">dll </span>file since it is already included in the MSVC version of
     Octave.
     </li>
     <li 
  class="enumerate" id="x1-16012x6">Get the <span 
class="cmtt-10">phread.h</span>, <span 
class="cmtt-10">shed.h</span>, and <span 
class="cmtt-10">semaphore.h </span>files from <a 
href="http://sourceware.org/pthreads-win32/" class="url" ><span 
class="cmtt-10">http://sourceware.org/pthreads-win32/</span></a>
     (version 2.8.0), or from the <a 
href="http://www.signal.uu.se/Toolbox/dream/download.shtml" >DREAM web page</a>, and copy them to <span 
class="cmtt-10">C:</span><!--l. 811--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">Octave</span><!--l. 811--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">include</span><!--l. 811--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math>
     </li>
     <li 
  class="enumerate" id="x1-16014x7">Get the <span 
class="cmtt-10">phreadGC2.lib </span>file from <a 
href="http://sourceware.org/pthreads-win32/" class="url" ><span 
class="cmtt-10">http://sourceware.org/pthreads-win32/</span></a>, or from the<br 
class="newline" /><a 
href="http://www.signal.uu.se/Toolbox/dream/download.shtml" >DREAM web page</a>, copy it to <span 
class="cmtt-10">C:</span><!--l. 815--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">Octave</span><!--l. 815--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">lib</span><!--l. 815--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math>,
     and rename it to <span 
class="cmtt-10">phread.lib</span>; the Unix style Makefile which is used to build the toolbox expects
     this name of the lib file.
     </li>
     <li 
  class="enumerate" id="x1-16016x8">Create a new <span 
class="cmtt-10">bat </span>file and add the lines:
                                                                                       
                                                                                       
     <div class="verbatim" id="verbatim-5">
     @echo&#x00A0;off
     &#x00A0;<br />call&#x00A0;&#x0022;C:&#x005C;Program&#x00A0;Files&#x005C;Microsoft&#x00A0;Visual&#x00A0;Studio&#x00A0;9.0&#x005C;VC&#x005C;vcvarsall.bat&#x0022;
     &#x00A0;<br />&#x0022;C:&#x005C;Octave&#x005C;bin&#x005C;octave-3.0.1.exe&#x0022;
</div>
     <!--l. 824--><p class="nopar" > to the file (change the path to the actual version of Octave that you use).
     </p></li>
     <li 
  class="enumerate" id="x1-16018x9">Start Octave by running the <span 
class="cmtt-10">bat </span>file created above.
     </li>
     <li 
  class="enumerate" id="x1-16020x10">Build and install the DREAM Toolbox with: <span 
class="cmtt-10">pkg -verbose install dream-2.x.x.tar.gz</span>.
     </li>
     <li 
  class="enumerate" id="x1-16022x11">Get the <span 
class="cmtt-10">pthreadGC2.dll </span>file from <a 
href="http://sourceware.org/pthreads-win32/" class="url" ><span 
class="cmtt-10">http://sourceware.org/pthreads-win32/</span></a>
     (version 2.8.0), or from the <a 
href="http://www.signal.uu.se/Toolbox/dream/download.shtml" >DREAM web page</a>, and copy it to
     <span 
class="cmtt-10">C:</span><!--l. 834--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">WINDOWS</span><!--l. 834--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">System32</span>.
     </li></ol>
<!--l. 838--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">4.5.6   </span> <a 
 id="x1-170004.5.6"></a>Build the DREAM matlab <span 
class="cmtt-10">mex</span>-files for 64-bit Windows</h5>
<!--l. 841--><p class="noindent" >If you have an older 64-bit Matlab installation (eg. 2007x) then follow these steps:
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-17002x1">Install MSVC 2008 Express Edition SP1.
     </li>
     <li 
  class="enumerate" id="x1-17004x2">Install the Windows SDK; The current version is <span 
class="cmti-10">Windows SDK for Windows Server 2008 and</span>
     <span 
class="cmti-10">.NET Framework 3.5</span>. Remember to select the &#x201C;X64 Compilers and Tools&#x201D; when installing the
     SDK.
     </li>
     <li 
  class="enumerate" id="x1-17006x3">If you are using a different Windows SDK version than 6.1 then you need to set the correct path
     in the bat-file <span 
class="cmtt-10">windows/mexopts/mexopts</span><span 
class="cmtt-10">_msvc</span><span 
class="cmtt-10">_64.bat</span>.
     </li>
     <li 
  class="enumerate" id="x1-17008x4">Get the 64-bit versions of fftw and Pthread-win32 from <a 
href="http://sourceforge.net/projects/mingw-w64/" class="url" ><span 
class="cmtt-10">http://sourceforge.net/projects/mingw-w64/</span></a>
     and <a 
href="http://www.fftw.org" class="url" ><span 
class="cmtt-10">http://www.fftw.org</span></a>, respectively, or from the <a 
href="http://www.signal.uu.se/Toolbox/dream/download.shtml" >DREAM web page</a>, and copy them to<br 
class="newline" /><span 
class="cmtt-10">C:</span><!--l. 870--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">WINDOWS</span><!--l. 870--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2216;</mo></math><span 
class="cmtt-10">System32</span>.<span class="footnote-mark"><a 
href="userman8.xml#fn7x0"><sup class="textsuperscript">7</sup></a></span><a 
 id="x1-17009f7"></a> 
     </li></ol>
                                                                                       
                                                                                       
<!--l. 877--><p class="indent" >   If you have Matlab 2008b, or above,<span class="footnote-mark"><a 
href="userman9.xml#fn8x0"><sup class="textsuperscript">8</sup></a></span><a 
 id="x1-17010f8"></a> 
then read and follow the instructions in Mathworks FAQ:<br 
class="newline" /><a 
href="http://www.mathworks.fr/support/solutions/en/data/1-6IJJ3L/index.html?solution=1-6IJJ3L" class="url" ><span 
class="cmtt-10">http://www.mathworks.fr/support/solutions/en/data/1-6IJJ3L/index.html?solution=1-6IJJ3L</span></a>. Then
run the <span 
class="cmtt-10">build</span><span 
class="cmtt-10">_mexfiles</span><span 
class="cmtt-10">_windows.m </span>script.
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">4.5.7   </span> <a 
 id="x1-180004.5.7"></a>Build the DREAM Octave <span 
class="cmtt-10">oct</span>-files for 64-bit Windows</h5>
<!--l. 885--><p class="noindent" >Currently there is no support for building 64-bit <span 
class="cmtt-10">oct</span>-files since there is no 64-bit version of Octave for Windows
available (yet).
</p><!--l. 888--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">4.5.8   </span> <a 
 id="x1-190004.5.8"></a>Compile with FFTW support for the Attenuation Code</h5>
<!--l. 891--><p class="noindent" >The attenuation code in the DREAM Toolbox uses FFTs extensively. To speed up the FFT computations (by
10% to 50%) one can compile The DREAM Toolbox with FFTW support for the attenuation code. To do this
you need to compile all functions with the flag <span 
class="cmtt-10">-DUSE</span><span 
class="cmtt-10">_FFTW </span>and link with <span 
class="cmtt-10">-lfftw3</span>. This can be accomplished by
changing:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-6">
ATT_FFTW&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;=
&#x00A0;<br />FFW_LIB&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;=
</div>
<!--l. 899--><p class="nopar" > to
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-7">
ATT_FFTW =&#x00A0;-DUSE_FFTW
&#x00A0;<br />FFW_LIB =&#x00A0;-lfftw3
</div>
<!--l. 906--><p class="nopar" > in the file <span 
class="cmtt-10">Make.default </span>before compiling the toolbox if you are using <span 
class="cmti-10">Method 3 </span>described in Section&#x00A0;<a 
href="#x1-120004.5.1">4.5.1<!--tex4ht:ref: sec:linux-build --></a> (the
<span 
class="cmtt-10">build</span><span 
class="cmtt-10">_dream.sh </span>uses fftw by default).
</p><!--l. 911--><p class="noindent" >
</p>
   <h3 class="sectionHead"><span class="titlemark">5   </span> <a 
 id="x1-200005"></a>An Introduction to The Impulse Response Method</h3>
    <!--l. 913--><p class="noindent" ><span 
class="cmr-10x-x-277">T</span>HE impulse response method is an approach based on linear systems theory to model acoustic fields from
    ultrasonic transducers; the method was introduced by Tupholme and Stepanishen in the late 60&#x2019;s, early
70&#x2019;s&#x00A0;[<a 
href="#XTupholme1969">3</a>, <a 
href="#XStepanishen1971a">4</a>]. The impulse response method is based on linear acoustics and can be used to model acoustic fields
and (double-path) responses for both single transducer setups and for array imaging. The idea is to divide the
imaging system in two parts: the first one accounts for acoustical wave propagation effects (i.e., the diffraction
effects) from the transducer surface to the observation point, and the second one accounts for the
electro-acoustical effects. These two parts are then convolved to obtain a model for the total imaging
system.
</p><!--l. 921--><p class="indent" >   The impulse response method is very flexible since, (<span 
class="cmti-10">i</span>) by linearity the response from multi-element
transducers (such as array transducers) can be obtained be means of super-position and (<span 
class="cmti-10">ii</span>) arbitrary input
signals can be treated by simply convolving the electro-acoustical impulse response with the input signal. In this
section we will present a short introduction to the impulse response method and, in particular, discuss how to
use the method for discrete-time modeling.
</p><!--l. 927--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">5.1   </span> <a 
 id="x1-210005.1"></a>The Baffled Piston Model and the Rayleigh integral</h4>
<!--l. 930--><p class="noindent" >The impulse response method is based on the assumption that the transducer can be treated as a
baffled piston. This assumption implies that we only need to consider the active area of the
transducer when modeling the wave propagation. That is, if the source (the transducer) is located
in the rigid plane, often referred to as the <span 
class="cmti-10">rigid baffle </span>as illustrated in Figure&#x00A0;<a 
href="#x1-210011">1<!--tex4ht:ref: fig:integration --></a>, then the baffle
(<!--l. 934--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;b</mtext><!--/mstyle--></mrow></msub 
></math>) will
not contribute to the field. </p><hr class="figure" /><div class="figure" 
>
                                                                                       
                                                                                       
<a 
 id="x1-210011"></a>
                                                                                       
                                                                                       
<div class="center" 
>
<!--l. 937--><p class="noindent" >
</p><!--l. 938--><p class="noindent" ><img 
src="userman0x.png" alt="PIC" class="graphics" width="458.71375pt" height="92.34499pt"  /><!--tex4ht:graphics  
name="userman0x.png" src="eps/baffle.eps"  
--></p></div>
<br /> <div class="caption" 
><span class="id">Figure&#x00A0;1: </span><span  
class="content">Illustration of a baffled transducer. </span></div><!--tex4ht:label?: x1-210011 -->
                                                                                       
                                                                                       
   </div><hr class="endfigure" />
<!--l. 944--><p class="indent" >   The pressure at an observation point <!--l. 944--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></math>
is then described by the Rayleigh integral  </p><table class="equation"><tr><td> <a 
 id="x1-21002r1"></a>
<!--l. 973--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
   <mtable 
class="equation"><mtr><mtd>
   <mtable  
columnalign="right left" class="split">
<mtr class="split-mtr"><mtd 
class="split-mtd"> <mi 
>p</mi><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="split-mtd"><msub><mrow 
><mi 
>&#x03C1;</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
> <mfrac><mrow 
><mi 
>&#x2202;</mi></mrow> 
<mrow 
><mi 
>&#x2202;</mi><mi 
>t</mi></mrow></mfrac><msubsup><mrow 
><mo 
class="MathClass-op">&#x222B;
 <!--nolimits--></mo><!--nolimits--></mrow><mrow 
><mo 
class="MathClass-bin">&#x2212;</mo><mi 
>&#x221E;</mi></mrow><mrow 
><mi 
>&#x221E;</mi></mrow></msubsup 
><mo class="MathClass-open" fence="true" mathsize="2.03em" >(</mo><msub><mrow 
><mo 
class="MathClass-op">&#x222B;
 <!--nolimits--></mo><!--nolimits--></mrow><mrow 
><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;r</mtext><!--/mstyle--></mrow></msub 
></mrow></msub 
><msub><mrow 
><mi 
>v</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><msub><mrow 
><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-punc">,</mo><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-close">)</mo><mfrac><mrow 
><mi 
>&#x03B4;</mi> <mfenced separators="" 
open="("  close=")" ><mrow><mi 
>t</mi> <mo 
class="MathClass-bin">&#x2212;</mo> <msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
> <mo 
class="MathClass-bin">&#x2212;</mo><mo 
class="MathClass-rel">|</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle> <mo 
class="MathClass-bin">&#x2212;</mo><msub><mrow 
><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-rel">|</mo><mo 
class="MathClass-bin">&#x2215;</mo><msub><mrow 
><mi 
>c</mi></mrow><mrow 
><mi 
>p</mi></mrow></msub 
></mrow></mfenced> </mrow>
        <mrow 
><mn>2</mn><mi 
>&#x03C0;</mi><mo 
class="MathClass-rel">|</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle> <mo 
class="MathClass-bin">&#x2212;</mo><msub><mrow 
><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-rel">|</mo></mrow></mfrac>   <mi 
>d</mi><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;r</mtext><!--/mstyle--></mrow></msub 
><mo class="MathClass-open" fence="true" mathsize="2.03em" >)</mo><mi 
>d</mi><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-punc">,</mo></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">       <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="split-mtd"><msub><mrow 
><mi 
>&#x03C1;</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
> <mfrac><mrow 
><mi 
>&#x2202;</mi></mrow> 
<mrow 
><mi 
>&#x2202;</mi><mi 
>t</mi></mrow></mfrac><msubsup><mrow 
><mo 
class="MathClass-op">&#x222B;
 <!--nolimits--></mo><!--nolimits--></mrow><mrow 
><mo 
class="MathClass-bin">&#x2212;</mo><mi 
>&#x221E;</mi></mrow><mrow 
><mi 
>&#x221E;</mi></mrow></msubsup 
><msub><mrow 
><mi 
>v</mi></mrow><mrow 
>
<mi 
>n</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-close">)</mo><msub><mrow 
><mo 
class="MathClass-op">&#x222B;
 <!--nolimits--></mo><!--nolimits--></mrow><mrow 
><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;r</mtext><!--/mstyle--></mrow></msub 
></mrow></msub 
><mfrac><mrow 
><mi 
>&#x03B4;</mi> <mfenced separators="" 
open="("  close=")" ><mrow><mi 
>t</mi> <mo 
class="MathClass-bin">&#x2212;</mo> <msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
> <mo 
class="MathClass-bin">&#x2212;</mo><mo 
class="MathClass-rel">|</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle> <mo 
class="MathClass-bin">&#x2212;</mo><msub><mrow 
><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-rel">|</mo><mo 
class="MathClass-bin">&#x2215;</mo><msub><mrow 
><mi 
>c</mi></mrow><mrow 
><mi 
>p</mi></mrow></msub 
></mrow></mfenced> </mrow> 
        <mrow 
><mn>2</mn><mi 
>&#x03C0;</mi><mo 
class="MathClass-rel">|</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle> <mo 
class="MathClass-bin">&#x2212;</mo><msub><mrow 
><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-rel">|</mo></mrow></mfrac>   <mi 
>d</mi><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;r</mtext><!--/mstyle--></mrow></msub 
><mi 
>d</mi><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-punc">,</mo></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">       <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="split-mtd"><msub><mrow 
><mi 
>&#x03C1;</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
> <mfrac><mrow 
><mi 
>&#x2202;</mi></mrow> 
<mrow 
><mi 
>&#x2202;</mi><mi 
>t</mi></mrow></mfrac><msubsup><mrow 
><mo 
class="MathClass-op">&#x222B;
 <!--nolimits--></mo><!--nolimits--></mrow><mrow 
><mo 
class="MathClass-bin">&#x2212;</mo><mi 
>&#x221E;</mi></mrow><mrow 
><mi 
>&#x221E;</mi></mrow></msubsup 
><msub><mrow 
><mi 
>v</mi></mrow><mrow 
>
<mi 
>n</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-close">)</mo><msup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>f</mi><mo 
class="MathClass-bin">&#x2212;</mo><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;sir</mtext><!--/mstyle--></mrow></msup 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi> <mo 
class="MathClass-bin">&#x2212;</mo> <msub><mrow 
><mi 
>t</mi></mrow><mrow 
>
<mn>0</mn></mrow></msub 
><mo 
class="MathClass-close">)</mo><mi 
>d</mi><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-punc">,</mo></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">       <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="split-mtd"><msub><mrow 
><mi 
>&#x03C1;</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
> <mfrac><mrow 
><mi 
>&#x2202;</mi></mrow> 
<mrow 
><mi 
>&#x2202;</mi><mi 
>t</mi></mrow></mfrac><msub><mrow 
><mi 
>v</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-bin">&#x2217;</mo> <msup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>f</mi><mo 
class="MathClass-bin">&#x2212;</mo><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;sir</mtext><!--/mstyle--></mrow></msup 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi> <mo 
class="MathClass-bin">&#x2212;</mo> <msub><mrow 
><mi 
>t</mi></mrow><mrow 
>
<mn>0</mn></mrow></msub 
><mo 
class="MathClass-close">)</mo><mo 
class="MathClass-punc">.</mo></mtd>
   </mtr></mtable>                                                                                    </mtd><mtd>
   </mtd></mtr></mtable>
</math></td><td class="eq-no">(1)</td></tr></table>
<!--l. 975--><p class="indent" >   where it is where we for simplicity have assumed that the normal velocity
<!--l. 981--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>v</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><msub><mrow 
><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-rel">&#x2261;</mo> <msub><mrow 
><mi 
>v</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math> is  uniform on the
transducer&#x2019;s surface <!--l. 982--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;r</mtext><!--/mstyle--></mrow></msub 
></math>.
The Rayleigh integral formula&#x00A0;(<a 
href="#x1-21002r1">1<!--tex4ht:ref: eq:rayleigh --></a>) simply states that the acoustic field at an observation point is the
sum of the contributions from all points of the active area of the transducer. The impulse response
<!--l. 990--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>f</mi><mo 
class="MathClass-bin">&#x2212;</mo><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;sir</mtext><!--/mstyle--></mrow></msup 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math> in
Eq.&#x00A0;(<a 
href="#x1-21002r1">1<!--tex4ht:ref: eq:rayleigh --></a>) is usually referred to as the (forward) <span 
class="cmti-10">spatial impulse response </span>(SIR).
</p><!--l. 994--><p class="indent" >   The normal velocity,  <!--l. 1000--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>v</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math>,
depends on both the input signal, <!--l. 1001--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>u</mi><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math>,
and the electro-acoustical properties of the transducer, which can be described with the (forward) electrical impulse
response  <!--l. 1008--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>e</mi><mi 
>f</mi></mrow></msup 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math>.  Thus,
the pressure at <!--l. 1009--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></math>
can be expressed by the convolutions of the input signal and the two (forward) impulse responses according to,  </p><table class="equation"><tr><td>
<a 
 id="x1-21003r2"></a>
                                                                                       
                                                                                       
<!--l. 1023--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
                            <mi 
>p</mi><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-rel">=</mo> <msup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>f</mi><mo 
class="MathClass-bin">&#x2212;</mo><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;sir</mtext><!--/mstyle--></mrow></msup 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-bin">&#x2217;</mo> <msup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>e</mi><mi 
>f</mi></mrow></msup 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-bin">&#x2217;</mo> <mi 
>u</mi><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo><mo 
class="MathClass-punc">.</mo>
</math></td><td class="eq-no">(2)</td></tr></table>
<!--l. 1025--><p class="indent" >   Double-path (pulse-echo) responses can be treated in a similar way by convolving the forward response&#x00A0;(<a 
href="#x1-21003r2">2<!--tex4ht:ref: eq:pressure_response --></a>)
with the backward electrical (acousto-electrical) response and the backward SIR for a point source at
<!--l. 1027--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></math>.
</p><!--l. 1029--><p class="indent" >   Analytical solutions to SIRs exist for a few geometries, but one must in general resort to numerical methods.
Also, these <span 
class="cmti-10">time continuous </span>solutions are normally not practical since all acquired signals (the data) are
normally sampled and time discrete models are, therefore, needed; sampling of time continous SIRs is discussed
in Section&#x00A0;<a 
href="#x1-220005.2">5.2<!--tex4ht:ref: sec:sir-sampling --></a>.
</p><!--l. 1039--><p class="indent" >   Before we discuss sampled SIRs, and the particular method use by the DREAM Toolbox, let us consider a
case where there exist an analytical solution.
</p>
   <div class="newtheorem">
<!--l. 1042--><p class="noindent" ><span class="head">
<a 
 id="x1-21004r1"></a>
  <span 
class="cmbx-10">Example 1 </span>(The SIR for a Circular Disc)<span 
class="cmbx-10">.</span>  </span>The SIR of a circular disc (see illustration in Figure&#x00A0;<a 
href="#x1-210052">2<!--tex4ht:ref: fig:circ --></a>) has an
analytical solution&#x00A0;[<a 
href="#XStepanishen1971a">4</a>] </p><hr class="figure" /><div class="figure" 
><a 
 id="x1-210052"></a>
<div class="center" 
>
<!--l. 1048--><p class="noindent" >
</p><!--l. 1049--><p class="noindent" ><img 
src="userman1x.png" alt="PIC" class="graphics" width="195.73125pt" height="169.63374pt"  /><!--tex4ht:graphics  
name="userman1x.png" src="eps/circ_aperture.eps"  
--></p></div>
<br /> <div class="caption" 
><span class="id">Figure&#x00A0;2: </span><span  
class="content">Geometry of a a circular disc source. </span></div><!--tex4ht:label?: x1-210052 -->
   </div><hr class="endfigure" />
<!--l. 1055--><p class="indent" >   which can be divided in two cases: (<span 
class="cmti-10">i</span>) when the observation point is inside the aperture of the disc
<!--l. 1057--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msqrt><mrow><msup><mrow 
>
<mi 
>x</mi></mrow><mrow 
><mn>2</mn></mrow></msup 
> <mo 
class="MathClass-bin">+</mo> <msup><mrow 
><mi 
>y</mi></mrow><mrow 
><mn>2</mn></mrow></msup 
></mrow></msqrt> <mo 
class="MathClass-rel">&#x2264;</mo> <mi 
>a</mi></math>, where
<!--l. 1057--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>a</mi></math> is the
transducer radius, and (<span 
class="cmti-10">ii</span>) when the observation point is outside the aperture. The disc is assumed to be located in the
<!--l. 1059--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>x</mi></math>&#x2013;<!--l. 1059--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>y</mi></math>
plane centered at <!--l. 1059--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>x</mi> <mo 
class="MathClass-rel">=</mo> <mi 
>y</mi> <mo 
class="MathClass-rel">=</mo> <mn>0</mn></math>. If we let
<!--l. 1059--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>r</mi></math> denote the distance in the
<!--l. 1060--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>x</mi></math>&#x2013;<!--l. 1060--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>y</mi></math>
plane from the center axis of the disc to the observation point,
<!--l. 1061--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>r</mi> <mo 
class="MathClass-rel">=</mo> <msqrt><mrow><msup><mrow 
><mi 
>x</mi></mrow><mrow 
><mn>2</mn> </mrow> </msup 
> <mo 
class="MathClass-bin">+</mo> <msup><mrow 
><mi 
>y</mi></mrow><mrow 
><mn>2</mn></mrow></msup 
></mrow></msqrt></math>, then
the circular disc SIR is given by  </p><table class="equation"><tr><td> <a 
 id="x1-21006r3"></a>
                                                                                       
                                                                                       
<!--l. 1110--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
   <mtable 
class="equation"><mtr><mtd>
   <mtable  
columnalign="right left" class="split">
<mtr class="split-mtr"><mtd 
class="split-mtd"> <mi 
>f</mi><mi 
>o</mi><mi 
>r</mi><mspace width="1em" class="nbsp" /><mi 
>r</mi> <mo 
class="MathClass-rel">&#x2264;</mo> <mi 
>a</mi></mtd><mtd 
class="split-mtd"></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">   <mi 
>h</mi><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></mtd><mtd 
class="split-mtd"> <mo 
class="MathClass-rel">=</mo>  <mfenced separators="" 
open="{"  close="" ><mrow> <mtable  style="text-align:axis;"  
equalrows="false" columnlines="none" equalcolumns="false" class="array"><mtr><mtd 
class="array"  columnalign="left"><mn>0</mn><mo 
class="MathClass-punc">,</mo>                               <mspace width="1em" class="quad"/></mtd><mtd 
class="array"  columnalign="left"><mspace width="1em" class="nbsp" /><mspace width="1em" class="nbsp" /><mi 
>t</mi> <mo 
class="MathClass-rel">&#x2264;</mo> <msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>z</mi></mrow></msub 
>       </mtd>
</mtr><mtr><mtd 
class="array"  columnalign="left"><mi 
>c</mi><mi 
>p</mi><mo 
class="MathClass-punc">,</mo>                              <mspace width="1em" class="quad"/></mtd><mtd 
class="array"  columnalign="left"><mspace width="1em" class="nbsp" /><mspace width="1em" class="nbsp" /><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>z</mi></mrow></msub 
> <mo 
class="MathClass-rel">&#x2264;</mo> <mi 
>t</mi> <mo 
class="MathClass-rel">&#x2264;</mo> <msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>1</mn></mrow></msub 
></mtd>
</mtr><mtr><mtd 
class="array"  columnalign="left"><mfrac><mrow 
><mi 
>c</mi><mi 
>p</mi></mrow>
<mrow 
><mi 
>&#x03C0;</mi></mrow></mfrac> <msup><mrow 
><mo class="qopname"> cos</mo><!--nolimits--></mrow><mrow 
><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></mrow></msup 
> <mfenced separators="" 
open="("  close=")" ><mrow><mi 
>c</mi><msup><mrow 
>
<mi 
>p</mi></mrow><mrow 
><mn>2</mn></mrow></msup 
><mfrac><mrow 
><msup><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>2</mn></mrow></msup 
><mo 
class="MathClass-bin">&#x2212;</mo><msubsup><mrow 
><mi 
>t</mi></mrow><mrow 
>
<mi 
>z</mi></mrow><mrow 
><mn>2</mn></mrow></msubsup 
><mo 
class="MathClass-bin">+</mo><msubsup><mrow 
><mi 
>t</mi></mrow><mrow 
>
<mi 
>r</mi></mrow><mrow 
><mn>2</mn></mrow></msubsup 
><mo 
class="MathClass-bin">&#x2212;</mo><mi 
>a</mi><mo 
class="MathClass-bin">&#x2215;</mo><mi 
>c</mi><msup><mrow 
>
<mi 
>p</mi></mrow><mrow 
><mn>2</mn></mrow></msup 
></mrow> 
     <mrow 
><mn>2</mn><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>r</mi></mrow></msub 
><msqrt><mrow><msup><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>2</mn> </mrow> </msup 
> <mo 
class="MathClass-bin">&#x2212;</mo><msubsup><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>z</mi> </mrow> <mrow 
>  <mn>2</mn></mrow></msubsup 
></mrow></msqrt></mrow></mfrac>       </mrow></mfenced> <mo 
class="MathClass-punc">,</mo><mspace width="1em" class="nbsp" /><mspace width="1em" class="quad"/></mtd><mtd 
class="array"  columnalign="left"><mspace width="1em" class="nbsp" /><mspace width="1em" class="nbsp" /><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>1</mn></mrow></msub 
> <mo 
class="MathClass-rel">&#x003C;</mo> <mi 
>t</mi> <mo 
class="MathClass-rel">&#x2264;</mo> <msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>2</mn></mrow></msub 
></mtd>
</mtr><mtr><mtd 
class="array"  columnalign="left"><mn>0</mn><mo 
class="MathClass-punc">,</mo>                               <mspace width="1em" class="quad"/></mtd><mtd 
class="array"  columnalign="left"><mspace width="1em" class="nbsp" /><mspace width="1em" class="nbsp" /><mi 
>t</mi> <mo 
class="MathClass-rel">&#x003E;</mo> <msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>2</mn></mrow></msub 
>        </mtd></mtr>
      <!--@{}l@{\quad }l@{}--></mtable>                                                                                                                                                                   </mrow></mfenced> </mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd"> <mi 
>f</mi><mi 
>o</mi><mi 
>r</mi><mspace width="1em" class="nbsp" /><mi 
>r</mi> <mo 
class="MathClass-rel">&#x003E;</mo> <mi 
>a</mi></mtd><mtd 
class="split-mtd"></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">   <mi 
>h</mi><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></mtd><mtd 
class="split-mtd"> <mo 
class="MathClass-rel">=</mo>  <mfenced separators="" 
open="{"  close="" ><mrow> <mtable  style="text-align:axis;"  
equalrows="false" columnlines="none" equalcolumns="false" class="array"><mtr><mtd 
class="array"  columnalign="left"><mn>0</mn><mo 
class="MathClass-punc">,</mo>                               <mspace width="1em" class="quad"/></mtd><mtd 
class="array"  columnalign="left"><mspace width="1em" class="nbsp" /><mspace width="1em" class="nbsp" /><mi 
>t</mi> <mo 
class="MathClass-rel">&#x2264;</mo> <msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>1</mn></mrow></msub 
>        </mtd>
</mtr><mtr><mtd 
class="array"  columnalign="left"><mfrac><mrow 
><mi 
>c</mi><mi 
>p</mi></mrow>
<mrow 
><mi 
>&#x03C0;</mi></mrow></mfrac> <msup><mrow 
><mo class="qopname"> cos</mo><!--nolimits--></mrow><mrow 
><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></mrow></msup 
> <mfenced separators="" 
open="("  close=")" ><mrow><mi 
>c</mi><msup><mrow 
>
<mi 
>p</mi></mrow><mrow 
><mn>2</mn></mrow></msup 
><mfrac><mrow 
><msup><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>2</mn></mrow></msup 
><mo 
class="MathClass-bin">&#x2212;</mo><msubsup><mrow 
><mi 
>t</mi></mrow><mrow 
>
<mi 
>z</mi></mrow><mrow 
><mn>2</mn></mrow></msubsup 
><mo 
class="MathClass-bin">+</mo><msubsup><mrow 
><mi 
>t</mi></mrow><mrow 
>
<mi 
>r</mi></mrow><mrow 
><mn>2</mn></mrow></msubsup 
><mo 
class="MathClass-bin">&#x2212;</mo><mi 
>a</mi><mo 
class="MathClass-bin">&#x2215;</mo><mi 
>c</mi><msup><mrow 
>
<mi 
>p</mi></mrow><mrow 
><mn>2</mn></mrow></msup 
></mrow> 
     <mrow 
><mn>2</mn><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>r</mi></mrow></msub 
><msqrt><mrow><msup><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>2</mn> </mrow> </msup 
> <mo 
class="MathClass-bin">&#x2212;</mo><msubsup><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>z</mi> </mrow> <mrow 
>  <mn>2</mn></mrow></msubsup 
></mrow></msqrt></mrow></mfrac>       </mrow></mfenced> <mo 
class="MathClass-punc">,</mo><mspace width="1em" class="nbsp" /><mspace width="1em" class="quad"/></mtd><mtd 
class="array"  columnalign="left"><mspace width="1em" class="nbsp" /><mspace width="1em" class="nbsp" /><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>1</mn></mrow></msub 
> <mo 
class="MathClass-rel">&#x003C;</mo> <mi 
>t</mi> <mo 
class="MathClass-rel">&#x2264;</mo> <msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>2</mn></mrow></msub 
></mtd>
</mtr><mtr><mtd 
class="array"  columnalign="left"><mn>0</mn><mo 
class="MathClass-punc">,</mo>                               <mspace width="1em" class="quad"/></mtd><mtd 
class="array"  columnalign="left"><mspace width="1em" class="nbsp" /><mspace width="1em" class="nbsp" /><mi 
>t</mi> <mo 
class="MathClass-rel">&#x003E;</mo> <msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>2</mn></mrow></msub 
>        </mtd></mtr>
      <!--@{}l@{\quad }l@{}--></mtable>                                                                                                                                                                   </mrow></mfenced> </mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">        </mtd>
   </mtr></mtable>                                                                                                </mtd><mtd>
   </mtd></mtr></mtable>
</math></td><td class="eq-no">(3)</td></tr></table>
<!--l. 1112--><p class="indent" >   where <!--l. 1112--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>z</mi></mrow></msub 
> <mo 
class="MathClass-rel">=</mo> <mi 
>z</mi><mo 
class="MathClass-bin">&#x2215;</mo><mi 
>c</mi><mi 
>p</mi></math>
is the earliest time that the wave reaches the observation point
<!--l. 1113--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></math> when
<!--l. 1113--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>r</mi> <mo 
class="MathClass-rel">&#x2264;</mo> <mi 
>a</mi></math>,
<!--l. 1113--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>r</mi></mrow></msub 
> <mo 
class="MathClass-rel">=</mo> <mi 
>r</mi><mo 
class="MathClass-bin">&#x2215;</mo><mi 
>c</mi><mi 
>p</mi></math>, and
<!--l. 1114--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>1</mn><mo 
class="MathClass-punc">,</mo><mn>2</mn></mrow></msub 
> <mo 
class="MathClass-rel">=</mo> <msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>z</mi></mrow></msub 
><msqrt><mrow><mn>1</mn> <mo 
class="MathClass-bin">+</mo> <msup><mrow 
><mo 
class="MathClass-open">(</mo><mfrac><mrow 
><mi 
>a</mi><mo 
class="MathClass-bin">&#x2213;</mo><mi 
>r</mi></mrow>
  <mrow 
><mi 
>z</mi></mrow></mfrac>  <mo 
class="MathClass-close">)</mo></mrow><mrow 
><mn>2</mn></mrow></msup 
></mrow></msqrt></math> are the
propagation times corresponding to the edges of the disc that are closest and furthermost away from
<!--l. 1116--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></math>,
respectively.
</p><!--l. 1118--><p class="indent" >   Noticeable is that the pulse amplitude of the on-axis SIR is constant regardless of the distance to the observation
point.<span class="footnote-mark"><a 
href="userman10.xml#fn9x0"><sup class="textsuperscript">9</sup></a></span><a 
 id="x1-21007f9"></a>  The duration of the
on-axis SIR is given by <!--l. 1122--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>1</mn></mrow></msub 
> <mo 
class="MathClass-rel">=</mo> <mi 
>a</mi><mo 
class="MathClass-bin">&#x2215;</mo><mi 
>c</mi><mi 
>p</mi></math> at
<!--l. 1122--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>z</mi> <mo 
class="MathClass-rel">=</mo> <mn>0</mn></math>. As the distance increases
the duration, <!--l. 1122--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mn>1</mn></mrow></msub 
> <mo 
class="MathClass-bin">&#x2212;</mo> <msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>z</mi></mrow></msub 
></math>, of the SIR
becomes shorter, and for large <!--l. 1123--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>z</mi></math>
it approaches to the delta function. The transducer size effects are therefore most
pronounced in the near-field. This is illustrated in Figure&#x00A0;<a 
href="#x1-210103">3<!--tex4ht:ref: fig:on_axis_sirs --></a> where the on-axis SIRs at
<!--l. 1126--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>z</mi> <mo 
class="MathClass-rel">=</mo> <mn>2</mn><mn>0</mn></math> and
<!--l. 1127--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>z</mi> <mo 
class="MathClass-rel">=</mo> <mn>8</mn><mn>0</mn></math> mm,
respectively are shown. </p><hr class="figure" /><div class="figure" 
><a 
 id="x1-210103"></a>
<div class="center" 
>
<!--l. 1130--><p class="noindent" >
                                                                                       
                                                                                       
</p><!--l. 1134--><p class="noindent" ><a 
 id="x1-21008r1"></a></p><div class="subfigure"><table><tr><td style="text-align:left"><img 
src="userman2x.png" alt="PIC" class="graphics" width="529.98pt" height="411.53749pt"  /><!--tex4ht:graphics  
name="userman2x.png" src="eps/on_axis_close.eps"  
-->
<div class="subfigcaption"><span 
class="cmr-8">(a)      Spatial            impulse            response            at</span>
<!--l. 1134--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>z</mi> <mo 
class="MathClass-rel">=</mo> <mn>2</mn><mn>0</mn></math>
<span 
class="cmr-8">mm. </span></div>                                       </td></tr></table></div><a 
 id="x1-21009r2"></a><div class="subfigure"><table><tr><td style="text-align:left"><img 
src="userman3x.png" alt="PIC" class="graphics" width="529.98pt" height="411.53749pt"  /><!--tex4ht:graphics  
name="userman3x.png" src="eps/on_axis_far.eps"  
-->
<div class="subfigcaption"><span 
class="cmr-8">(b)      Spatial            impulse            response            at</span>
<!--l. 1134--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>z</mi> <mo 
class="MathClass-rel">=</mo> <mn>8</mn><mn>0</mn></math>
<span 
class="cmr-8">mm. </span></div>                                                                       </td></tr></table></div></div>
<br />  <div class="caption" 
><span class="id">Figure&#x00A0;3:   </span><span  
class="content">On-axis   spatial   impulse   responses   for   a   10   mm   disc   where   the   sound   speed,
<!--l. 1138--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>c</mi><mi 
>p</mi></math>,
was 1500 m/s. </span></div><!--tex4ht:label?: x1-210103 -->
   </div><hr class="endfigure" />
<!--l. 1141--><p class="indent" >   The duration at <!--l. 1141--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>z</mi> <mo 
class="MathClass-rel">=</mo> <mn>2</mn><mn>0</mn></math> is
longer than that of <!--l. 1141--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>z</mi> <mo 
class="MathClass-rel">=</mo> <mn>8</mn><mn>0</mn></math>
and if the distance, <!--l. 1142--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>z</mi></math>,
increases then the on-axis SIR will approach to a delta function, cf. Figures&#x00A0;<a 
href="#x1-210103">3<!--tex4ht:ref: fig:on_axis_sirs --></a>(a) and (b).
<!--l. 1144--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-ord">&#x25A1;</mo></math>
</p>
   </div>
<!--l. 1148--><p class="indent" >   As mentioned above, there exist no analytical analytical solutions for many transducer geometries, and in
such situations numerical methods must be used. The DREAM Toolbox uses a method based on the <span 
class="cmti-10">discrete</span>
<span 
class="cmti-10">representation </span>(DR) computational concept&#x00A0;[<a 
href="#XPiwakowski1989">1</a>, <a 
href="#XPiwakowski1999">2</a>]. The DR method is very flexible in the sense that complex
transducer shapes as well as arbitrary focusing methods easily can be modeled. Another benefit of the DR
method is that the SIRs are directly computed in a discrete form which is convenient since this directly allows
for digital signal processing. The DR method is described in Section&#x00A0;<a 
href="#x1-230005.3">5.3<!--tex4ht:ref: sec:dr --></a> below, but first we will discuss sampling
of spatial impulse responses.
</p>
   <h4 class="subsectionHead"><span class="titlemark">5.2   </span> <a 
 id="x1-220005.2"></a>Discrete-time Spatial Impulse Responses</h4>
<!--l. 1159--><p class="noindent" >Before we introduce the discrete representation (DR) method, which the DREAM toolbox transducer functions
are based on, let us discuss sampling of spatial impulse responses. This is of interest since our ultimate goal
normally is to model the total <span 
class="cmti-10">sampled </span>imaging system which includes both acoustic propagation effects (the
SIRs) as well as input signals and electro-acoustical effects.
</p><!--l. 1164--><p class="indent" >   To obtain a discrete model we need a discrete representation of the SIRs. That is, the analytical expressions
for the SIRs discussed in Section&#x00A0;<a 
href="#x1-210005.1">5.1<!--tex4ht:ref: sec:analythical --></a> must be converted to a discrete form in order to be useful for digital signal
processing; a proper discrete representation of the SIRs is necessary so that when the sampled SIR is convolved
with the normal velocity the resulting waveform can faithfully represent the sampled measured
waveform.
                                                                                       
                                                                                       
</p><!--l. 1170--><p class="indent" >   The analytical SIRs have an infinite bandwidth due to the abrupt amplitude changes that, for example, could be seen
in the line and disc solutions above. In some situations the duration of a SIR may even be shorter than the sampling
interval, <!--l. 1173--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>T</mi><mi 
>s</mi></math>,
and it is therefore not sufficient to simply sample the analytical SIRs by simply taking the amplitude at the
sampling instants since the SIR may actually be zero those time instants. The SIRs are however convolved with
a band-limited normal velocity signal, hence the resulting pressure waveform must also be band-limited, cf.&#x00A0;(<a 
href="#x1-21003r2">2<!--tex4ht:ref: eq:pressure_response --></a>).
Consequently, we only need to sample the SIR in such way that the band-limited received A-scans are properly
modeled.
</p><!--l. 1183--><p class="indent" >   In a sampled system the impulse responses are given at discrete time instants,
<!--l. 1183--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
></math> (given by the
sampling period <!--l. 1184--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>T</mi><mi 
>s</mi></math>)
and to faithfully represent the SIRs we need to collect all contributions from the continuous time SIRs in the corresponding
sampling interval <!--l. 1185--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-open">[</mo><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
> <mo 
class="MathClass-bin">&#x2212;</mo> <mi 
>T</mi><mi 
>s</mi><mo 
class="MathClass-bin">&#x2215;</mo><mn>2</mn><mo 
class="MathClass-punc">,</mo><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
> <mo 
class="MathClass-bin">+</mo> <mi 
>T</mi><mi 
>s</mi><mo 
class="MathClass-bin">&#x2215;</mo><mn>2</mn><mo 
class="MathClass-close">]</mo></math>.
A discrete version of the a time continuous SIR is then obtained by summing all contributions from the SIR in
the actual sampling interval. That is, the sampled SIR is defined as </p><table class="equation"><tr><td> <a 
 id="x1-22001r4"></a>
<!--l. 1191--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
                           <mi 
>h</mi><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-rel">&#x225C;</mo> <mfrac><mrow 
><mn>1</mn></mrow> 
<mrow 
><mi 
>T</mi><mi 
>s</mi></mrow></mfrac><msubsup><mrow 
><mo 
class="MathClass-op"> &#x222B;
 <!--nolimits--></mo><!--nolimits--></mrow><mrow 
><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
><mo 
class="MathClass-bin">&#x2212;</mo><mi 
>T</mi><mi 
>s</mi><mo 
class="MathClass-bin">&#x2215;</mo><mn>2</mn></mrow><mrow 
><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
><mo 
class="MathClass-bin">+</mo><mi 
>T</mi><mi 
>s</mi><mo 
class="MathClass-bin">&#x2215;</mo><mn>2</mn></mrow></msubsup 
><mi 
>h</mi><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo><mi 
>d</mi><mi 
>t</mi><mo 
class="MathClass-punc">.</mo>
</math></td><td class="eq-no">(4)</td></tr></table>
<!--l. 1197--><p class="indent" >   The division by <!--l. 1197--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>T</mi><mi 
>s</mi></math>
retains the same unit (m/s) of the sampled SIR as the continuous one. The amplitude of the sampled SIR, at
time <!--l. 1198--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
></math>,
is then the mean value of the continuous SIR in the corresponding sampling interval,
<!--l. 1199--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-open">[</mo><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
> <mo 
class="MathClass-bin">&#x2212;</mo> <mi 
>T</mi><mi 
>s</mi><mo 
class="MathClass-bin">&#x2215;</mo><mn>2</mn><mo 
class="MathClass-punc">,</mo><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
> <mo 
class="MathClass-bin">+</mo> <mi 
>T</mi><mi 
>s</mi><mo 
class="MathClass-bin">&#x2215;</mo><mn>2</mn><mo 
class="MathClass-close">]</mo></math>. Also,
as seen from the analytical solutions above, the SIRs always have a finite length as the transducer has a
finite size. The sampled SIRs are therefore naturally represented by finite impulse response filters
(FIRs).
</p><!--l. 1205--><p class="indent" >   The effect of the sampling scheme&#x00A0;(<a 
href="#x1-22001r4">4<!--tex4ht:ref: eq:sampled_sir --></a>) is illustrated in Figure&#x00A0;<a 
href="#x1-220044">4<!--tex4ht:ref: fig:sampled_vs_analytic --></a> for two discs with radii 1.2 and 3 mm, respectively, where
the sampling interval, <!--l. 1207--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>T</mi><mi 
>s</mi></math>,
was 0.04<!--l. 1207--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x03BC;</mi></math>s.
</p><hr class="figure" /><div class="figure" 
>
                                                                                       
                                                                                       
<a 
 id="x1-220044"></a>
                                                                                       
                                                                                       
<div class="center" 
>
<!--l. 1210--><p class="noindent" >
<a 
 id="x1-22002r1"></a>
</p>
<div class="subfigure"><table><tr><td style="text-align:left"><img 
src="userman4x.png" alt="PIC" class="graphics" width="536.0025pt" height="410.53375pt"  /><!--tex4ht:graphics  
name="userman4x.png" src="eps/circ_sir_sampled_vs_analythic_small.eps"  
-->
<div class="subfigcaption"><span 
class="cmr-8">(a) Continuous and sampled spatial impulse responses of a</span>
<span 
class="cmr-8">circular                 disc                 with                 radius</span>
<!--l. 1213--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>r</mi> <mo 
class="MathClass-rel">=</mo> <mn>1</mn><mo 
class="MathClass-punc">.</mo><mn>2</mn></math>
<span 
class="cmr-8">mm. </span></div>                                       </td></tr></table></div>
<a 
 id="x1-22003r2"></a><div class="subfigure"><table><tr><td style="text-align:left"><img 
src="userman5x.png" alt="PIC" class="graphics" width="536.0025pt" height="410.53375pt"  /><!--tex4ht:graphics  
name="userman5x.png" src="eps/circ_sir_sampled_vs_analythic_large.eps"  
-->
<div class="subfigcaption"><span 
class="cmr-8">(b) Continuous and sampled spatial impulse responses of a</span>
<span 
class="cmr-8">circular                 disc                 with                 radius</span>
<!--l. 1216--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>r</mi> <mo 
class="MathClass-rel">=</mo> <mn>3</mn></math>
<span 
class="cmr-8">mm. </span></div>                                       </td></tr></table></div></div>
<br /> <div class="caption" 
><span class="id">Figure&#x00A0;4:  </span><span  
class="content">Illustration  of  sampling  spatial  impulse  responses.  The  continuous  and  sampled  on-axis
SIRs  for  two  discs  with  radii  1.2  and  3  mm,  respectively  are  shown  where  the  sampling  interval,
<!--l. 1222--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>T</mi><mi 
>s</mi></math>,
was 0.04 <!--l. 1222--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x03BC;</mi></math>s
(<!--l. 1222--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>c</mi><mi 
>p</mi></math>=
1500 [m/s]). </span></div><!--tex4ht:label?: x1-220044 -->
                                                                                       
                                                                                       
   </div><hr class="endfigure" />
<!--l. 1225--><p class="indent" >   In Figure&#x00A0;<a 
href="#x1-220044">4<!--tex4ht:ref: fig:sampled_vs_analytic --></a>(a) the analytic SIR is shorter than the sampling interval,
<!--l. 1226--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>T</mi><mi 
>s</mi></math>. The
max amplitude of the discrete SIR is therefore lower than then the max amplitude of the continuous SIR. If the
duration of the analytic SIR is longer than the sampling interval, as for the 3 mm disc shown in
Figure&#x00A0;<a 
href="#x1-220044">4<!--tex4ht:ref: fig:sampled_vs_analytic --></a>(b), then the max amplitudes of the on-axis sampled and analytic disc SIRs will be the
same.
</p>
   <h4 class="subsectionHead"><span class="titlemark">5.3   </span> <a 
 id="x1-230005.3"></a>The Discrete Representation (DR) Computational Concept</h4>
<!--l. 1235--><p class="noindent" >As mentioned in previous in Section&#x00A0;<a 
href="#x1-210005.1">5.1<!--tex4ht:ref: sec:analythical --></a> the analytical spatial impulse responses are only available for a few
simple transducer geometries. Therefore, for a transducer with an arbitrary geometry a numerical method must
be used. The numerical method used in this toolbox is based on the <span 
class="cmti-10">discrete representation </span>(DR) method,
which is based on a discretization of the Rayleigh integral formula&#x00A0;(<a 
href="#x1-21002r1">1<!--tex4ht:ref: eq:rayleigh --></a>). In the DR method, the
radiating surface is divided into a set of small surface elements (see illustration in Figure&#x00A0;<a 
href="#x1-230015">5<!--tex4ht:ref: fig:dream --></a>), and
</p><hr class="figure" /><div class="figure" 
>
                                                                                       
                                                                                       
<a 
 id="x1-230015"></a>
                                                                                       
                                                                                       
<div class="center" 
>
<!--l. 1245--><p class="noindent" >
</p><!--l. 1246--><p class="noindent" ><img 
src="userman6x.png" alt="PIC" class="graphics" width="238.89249pt" height="235.88124pt"  /><!--tex4ht:graphics  
name="userman6x.png" src="eps/dream2.eps"  
--></p></div>
<br /> <div class="caption" 
><span class="id">Figure&#x00A0;5: </span><span  
class="content">Geometry and notations for the discrete representation method. </span></div><!--tex4ht:label?: x1-230015 -->
                                                                                       
                                                                                       
   </div><hr class="endfigure" />
<!--l. 1252--><p class="indent" >   the surface integral in the Rayleigh formula is replaced by a summation. The DR method facilitates
computation of SIRs for non-uniform excitation, apodization of the aperture, and arbitrary focusing laws since
each surface element can be assigned a different normal velocity, apdodization or time-delay. The DR
computational concept can therefore be used for computing SIRs for an arbitrary transducer shape or array
layout&#x00A0;[<a 
href="#XPiwakowski1989">1</a>, <a 
href="#XPiwakowski1999">2</a>].
</p><!--l. 1260--><p class="indent" >   A discrete SIR, computed using the DR method, can be found by first dividing the total transducer surface into a set of
<!--l. 1261--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>J</mi></math> surface elements
<!--l. 1261--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-open">{</mo><mi 
>&#x0394;</mi><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-punc">,</mo><mi 
>&#x0394;</mi><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><mn>1</mn></mrow></msub 
><mo 
class="MathClass-punc">,</mo><mo 
class="MathClass-op">&#x2026;</mo><mo 
class="MathClass-punc">,</mo><mi 
>&#x0394;</mi><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><mi 
>J</mi><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></mrow></msub 
><mo 
class="MathClass-close">}</mo></math>. Second, let
<!--l. 1261--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>w</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
></math> denote an aperture
weight, and <!--l. 1262--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>R</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
> <mo 
class="MathClass-rel">=</mo> <mo 
class="MathClass-rel">|</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle> <mo 
class="MathClass-bin">&#x2212;</mo><msub><mrow 
><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></mrow><mrow 
><mi 
>j</mi></mrow></msub 
><mo 
class="MathClass-rel">|</mo></math> the
distance from the <!--l. 1262--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>j</mi></math>th
surface element to the observation point. The discrete SIR can now be approximated by </p><table class="equation"><tr><td> <a 
 id="x1-23002r5"></a>
<!--l. 1265--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
   <mtable 
class="equation"><mtr><mtd>
   <mtable  
columnalign="right left" class="split">
<mtr class="split-mtr"><mtd 
class="split-mtd"> <mi 
>h</mi><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
><mo 
class="MathClass-close">)</mo></mtd><mtd 
class="split-mtd"> <mo 
class="MathClass-rel">=</mo>  <mfrac><mrow 
><mn>1</mn></mrow> 
<mrow 
><mn>2</mn><mi 
>&#x03C0;</mi></mrow></mfrac><munderover accentunder="false" accent="false"><mrow  
><mo mathsize="big" 
>&#x2211;</mo>
  </mrow><mrow 
><mi 
>j</mi><mo 
class="MathClass-rel">=</mo><mn>0</mn></mrow><mrow 
><mi 
>J</mi><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></mrow></munderover 
><mfrac><mrow 
><msub><mrow 
><mi 
>w</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
><mi 
>&#x03B4;</mi><mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
> <mo 
class="MathClass-bin">&#x2212;</mo> <msub><mrow 
><mi 
>R</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
><mo 
class="MathClass-bin">&#x2215;</mo><mi 
>c</mi><mi 
>p</mi> <mo 
class="MathClass-bin">&#x2212;</mo> <msub><mrow 
><mi 
>d</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
><mo 
class="MathClass-close">)</mo></mrow>
            <mrow 
><msub><mrow 
><mi 
>R</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
></mrow></mfrac>             <mi 
>&#x0394;</mi><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">       </mtd><mtd 
class="split-mtd"> <mo 
class="MathClass-rel">=</mo><munderover accentunder="false" accent="false"><mrow  
><mo mathsize="big" 
> &#x2211;</mo>
  </mrow><mrow 
><mi 
>j</mi><mo 
class="MathClass-rel">=</mo><mn>0</mn></mrow><mrow 
><mi 
>J</mi><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></mrow></munderover 
><msub><mrow 
><mi 
>a</mi></mrow><mrow 
>
<mi 
>j</mi></mrow></msub 
><mi 
>&#x03B4;</mi><mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
> <mo 
class="MathClass-bin">&#x2212;</mo> <msub><mrow 
><mi 
>R</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
><mo 
class="MathClass-bin">&#x2215;</mo><mi 
>c</mi><mi 
>p</mi> <mo 
class="MathClass-bin">&#x2212;</mo> <msub><mrow 
><mi 
>d</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
><mo 
class="MathClass-close">)</mo><mo 
class="MathClass-punc">,</mo></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">       </mtd>
   </mtr></mtable>                                                                                    </mtd><mtd>
   </mtd></mtr></mtable>
</math></td><td class="eq-no">(5)</td></tr></table>
<!--l. 1274--><p class="indent" >   where <!--l. 1274--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>d</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
></math> is a user defined
focusing delay and <!--l. 1274--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
> <mo 
class="MathClass-rel">=</mo> <mi 
>k</mi><mi 
>T</mi><mi 
>s</mi></math>,
for <!--l. 1274--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>k</mi> <mo 
class="MathClass-rel">=</mo> <mn>0</mn><mo 
class="MathClass-punc">,</mo><mn>1</mn><mo 
class="MathClass-punc">,</mo><mo 
class="MathClass-op">&#x2026;</mo><mi 
>K</mi> <mo 
class="MathClass-bin">&#x2212;</mo> <mn>1</mn></math>. The
scaling factor </p><table class="equation"><tr><td> <a 
 id="x1-23003r6"></a>
<!--l. 1277--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
                                      <msub><mrow 
><mi 
>a</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
> <mo 
class="MathClass-rel">=</mo> <mfrac><mrow 
><msub><mrow 
><mi 
>w</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
><mi 
>&#x0394;</mi><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
></mrow> 
 <mrow 
><mn>2</mn><mi 
>&#x03C0;</mi><msub><mrow 
><mi 
>R</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
></mrow></mfrac>
</math></td><td class="eq-no">(6)</td></tr></table>
<!--l. 1282--><p class="indent" >   in&#x00A0;(<a 
href="#x1-23002r5">5<!--tex4ht:ref: eq:dream_sum --></a>) represents the amplitude of the impulse response for an elementary surface at
<!--l. 1283--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></mrow><mrow 
><mi 
>j</mi></mrow></msub 
></math> excited by a Dirac pulse. Hence,
                                                                                       
                                                                                       
the total response, at time <!--l. 1284--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
></math>,
is a sum of contributions from those elementary surface elements,
<!--l. 1285--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x0394;</mi><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
></math>, whose response arrive
in the time interval <!--l. 1286--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-open">[</mo><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
> <mo 
class="MathClass-bin">&#x2212;</mo> <mi 
>T</mi><mi 
>s</mi><mo 
class="MathClass-bin">&#x2215;</mo><mn>2</mn><mo 
class="MathClass-punc">,</mo><msub><mrow 
><mi 
>t</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
> <mo 
class="MathClass-bin">+</mo> <mi 
>T</mi><mi 
>s</mi><mo 
class="MathClass-bin">&#x2215;</mo><mn>2</mn><mo 
class="MathClass-close">]</mo></math>.
</p><!--l. 1288--><p class="indent" >   The accuracy of the method depends on the size of the discretization surfaces
<!--l. 1289--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x0394;</mi><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
></math>. It
should, however, be noted that high frequency numerical noise due to the surface discretization is in
practice not critical since the transducer&#x2019;s electrical impulse response has a bandwidth in the low
frequency range (for a further discussion see&#x00A0;[<a 
href="#XPiwakowski1999">2</a>]). Also, these errors are small if the elementary surfaces,
<!--l. 1293--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x0394;</mi><msub><mrow 
><mi 
>S</mi></mrow><mrow 
><mi 
>j</mi></mrow></msub 
></math>, are
small. The DR-method is very flexible in the sense that beam steering, focusing, apodization, and non-uniform
surface velocity can easily be included in the simulation.
</p>
   <h4 class="subsectionHead"><span class="titlemark">5.4   </span> <a 
 id="x1-240005.4"></a>Lossy Media</h4>
<!--l. 1301--><p class="noindent" >The computational procedure for an attenuation free medium implies a Dirac-type Green&#x2019;s function&#x00A0;[<a 
href="#XPiwakowski1989">1</a>]. The
discrete approach in the DREAM toolbox above is, however, also applicable to the problems characterized by an
arbitrarily shaped causal Green&#x2019;s function. In such a case a Dirac function is simply replaced by a
sampled version of this function. This characteristic extends the field of applications and allows,
for example, the computations for lossy media. For such a case, the free space Green&#x2019;s function
<!--l. 1308--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mfrac><mrow 
><mi 
>&#x03B4;</mi><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-bin">&#x2212;</mo><mo 
class="MathClass-rel">|</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>s</mi><mo 
class="MathClass-bin">&#x2212;</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>o</mi><mo 
class="MathClass-rel">|</mo><mo 
class="MathClass-bin">&#x2215;</mo><mi 
>c</mi><mo 
class="MathClass-close">)</mo></mrow>
   <mrow 
><mn>4</mn><mi 
>&#x03C0;</mi><mo 
class="MathClass-rel">|</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>s</mi><mo 
class="MathClass-bin">&#x2212;</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>o</mi><mo 
class="MathClass-rel">|</mo></mrow></mfrac>  </math>, where
<!--l. 1309--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>s</mi></math>is a point in the
transducer surface and <!--l. 1309--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>o</mi></math>is
the observation point, should be replaced by its causal counterpart
<!--l. 1310--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>g</mi></mrow><mrow 
><mi 
>&#x03B1;</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-punc">,</mo><mo 
class="MathClass-rel">|</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>s</mi> <mo 
class="MathClass-bin">&#x2212;</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>o</mi><mo 
class="MathClass-rel">|</mo><mo 
class="MathClass-close">)</mo></math> related
to the medium with absorption. The solution for lossy media used in the DREAM toolbox for
<!--l. 1311--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>g</mi></mrow><mrow 
><mi 
>&#x03B1;</mi></mrow></msub 
></math> has the
following frequency-domain form&#x00A0;[<a 
href="#XPiwakowski1989">1</a>, <a 
href="#XAki1980">5</a>]: </p><table class="equation"><tr><td> <a 
 id="x1-24001r7"></a>
<!--l. 1314--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
                        <msub><mrow 
><mi 
>G</mi></mrow><mrow 
><mi 
>&#x03B1;</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>j</mi><mi 
>&#x03C9;</mi><mo 
class="MathClass-punc">,</mo><mo 
class="MathClass-rel">|</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>s</mi> <mo 
class="MathClass-bin">&#x2212;</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>o</mi><mo 
class="MathClass-rel">|</mo><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-rel">=</mo>       <mfrac><mrow 
><mn>1</mn></mrow> 
<mrow 
><mn>4</mn><mi 
>&#x03C0;</mi><mo 
class="MathClass-rel">|</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>s</mi> <mo 
class="MathClass-bin">&#x2212;</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>o</mi><mo 
class="MathClass-rel">|</mo></mrow></mfrac><msup><mrow 
><mi 
>e</mi></mrow><mrow 
><mi 
>j</mi><mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>k</mi></mrow><mrow 
><mn>1</mn></mrow></msub 
><mo 
class="MathClass-rel">|</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>s</mi><mo 
class="MathClass-bin">&#x2212;</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>o</mi><mo 
class="MathClass-rel">|</mo><mo 
class="MathClass-bin">&#x2212;</mo><mi 
>&#x03C9;</mi><mi 
>t</mi><mo 
class="MathClass-close">)</mo></mrow></msup 
>
</math></td><td class="eq-no">(7)</td></tr></table>
<!--l. 1319--><p class="indent" >   where </p><table class="equation"><tr><td> <a 
 id="x1-24002r8"></a>
                                                                                       
                                                                                       
<!--l. 1320--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
                            <msub><mrow 
><mi 
>k</mi></mrow><mrow 
><mn>1</mn></mrow></msub 
> <mo 
class="MathClass-rel">=</mo> <mfrac><mrow 
><mi 
>&#x03C9;</mi></mrow> 
<mrow 
><mi 
>c</mi></mrow></mfrac> <mo class="MathClass-open" fence="true" mathsize="2.03em" >[</mo><mn>1</mn> <mo 
class="MathClass-bin">+</mo> <mfrac><mrow 
><mi 
>c</mi><msub><mrow 
><mi 
>&#x03B1;</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
></mrow> 
 <mrow 
><msup><mrow 
><mi 
>&#x03C0;</mi></mrow><mrow 
><mn>2</mn></mrow></msup 
></mrow></mfrac> <mo class="qopname"> ln</mo><!--nolimits--><mo class="MathClass-open" fence="true" mathsize="2.03em" >(</mo>  <mfrac><mrow 
><mn>1</mn></mrow> 
<mrow 
><msub><mrow 
><mi 
>&#x03B1;</mi></mrow><mrow 
><mn>1</mn></mrow></msub 
><mi 
>&#x03C9;</mi></mrow></mfrac><mo class="MathClass-close" fence="true" mathsize="2.03em" >)</mo><mo class="MathClass-close" fence="true" mathsize="2.03em" >]</mo> <mo 
class="MathClass-bin">+</mo> <msub><mrow 
><mi 
>&#x03B1;</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
><mi 
>f</mi><mo 
class="MathClass-punc">,</mo>
</math></td><td class="eq-no">(8)</td></tr></table>
<!--l. 1326--><p class="indent" >   <!--l. 1326--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>&#x03B1;</mi></mrow><mrow 
><mn>1</mn></mrow></msub 
> <mo 
class="MathClass-rel">=</mo> <mi 
>&#x03C0;</mi><mo 
class="MathClass-bin">&#x2215;</mo><mn>0</mn><mo 
class="MathClass-punc">.</mo><mn>9</mn><mn>5</mn></math>, and
<!--l. 1326--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>&#x03B1;</mi></mrow><mrow 
><mn>0</mn></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>&#x03B1;</mi><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-rel">=</mo>      <mfrac><mrow 
><mi 
>&#x03B1;</mi></mrow> 
<mrow 
><mn>8</mn><mo 
class="MathClass-punc">.</mo><mn>6</mn><mn>8</mn><mn>6</mn><mo 
class="MathClass-bin">&#x00D7;</mo><mn>1</mn><msup><mrow 
><mn>0</mn></mrow><mrow 
><mn>4</mn></mrow></msup 
></mrow></mfrac> </math>.
The time-domain transfer function is then obtained by means of the inverse Fourier transform </p><table class="equation"><tr><td>
<a 
 id="x1-24003r9"></a>
<!--l. 1330--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
                          <msub><mrow 
><mi 
>g</mi></mrow><mrow 
><mi 
>&#x03B1;</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-punc">,</mo><mo 
class="MathClass-rel">|</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>s</mi> <mo 
class="MathClass-bin">&#x2212;</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>o</mi><mo 
class="MathClass-rel">|</mo><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-rel">=</mo> <msup><mrow 
><mi 
mathvariant="bold-script">&#x2131;</mi></mrow><mrow 
><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></mrow></msup 
><mo 
class="MathClass-open">{</mo><msub><mrow 
><mi 
>G</mi></mrow><mrow 
>
<mi 
>&#x03B1;</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>j</mi><mi 
>&#x03C9;</mi><mo 
class="MathClass-punc">,</mo><mo 
class="MathClass-rel">|</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>s</mi> <mo 
class="MathClass-bin">&#x2212;</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mi 
>o</mi><mo 
class="MathClass-rel">|</mo><mo 
class="MathClass-close">)</mo><mo 
class="MathClass-close">}</mo><mo 
class="MathClass-punc">.</mo>
</math></td><td class="eq-no">(9)</td></tr></table>
<!--l. 1335--><p class="indent" >   In the DREAM toolbox this computation is performed by a discrete Fourier transform for each surface element
<span 
class="cmtt-10">dx</span><!--l. 1336--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x00D7;</mo></math><span 
class="cmtt-10">dy</span>.
An illustration of the effects due to lossy media for an attenuation of coefficient,
<!--l. 1337--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x03B1;</mi></math> of 1
[db/cm MHz] is shown in Figure&#x00A0;<a 
href="#x1-240066">6<!--tex4ht:ref: fig:lossy --></a> for 10 mm, 25 mm, and 40 mm respectively. </p><hr class="figure" /><div class="figure" 
>
                                                                                       
                                                                                       
<a 
 id="x1-240066"></a>
                                                                                       
                                                                                       
<div class="center" 
>
<!--l. 1340--><p class="noindent" >
<a 
 id="x1-24004r1"></a>
</p>
<div class="subfigure"><table><tr><td style="text-align:left"><img 
src="userman7x.png" alt="PIC" class="graphics" width="473.77pt" height="407.5225pt"  /><!--tex4ht:graphics  
name="userman7x.png" src="eps/lossy_time.eps"  
-->
         <div class="subfigcaption"><span 
class="cmr-8">(a) Time domain response. </span></div>         </td></tr></table></div>    <a 
 id="x1-24005r2"></a><div class="subfigure"><table><tr><td style="text-align:left"><img 
src="userman8x.png" alt="PIC" class="graphics" width="493.84499pt" height="406.51875pt"  /><!--tex4ht:graphics  
name="userman8x.png" src="eps/lossy_freq.eps"  
-->
             <div class="subfigcaption"><span 
class="cmr-8">(b) Frequency domain response. </span></div>               </td></tr></table></div></div>
<br /> <div class="caption" 
><span class="id">Figure&#x00A0;6: </span><span  
class="content">Illustration of the attenuation response at three different depths. The attenuation coefficient,
<!--l. 1349--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x03B1;</mi></math>,
was 1 [db/cm MHz] and the attenuation response at 10 mm is the solid line, 25 mm is the dashed line,
and 40 mm is dash-dotted line, respectively. </span></div><!--tex4ht:label?: x1-240066 -->
                                                                                       
                                                                                       
   </div><hr class="endfigure" />
   <h3 class="sectionHead"><span class="titlemark">6   </span> <a 
 id="x1-250006"></a>A Quick Start to DREAM Simulations</h3>
  <!--l. 1362--><p class="noindent" ><span 
class="cmr-10x-x-277">I</span>N his section a quick start on how to perform simulations with DREAM is presented. Here only
  a simple example is shown just to illustrate what is needed to simulate an ultrasonic measurement system. We
will use a circular transducers for this example but more advanced examples can be found on the
DREAM web page <a 
href="http://www.signal.uu.se/Toolbox/dream/" class="url" ><span 
class="cmtt-10">http://www.signal.uu.se/Toolbox/dream/</span></a> on the <span 
class="cmti-10">Examples </span>page. Also more
details of the various functions in the DREAM Toolbox can be found in Sections&#x00A0;<a 
href="#x1-260007">7<!--tex4ht:ref: sec:transducer-functions --></a>, <a 
href="#x1-580008">8<!--tex4ht:ref: sec:parallel --></a>, and&#x00A0;<a 
href="#x1-6000010">10<!--tex4ht:ref: sec:misc-functions --></a>,
respectively.
</p><!--l. 1369--><p class="indent" >   Let us study a the pressure response for a circular transducer using water as the propagation medium (with a
sound speed <!--l. 1370--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>c</mi><mi 
>p</mi> <mo 
class="MathClass-rel">=</mo> <mn>1</mn><mn>5</mn><mn>0</mn><mn>0</mn></math>
[m/s]). We start by setting the sampling frequency and defining the points of interest,
the so-called observation points. The observation points are located on a line at
<!--l. 1372--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>z</mi> <mo 
class="MathClass-rel">=</mo> <mn>1</mn><mn>0</mn></math> mm,
from 1&#x2013;50 mm with 1 mm between them:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-8">
Fs&#x00A0;=&#x00A0;10;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;Sampling&#x00A0;freq.&#x00A0;in&#x00A0;MHz.
&#x00A0;<br />Ts&#x00A0;=&#x00A0;1/Fs;
&#x00A0;<br />
&#x00A0;<br />%
&#x00A0;<br />%&#x00A0;Observation&#x00A0;point(s).
&#x00A0;<br />%
&#x00A0;<br />
&#x00A0;<br />%&#x00A0;Depth
&#x00A0;<br />z&#x00A0;=&#x00A0;10;&#x00A0;%&#x00A0;[mm]
&#x00A0;<br />
&#x00A0;<br />%&#x00A0;&#x00A0;Points&#x00A0;along&#x00A0;x-axis.
&#x00A0;<br />d&#x00A0;&#x00A0;=&#x00A0;1;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;[mm]
&#x00A0;<br />xo&#x00A0;=&#x00A0;(0:d:50);&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;0-50&#x00A0;mm.
&#x00A0;<br />yo&#x00A0;=&#x00A0;zeros(length(xo),1);
&#x00A0;<br />zo&#x00A0;=&#x00A0;z*ones(length(xo),1);
&#x00A0;<br />Ro&#x00A0;=&#x00A0;[xo(:)&#x00A0;yo(:)&#x00A0;zo(:)];
</div>
<!--l. 1391--><p class="nopar" >
</p><!--l. 1394--><p class="indent" >   Then we need to define the discretization parameters for both the transducer surface and the temporal
sampling:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-9">
%&#x00A0;Descretization&#x00A0;parameters.
&#x00A0;<br />dx&#x00A0;=&#x00A0;0.03;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;[mm].
&#x00A0;<br />dy&#x00A0;=&#x00A0;0.03;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;[mm]
&#x00A0;<br />dt&#x00A0;=&#x00A0;Ts;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;[us].
&#x00A0;<br />nt&#x00A0;=&#x00A0;400;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;Length&#x00A0;of&#x00A0;spatial&#x00A0;impulse&#x00A0;response&#x00A0;vector.
&#x00A0;<br />s_par&#x00A0;=&#x00A0;[dx&#x00A0;dy&#x00A0;dt&#x00A0;nt];
</div>
<!--l. 1405--><p class="nopar" >
</p><!--l. 1408--><p class="indent" >   We must also define the sound speed of the medium, normal velocity, and attenuation. Here we choose an attenuation
free medium (<!--l. 1409--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x03B1;</mi> <mo 
class="MathClass-rel">=</mo> <mn>0</mn></math>)
and a unit normal velocity:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-10">
%&#x00A0;Material&#x00A0;parameters.
&#x00A0;<br />v&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;=&#x00A0;1.0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;Normal&#x00A0;velocity.
&#x00A0;<br />cp&#x00A0;&#x00A0;&#x00A0;&#x00A0;=&#x00A0;1500;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;Sound&#x00A0;speed.
&#x00A0;<br />alfa&#x00A0;&#x00A0;=&#x00A0;0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;Absorbtion&#x00A0;[dB/(cm&#x00A0;MHz)].
&#x00A0;<br />m_par&#x00A0;=&#x00A0;[v&#x00A0;cp&#x00A0;alfa];
</div>
<!--l. 1417--><p class="nopar" >
</p><!--l. 1420--><p class="indent" >   The size of the transducer must also be defined, here we use a circular transducer with a 5 mm
radius:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-11">
%&#x00A0;Geometrical&#x00A0;parameters.
&#x00A0;<br />r&#x00A0;=&#x00A0;5;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;Radius&#x00A0;[mm].
&#x00A0;<br />geom_par&#x00A0;=&#x00A0;[r];
&#x00A0;<br />
</div>
<!--l. 1428--><p class="nopar" >
</p><!--l. 1431--><p class="indent" >   Finally we set the start point of the SIR and call the DREAM function <span 
class="cmtt-10">dreamcirc </span>to compute the discrete
SIRs:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-12">
%&#x00A0;Delay.
&#x00A0;<br />t_z&#x00A0;=&#x00A0;z*1e3/cp;
&#x00A0;<br />%delay&#x00A0;=&#x00A0;0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;Start&#x00A0;at&#x00A0;0&#x00A0;[us].
&#x00A0;<br />delay&#x00A0;=&#x00A0;t_z;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;Start&#x00A0;at&#x00A0;t_z&#x00A0;[us].
&#x00A0;<br />
&#x00A0;<br />H&#x00A0;=&#x00A0;dreamcirc(Ro,geom_par,s_par,delay,m_par,&#x2019;stop&#x2019;);
</div>
<!--l. 1441--><p class="nopar" >
</p><!--l. 1448--><p class="noindent" >
</p>
   <h3 class="sectionHead"><span class="titlemark">7   </span> <a 
 id="x1-260007"></a>Transducer Function Reference</h3>
    <!--l. 1451--><p class="noindent" ><span 
class="cmr-10x-x-277">T</span>HE transducer functions are implemented as <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span> </span><span 
class="cmti-10">mex</span>-functions and Octave&#x00A0;<span 
class="cmti-10">oct</span>-functions;
    a <span 
class="cmti-10">mex/oct</span>-function is pre-compiled code that is dynamically linked to <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>/Octave at run time. This
greatly increases the computation speed compared to using ordinary m-files since the DR-concept (see&#x00A0;[<a 
href="#XPiwakowski1999">2</a>])
uses <span 
class="cmtt-10">for </span>and <span 
class="cmtt-10">while </span>loops extensively. An overview of the transducer functions can be found in
Table&#x00A0;<a 
href="#x1-260011">1<!--tex4ht:ref: tab:overview --></a>.
</p>
   <div class="table">
                                                                                       
                                                                                       
<!--l. 1459--><p class="indent" >   <a 
 id="x1-260011"></a></p><hr class="float" /><div class="float" 
>
                                                                                       
                                                                                       
<div class="tabular"> <table id="TBL-4" class="tabular" 
cellspacing="0" cellpadding="0" rules="groups" 
><colgroup id="TBL-4-1g"><col 
id="TBL-4-1" /></colgroup><colgroup id="TBL-4-2g"><col 
id="TBL-4-2" /></colgroup><tr 
class="hline"><td><hr /></td><td><hr /></td></tr><tr 
class="hline"><td><hr /></td><td><hr /></td></tr><tr  
 style="vertical-align:baseline;" id="TBL-4-1-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-1-1"  
class="td11"><span 
class="cmbx-10">Transducer type                                    </span></td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-1-2"  
class="td11"><span 
class="cmbx-10">DREAM function </span></td>
</tr><tr 
class="hline"><td><hr /></td><td><hr /></td></tr><tr 
class="hline"><td><hr /></td><td><hr /></td></tr><tr  
 style="vertical-align:baseline;" id="TBL-4-2-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-2-1"  
class="td11">Strip transducer                                              </td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-2-2"  
class="td11"><span 
class="cmtt-10">dreamline         </span></td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-4-3-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-3-1"  
class="td11">Rectangular transducer                                    </td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-3-2"  
class="td11"><span 
class="cmtt-10">dreamrect         </span></td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-4-4-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-4-1"  
class="td11">Focused rectangular transducer                          </td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-4-2"  
class="td11"><span 
class="cmtt-10">dreamrect</span><span 
class="cmtt-10">_f       </span></td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-4-5-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-5-1"  
class="td11">Circular transducer                                          </td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-5-2"  
class="td11"><span 
class="cmtt-10">dreamcirc         </span></td></tr><tr  
 style="vertical-align:baseline;" id="TBL-4-6-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-6-1"  
class="td11">Focused circular transducer </td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-6-2"  
class="td11"><span 
class="cmtt-10">dreamcirc</span><span 
class="cmtt-10">_f</span></td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-4-7-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-7-1"  
class="td11">Spherical concave transducer (focused)                </td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-7-2"  
class="td11"><span 
class="cmtt-10">dreamsphere</span><span 
class="cmtt-10">_f     </span></td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-4-8-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-8-1"  
class="td11">Spherical convex transducer (defocused)              </td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-8-2"  
class="td11"><span 
class="cmtt-10">dreamsphere</span><span 
class="cmtt-10">_d     </span></td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-4-9-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-9-1"  
class="td11">Cylindrical concave transducer (focused)              </td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-9-2"  
class="td11"><span 
class="cmtt-10">dreamcylind</span><span 
class="cmtt-10">_f     </span></td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-4-10-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-10-1"  
class="td11">Cylindrical convex transducer (defocused)            </td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-10-2"  
class="td11"><span 
class="cmtt-10">dreamcylind</span><span 
class="cmtt-10">_d     </span></td>
</tr><tr 
class="hline"><td><hr /></td><td><hr /></td></tr><tr  
 style="vertical-align:baseline;" id="TBL-4-11-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-11-1"  
class="td11">Array with rectangular elements                         </td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-11-2"  
class="td11"><span 
class="cmtt-10">dream</span><span 
class="cmtt-10">_arr</span><span 
class="cmtt-10">_rect    </span></td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-4-12-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-12-1"  
class="td11">Array with circular elements                              </td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-12-2"  
class="td11"><span 
class="cmtt-10">dream</span><span 
class="cmtt-10">_arr</span><span 
class="cmtt-10">_circ    </span></td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-4-13-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-13-1"  
class="td11">Array with cylindrical concave elements (focused)  </td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-13-2"  
class="td11"><span 
class="cmtt-10">dream</span><span 
class="cmtt-10">_arr</span><span 
class="cmtt-10">_cylind</span><span 
class="cmtt-10">_f</span></td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-4-14-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-14-1"  
class="td11">Array with cylindrical convex elements (defocused)</td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-14-2"  
class="td11"><span 
class="cmtt-10">dream</span><span 
class="cmtt-10">_arr</span><span 
class="cmtt-10">_cylind</span><span 
class="cmtt-10">_d</span></td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-4-15-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-15-1"  
class="td11">Annular array                                                 </td><td  style="text-align:left; white-space:nowrap;" id="TBL-4-15-2"  
class="td11"><span 
class="cmtt-10">dream</span><span 
class="cmtt-10">_arr</span><span 
class="cmtt-10">_annu    </span></td>
</tr><tr 
class="hline"><td><hr /></td><td><hr /></td></tr><tr 
class="hline"><td><hr /></td><td><hr /></td></tr><tr  
 style="vertical-align:baseline;" id="TBL-4-16-"><td  style="text-align:left; white-space:nowrap;" id="TBL-4-16-1"  
class="td11">                                           </td></tr></table></div>
<br /> <div class="caption" 
><span class="id">Table&#x00A0;1: </span><span  
class="content">Overview of the DREAM toolbox transducer functions. </span></div><!--tex4ht:label?: x1-260011 -->
                                                                                       
                                                                                       
   </div><hr class="endfloat" />
   </div>
<!--l. 1489--><p class="indent" >   By convention, a transducer function name ending with &#x201C;<span 
class="cmtt-10">_f</span>&#x201D; is a focused transducer (or has
focused transducer elements) and a transducer function name ending with &#x201C;<span 
class="cmtt-10">_d</span>&#x201D; is defocused (convex)
transducer.
</p><!--l. 1493--><p class="indent" >   The transducer functions can be divided in two groups, <span 
class="cmti-10">single transducer functions </span>and <span 
class="cmti-10">array functions</span>.
The names of both groups starts with &#x201C;<span 
class="cmtt-10">dream</span>&#x201D; and the array functions are distinguished from
single transducer functions by &#x201C;<span 
class="cmtt-10">_arr</span><span 
class="cmtt-10">_</span>&#x201D;. Note that arbitrary arrays (with mixed forms of transducer
elements) can be modeled using the single transducer functions and then adding their corresponding
responses.
</p>
   <h4 class="subsectionHead"><span class="titlemark">7.1   </span> <a 
 id="x1-270007.1"></a>Input Parameters Common to all Transducer Functions</h4>
<!--l. 1502--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.1.1   </span> <a 
 id="x1-280007.1.1"></a>Observation Point(s) Parameter</h5>
<!--l. 1505--><p class="noindent" >The transducer functions can compute SIRs for multiple observation points. The observation points are given by a
<!--l. 1506--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>N</mi> <mo 
class="MathClass-bin">&#x00D7;</mo> <mn>3</mn></math> matrix <span 
class="cmtt-10">Ro </span>were the first column
contains the <!--l. 1506--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>x</mi></math>-coordinates, the
second the <!--l. 1507--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>y</mi></math>-coordinates, and
the third the <!--l. 1507--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>z</mi></math>-coordinates,
respectively (<!--l. 1507--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>N</mi></math>
is the number of observation points).
</p><!--l. 1509--><p class="indent" >   The single element transducers are, by convention, all centered at
<!--l. 1509--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>r</mi></mstyle> <mo 
class="MathClass-rel">=</mo> <mo 
class="MathClass-open">(</mo><mn>0</mn><mo 
class="MathClass-punc">,</mo><mn>0</mn><mo 
class="MathClass-punc">,</mo><mn>0</mn><mo 
class="MathClass-close">)</mo></math> and the
SIRs are computed relative to this center point. The array functions uses a grid matrix <span 
class="cmtt-10">G </span>to define the positions
of the array elements (see Section&#x00A0;<a 
href="#x1-470007.4">7.4<!--tex4ht:ref: sec:array-par --></a>). The SIRs are therefore computed relative the positions given by the grid
matrix for the arrays.
</p><!--l. 1516--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.1.2   </span> <a 
 id="x1-290007.1.2"></a>Sampling Parameters</h5>
<!--l. 1519--><p class="noindent" >The four-element vector <span 
class="cmtt-10">s</span><span 
class="cmtt-10">_par = [dx dy dt nt] </span>determines the spatial discretization and the
temporal sampling properties. The spatial discretization of the transducer surface is given by
<span 
class="cmtt-10">dx</span><!--l. 1521--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x00D7;</mo></math><span 
class="cmtt-10">dy</span>; small
values of <span 
class="cmtt-10">dx </span>and <span 
class="cmtt-10">dy </span>results in a finer mesh, and a higher numerical accuracy, compared to larger ones. The temporal
sampling interval <!--l. 1524--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x0394;</mi><mi 
>t</mi></math>
(or <!--l. 1524--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>T</mi><mi 
>s</mi></math>) is
given by <span 
class="cmtt-10">dt </span>and the length of the SIR-vector is determined by <span 
class="cmtt-10">nt</span>. If <span 
class="cmtt-10">nt </span>is chosen too low so that any non-zero
component of the SIR is not within the time-window defined by <span 
class="cmtt-10">[delay dt*(nt-1)+delay] </span>an error message
will be printed (See Section&#x00A0;<a 
href="#x1-300007.1.3">7.1.3<!--tex4ht:ref: sec:delay --></a> for a description of the <span 
class="cmtt-10">delay </span>parameter and Section&#x00A0;<a 
href="#x1-330007.1.6">7.1.6<!--tex4ht:ref: sec:error --></a> for a description of
the error handling in the DREAM toolbox).
                                                                                       
                                                                                       
     </p><dl class="description"><dt class="description">
<span 
class="cmtt-10">dx</span> </dt><dd 
class="description">Spatial discretization size in x-direction [mm].
     </dd><dt class="description">
<span 
class="cmtt-10">dy</span> </dt><dd 
class="description">Spatial discretization size in y-direction [mm].
     </dd><dt class="description">
<span 
class="cmtt-10">dt</span> </dt><dd 
class="description">Temporal discretization size [<!--l. 1533--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x03BC;</mi></math>s]
     (<!--l. 1533--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>T</mi><mi 
>s</mi> <mo 
class="MathClass-rel">=</mo> <mi 
>&#x0394;</mi><mi 
>t</mi></math>
     = 1/sampling freq).
     </dd><dt class="description">
<span 
class="cmtt-10">nt</span> </dt><dd 
class="description">Length of spatial impulse response vector.</dd></dl>
<!--l. 1537--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.1.3   </span> <a 
 id="x1-300007.1.3"></a>The Delay Parameter</h5>
<!--l. 1540--><p class="noindent" >The starting point of the SIR-vector(s) is given by the delay parameter <span 
class="cmtt-10">delay</span>
([<!--l. 1540--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x03BC;</mi></math>s]).
The delay parameter can either be a scalar, then all SIRs will have the same starting point, or it can be a vector
with a length that must be equal to the number of observation points. In the latter case each observation point
has a SIR with a different starting point.
</p><!--l. 1548--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.1.4   </span> <a 
 id="x1-310007.1.4"></a>Material Parameters</h5>
<!--l. 1551--><p class="noindent" >The material parameters are given by the three-element vector <span 
class="cmtt-10">m</span><span 
class="cmtt-10">_par = [v cp alfa]</span>:
     </p><dl class="description"><dt class="description">
<span 
class="cmtt-10">v</span> </dt><dd 
class="description">Normal velocity of the transducer surface[m/s].
     </dd><dt class="description">
<span 
class="cmtt-10">cp</span> </dt><dd 
class="description">Sound velocity of the medium [m/s].
     </dd><dt class="description">
<span 
class="cmtt-10">alfa</span> </dt><dd 
class="description">Attenuation coefficient [dB/(cm MHz)].</dd></dl>
<!--l. 1559--><p class="noindent" >Note: if <span 
class="cmtt-10">alfa </span><!--l. 1559--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-rel">&#x2260;</mo><mn>0</mn></math>
then the SIRs are compensated for attenuation. Note that the attenuation calculation involves a
computation of an inverse discrete Fourier transform of length <span 
class="cmtt-10">nt </span>for every surface element
<span 
class="cmtt-10">dx</span><!--l. 1561--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x00D7;</mo></math><span 
class="cmtt-10">dy</span>&#x00A0;[<a 
href="#XPiwakowski1999">2</a>]
This results in a longer computation time compared to when <span 
class="cmtt-10">alfa </span>= 0. See also Section&#x00A0;<a 
href="#x1-6200010.2">10.2<!--tex4ht:ref: sec:misc-att --></a>.
</p><!--l. 1565--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.1.5   </span> <a 
 id="x1-320007.1.5"></a>Focusing parameters</h5>
                                                                                       
                                                                                       
<!--l. 1569--><p class="noindent" >The focusing in the DREAM toolbox is controlled with the two parameters <span 
class="cmtt-10">foc</span><span 
class="cmtt-10">_met </span>and <span 
class="cmtt-10">focal</span>. The <span 
class="cmtt-10">foc</span><span 
class="cmtt-10">_met</span>
parameters is a text string that selects the focusing method, options are:
     </p><dl class="description"><dt class="description">
<span 
class="cmtt-10">&#x2019;off&#x2019;</span> </dt><dd 
class="description">: focusing not used.
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;x&#x2019;</span> </dt><dd 
class="description">: focus in <!--l. 1574--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>x</mi></math>
     only, <!--l. 1574--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mfenced separators="" 
open="("  close=")" ><mrow><msqrt><mrow><msup><mrow 
><mi 
>x</mi></mrow><mrow 
><mn>2</mn> </mrow> </msup 
> <mo 
class="MathClass-bin">+</mo> <msubsup><mrow 
><mi 
>z</mi></mrow><mrow 
><mi 
>f</mi> </mrow> <mrow 
>  <mn>2</mn></mrow></msubsup 
></mrow></msqrt></mrow></mfenced> <mo 
class="MathClass-bin">&#x2215;</mo><mi 
>c</mi><mi 
>p</mi></math>.
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;y&#x2019;</span> </dt><dd 
class="description">: focus in <!--l. 1575--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>y</mi></math>
     only, <!--l. 1575--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mfenced separators="" 
open="("  close=")" ><mrow><msqrt><mrow><msup><mrow 
><mi 
>y</mi></mrow><mrow 
><mn>2</mn> </mrow> </msup 
> <mo 
class="MathClass-bin">+</mo> <msubsup><mrow 
><mi 
>z</mi></mrow><mrow 
><mi 
>f</mi> </mrow> <mrow 
>  <mn>2</mn></mrow></msubsup 
></mrow></msqrt></mrow></mfenced> <mo 
class="MathClass-bin">&#x2215;</mo><mi 
>c</mi><mi 
>p</mi></math>.
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;xy&#x2019;</span> </dt><dd 
class="description">: focus in both <!--l. 1576--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>x</mi></math>
     and <!--l. 1576--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>y</mi></math>,
     <!--l. 1576--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mfenced separators="" 
open="("  close=")" ><mrow><msqrt><mrow><msup><mrow 
><mi 
>x</mi></mrow><mrow 
><mn>2</mn> </mrow> </msup 
> <mo 
class="MathClass-bin">+</mo> <msup><mrow 
><mi 
>y</mi></mrow><mrow 
><mn>2</mn> </mrow> </msup 
> <mo 
class="MathClass-bin">+</mo> <msubsup><mrow 
><mi 
>z</mi></mrow><mrow 
><mi 
>f</mi> </mrow> <mrow 
>  <mn>2</mn></mrow></msubsup 
></mrow></msqrt></mrow></mfenced> <mo 
class="MathClass-bin">&#x2215;</mo><mi 
>c</mi><mi 
>p</mi></math>.
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;x+y&#x2019;</span> </dt><dd 
class="description">: focus in <!--l. 1577--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>x</mi> <mo 
class="MathClass-bin">+</mo> <mi 
>y</mi></math>,
     <!--l. 1577--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mfenced separators="" 
open="("  close=")" ><mrow><msqrt><mrow><msup><mrow 
><mi 
>x</mi></mrow><mrow 
><mn>2</mn> </mrow> </msup 
> <mo 
class="MathClass-bin">+</mo> <msubsup><mrow 
><mi 
>z</mi></mrow><mrow 
><mi 
>f</mi> </mrow> <mrow 
>  <mn>2</mn></mrow></msubsup 
></mrow></msqrt> <mo 
class="MathClass-bin">+</mo> <msqrt><mrow><msup><mrow 
><mi 
>y</mi></mrow><mrow 
><mn>2</mn> </mrow> </msup 
> <mo 
class="MathClass-bin">+</mo> <msubsup><mrow 
><mi 
>z</mi></mrow><mrow 
><mi 
>f</mi> </mrow> <mrow 
>  <mn>2</mn></mrow></msubsup 
></mrow></msqrt></mrow></mfenced> <mo 
class="MathClass-bin">&#x2215;</mo><mi 
>c</mi><mi 
>p</mi></math>.</dd></dl>
<!--l. 1595--><p class="indent" >   This type of focusing is used for the two single transducer functions (<span 
class="cmtt-10">dreamrect</span><span 
class="cmtt-10">_f </span>and <span 
class="cmtt-10">dreamcirc</span><span 
class="cmtt-10">_f </span>see
Section&#x00A0;<a 
href="#x1-370007.3">7.3<!--tex4ht:ref: sec:single --></a>) and for the array functions (Section&#x00A0;<a 
href="#x1-520007.5">7.5<!--tex4ht:ref: sec:array --></a>). The spherical and cylindrical transducer functions also
use focusing but there focusing is controlled by a single parameter <span 
class="cmtt-10">R </span>(see Sections&#x00A0;<a 
href="#x1-430007.3.6">7.3.6<!--tex4ht:ref: sec:spher_f --></a>, <a 
href="#x1-440007.3.7">7.3.7<!--tex4ht:ref: sec:spher_d --></a>, <a 
href="#x1-450007.3.8">7.3.8<!--tex4ht:ref: sec:cyl_f --></a>, and
<a 
href="#x1-460007.3.9">7.3.9<!--tex4ht:ref: sec:cyl_d --></a>).
</p><!--l. 1601--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.1.6   </span> <a 
 id="x1-330007.1.6"></a>Error Handling</h5>
<!--l. 1604--><p class="noindent" >There are three levels of error reporting for the transducer functions. An error typically occur when the SIR do
not fit within the time window, defined by the delay, sampling period, and length parameters. The
levels are controlled by the optional <span 
class="cmtt-10">err</span><span 
class="cmtt-10">_level </span>parameter which is a text string with the following
alternatives:
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-33002x1"><span 
class="cmtt-10">&#x2019;ignore&#x2019;</span>: Here an error is silently ignored,
     </li>
     <li 
  class="enumerate" id="x1-33004x2"><span 
class="cmtt-10">&#x2019;warn&#x2019;</span>: An error message is printed but computation is not stopped,
     </li>
     <li 
  class="enumerate" id="x1-33006x3"><span 
class="cmtt-10">&#x2019;stop&#x2019;</span>: An error message is printed and the computation is stopped.
     </li></ol>
<!--l. 1619--><p class="noindent" >The error message contains a number that tells how many samples outside the time window the SIR is. The default
error level is <span 
class="cmtt-10">&#x2019;stop&#x2019; </span>(if the <span 
class="cmtt-10">err</span><span 
class="cmtt-10">_level </span>is omitted).
                                                                                       
                                                                                       
</p><!--l. 1622--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">7.2   </span> <a 
 id="x1-340007.2"></a>Output Parameters Common to all Transducer Functions</h4>
<!--l. 1624--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.2.1   </span> <a 
 id="x1-350007.2.1"></a>The SIR Output Argument</h5>
<!--l. 1626--><p class="noindent" >The first output argument of transducer functions, <span 
class="cmtt-10">H</span>, is a matrix or vector, containing the spatial impulse
response(s).
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-13">
&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dream***(&#x00A0;...&#x00A0;);
</div>
<!--l. 1631--><p class="nopar" > Each column <span 
class="cmtt-10">H </span>contain the SIR for the corresponding entry in the observation point input matrix <span 
class="cmtt-10">Ro </span>(see
Section&#x00A0;<a 
href="#x1-280007.1.1">7.1.1<!--tex4ht:ref: sec:obsarg --></a>).
</p><!--l. 1636--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.2.2   </span> <a 
 id="x1-360007.2.2"></a>The Error Output Argument</h5>
<!--l. 1638--><p class="noindent" >The second (optional) output argument, <span 
class="cmtt-10">err</span>, is negative if an error has occurred and 0 otherwise.
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-14">
&#x00A0;&#x00A0;[H,err]&#x00A0;=&#x00A0;dream***(&#x00A0;...&#x00A0;);
</div>
<!--l. 1643--><p class="nopar" > If, for example, <span 
class="cmtt-10">err</span><span 
class="cmtt-10">_level = &#x2019;ignore&#x2019; </span>then no error message will be printed but <span 
class="cmtt-10">err </span>will be negative if an
error occurred so the error can be detected. This is useful for displaying error dialog boxes in GUIs, for
example.
</p><!--l. 1651--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">7.3   </span> <a 
 id="x1-370007.3"></a>Single Element Transducers</h4>
<!--l. 1654--><p class="noindent" >As mentioned above all single element transducers are centered at
<!--l. 1654--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>r</mi></mstyle> <mo 
class="MathClass-rel">=</mo> <mo 
class="MathClass-open">(</mo><mn>0</mn><mo 
class="MathClass-punc">,</mo><mn>0</mn><mo 
class="MathClass-punc">,</mo><mn>0</mn><mo 
class="MathClass-close">)</mo></math>. There
is, however, no loss in generality since the response at other transducer positions can simply be obtained by
offsetting the coordinate system after computation.
</p><!--l. 1658--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.3.1   </span> <a 
 id="x1-380007.3.1"></a>Line (strip) Transducer</h5>
<!--l. 1660--><p class="noindent" >The line, or strip, transducer has a length <span 
class="cmtt-10">a </span>and a (small) thickness equal to <span 
class="cmtt-10">dy </span>(in <span 
class="cmtt-10">s</span><span 
class="cmtt-10">_par</span>).
</p><!--l. 1663--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-15">
&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dreamline(Ro,geom_par,s_par,delay,m_par,err_level);
</div>
<!--l. 1666--><p class="nopar" > <span 
class="cmbx-10">Geometrical parameters</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-16">
&#x00A0;&#x00A0;geom_par&#x00A0;=&#x00A0;[a];
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;a&#x00A0;[mm]&#x00A0;-&#x00A0;length&#x00A0;of&#x00A0;the&#x00A0;strip&#x00A0;(in&#x00A0;x-direction).
</div>
<!--l. 1672--><p class="nopar" >
</p><!--l. 1674--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.3.2   </span> <a 
 id="x1-390007.3.2"></a>Rectangular Transducer</h5>
<!--l. 1676--><p class="noindent" >The size of the rectangular transducer is determined by <span 
class="cmtt-10">a </span>and <span 
class="cmtt-10">b</span>.
</p><!--l. 1678--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-17">
&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dreamrect(Ro,geom_par,s_par,delay,m_par,err_level);
</div>
<!--l. 1681--><p class="nopar" >
</p><!--l. 1683--><p class="noindent" ><span 
class="cmbx-10">Geometrical parameters</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-18">
&#x00A0;&#x00A0;geom_par&#x00A0;=&#x00A0;[a&#x00A0;b];
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;a&#x00A0;[mm]&#x00A0;-&#x00A0;x-size.
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;b&#x00A0;[mm]&#x00A0;-&#x00A0;y-size.
</div>
<!--l. 1688--><p class="nopar" >
</p><!--l. 1690--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.3.3   </span> <a 
 id="x1-400007.3.3"></a>Rectangular Focused Transducer</h5>
<!--l. 1692--><p class="noindent" >The size of the rectangular focused transducer is determined by <span 
class="cmtt-10">a </span>and <span 
class="cmtt-10">b </span>and the focusing is described in
Section&#x00A0;<a 
href="#x1-320007.1.5">7.1.5<!--tex4ht:ref: sec:focus --></a>.
</p><!--l. 1695--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-19">
&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dreamrect_f(Ro,geom_par,s_par,delay,m_par,foc_met,focal,err_level);
</div>
<!--l. 1698--><p class="nopar" >
</p><!--l. 1700--><p class="noindent" ><span 
class="cmbx-10">Geometrical parameters</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-20">
&#x00A0;geom_par&#x00A0;=&#x00A0;[a&#x00A0;b];
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;a&#x00A0;[mm]&#x00A0;-&#x00A0;x-size.
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;b&#x00A0;[mm]&#x00A0;-&#x00A0;y-size.
</div>
<!--l. 1705--><p class="nopar" >
</p><!--l. 1708--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.3.4   </span> <a 
 id="x1-410007.3.4"></a>Circular Transducer</h5>
<!--l. 1710--><p class="noindent" >The size of the circular transducer is determined by the single parameter <span 
class="cmtt-10">r</span>.
</p><!--l. 1712--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-21">
&#x00A0;&#x00A0;h&#x00A0;&#x00A0;=&#x00A0;dreamcirc(Ro,geom_par,s_par,delay,m_par,err_level);
</div>
<!--l. 1715--><p class="nopar" >
</p><!--l. 1717--><p class="noindent" ><span 
class="cmbx-10">Geometrical parameters</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-22">
&#x00A0;&#x00A0;geom_par&#x00A0;=&#x00A0;[r];
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;r&#x00A0;&#x00A0;-&#x00A0;Radius&#x00A0;of&#x00A0;the&#x00A0;transducer.
</div>
<!--l. 1721--><p class="nopar" >
</p><!--l. 1723--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.3.5   </span> <a 
 id="x1-420007.3.5"></a>Focused Circular Transducer</h5>
<!--l. 1725--><p class="noindent" >The size of the focused circular transducer is determined by the parameter <span 
class="cmtt-10">r </span>and the focusing is described in
Section&#x00A0;<a 
href="#x1-320007.1.5">7.1.5<!--tex4ht:ref: sec:focus --></a>.
</p><!--l. 1728--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-23">
&#x00A0;&#x00A0;h&#x00A0;&#x00A0;=&#x00A0;dreamcirc_f(Ro,geom_par,s_par,delay,m_par,foc_met,focal,err_level);
</div>
<!--l. 1731--><p class="nopar" >
</p><!--l. 1733--><p class="noindent" ><span 
class="cmbx-10">Geometrical parameters</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-24">
&#x00A0;&#x00A0;geom_par&#x00A0;=&#x00A0;[r];
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;r&#x00A0;&#x00A0;-&#x00A0;Radius&#x00A0;of&#x00A0;the&#x00A0;transducer.
</div>
<!--l. 1737--><p class="nopar" >
</p><!--l. 1739--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.3.6   </span> <a 
 id="x1-430007.3.6"></a>Spherical Concave Transducer</h5>
<!--l. 1742--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-25">
&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dreamsphere_f(Ro,geom_par,s_par,delay,m_par,err_level);
</div>
<!--l. 1745--><p class="nopar" >
</p><!--l. 1747--><p class="noindent" ><span 
class="cmbx-10">Geometrical parameters</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-26">
&#x00A0;geom_par&#x00A0;=&#x00A0;[r&#x00A0;R];
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;r&#x00A0;[mm]&#x00A0;-&#x00A0;Radius&#x00A0;of&#x00A0;the&#x00A0;transducer.
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;R&#x00A0;[mm]&#x00A0;-&#x00A0;Curvature&#x00A0;radius&#x00A0;of&#x00A0;the&#x00A0;transducer.
</div>
<!--l. 1752--><p class="nopar" >
</p><!--l. 1755--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.3.7   </span> <a 
 id="x1-440007.3.7"></a>Spherical Convex Transducer</h5>
<!--l. 1758--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-27">
&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dreamsphere_d(Ro,geom_par,s_par,delay,m_par)
</div>
<!--l. 1761--><p class="nopar" >
</p><!--l. 1763--><p class="noindent" ><span 
class="cmbx-10">Geometrical parameters</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-28">
&#x00A0;geom_par&#x00A0;=&#x00A0;[r&#x00A0;R];
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;r&#x00A0;[mm]&#x00A0;-&#x00A0;Radius&#x00A0;of&#x00A0;the&#x00A0;transducer.
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;R&#x00A0;[mm]&#x00A0;-&#x00A0;Curvature&#x00A0;radius&#x00A0;of&#x00A0;the&#x00A0;transducer.
</div>
<!--l. 1768--><p class="nopar" >
</p><!--l. 1770--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.3.8   </span> <a 
 id="x1-450007.3.8"></a>Cylindrical Concave Transducer</h5>
<!--l. 1773--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-29">
&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dreamcylind_f(Ro,geom_par,s_par,delay,m_par,err_level);
</div>
<!--l. 1776--><p class="nopar" >
</p><!--l. 1778--><p class="noindent" ><span 
class="cmbx-10">Geometrical parameters</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-30">
&#x00A0;geom_par&#x00A0;=&#x00A0;[a&#x00A0;b&#x00A0;R];
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;a&#x00A0;-&#x00A0;x-size&#x00A0;of&#x00A0;the&#x00A0;transducer.
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;b&#x00A0;-&#x00A0;y-size&#x00A0;of&#x00A0;the&#x00A0;transducer.
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;R&#x00A0;-&#x00A0;Radius&#x00A0;of&#x00A0;the&#x00A0;curvature.
</div>
<!--l. 1784--><p class="nopar" >
</p><!--l. 1787--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.3.9   </span> <a 
 id="x1-460007.3.9"></a>Cylindrical Convex Transducer</h5>
<!--l. 1790--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-31">
&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dreamcylind_d(Ro,geom_par,s_par,delay,m_par)
</div>
<!--l. 1793--><p class="nopar" >
</p><!--l. 1795--><p class="noindent" ><span 
class="cmbx-10">Geometrical parameters</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-32">
&#x00A0;geom_par&#x00A0;=&#x00A0;[a&#x00A0;b&#x00A0;R];
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;a&#x00A0;-&#x00A0;x-size&#x00A0;of&#x00A0;the&#x00A0;transducer.
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;b&#x00A0;-&#x00A0;y-size&#x00A0;of&#x00A0;the&#x00A0;transducer.
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;R&#x00A0;-&#x00A0;Radius&#x00A0;of&#x00A0;the&#x00A0;curvature.
</div>
<!--l. 1801--><p class="nopar" >
</p><!--l. 1805--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">7.4   </span> <a 
 id="x1-470007.4"></a>Input Parameters Common to the Array Functions</h4>
<!--l. 1808--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.4.1   </span> <a 
 id="x1-480007.4.1"></a>The Array Grid Matrix</h5>
<!--l. 1810--><p class="noindent" >The positions of the array transducer elements are determined by the
<!--l. 1810--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>L</mi> <mo 
class="MathClass-bin">&#x00D7;</mo> <mn>3</mn></math> <span 
class="cmti-10">grid matrix </span><span 
class="cmtt-10">G</span>. The first column
contain the (center) <!--l. 1811--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>x</mi></math>-positions of the
elements, the second the <!--l. 1811--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>y</mi></math>-positions,
and the third the <!--l. 1812--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>z</mi></math>-positions
(<!--l. 1812--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>L</mi></math> is the
number of elements), respectively. This approach is very flexible and allows for arbitrary array geometries that
not is restricted to equally spaced linear or 2D arrays.
</p><!--l. 1816--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.4.2   </span> <a 
 id="x1-490007.4.2"></a>Array Focusing</h5>
<!--l. 1820--><p class="noindent" >The array focusing has an extra option, <span 
class="cmtt-10">&#x2019;ud&#x2019;</span>, compared to the focusing methods described in Section&#x00A0;<a 
href="#x1-320007.1.5">7.1.5<!--tex4ht:ref: sec:focus --></a>:
     </p><dl class="description"><dt class="description">
<span 
class="cmtt-10">&#x2019;off</span> </dt><dd 
class="description">: focusing not used,
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;x&#x2019;</span> </dt><dd 
class="description">: see Section&#x00A0;<a 
href="#x1-320007.1.5">7.1.5<!--tex4ht:ref: sec:focus --></a>,
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;y&#x2019;</span> </dt><dd 
class="description">: see Section&#x00A0;<a 
href="#x1-320007.1.5">7.1.5<!--tex4ht:ref: sec:focus --></a>,
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;xy&#x2019;</span> </dt><dd 
class="description">: see Section&#x00A0;<a 
href="#x1-320007.1.5">7.1.5<!--tex4ht:ref: sec:focus --></a>,
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;x+y&#x2019;</span> </dt><dd 
class="description">: see Section&#x00A0;<a 
href="#x1-320007.1.5">7.1.5<!--tex4ht:ref: sec:focus --></a>.
                                                                                       
                                                                                       
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;ud&#x2019;</span> </dt><dd 
class="description">: user defined focusing.</dd></dl>
<!--l. 1831--><p class="noindent" >When user defined focusing is used the <span 
class="cmtt-10">&#x2019;focal&#x2019; </span>parameter is a vector of focusing delays (in
<!--l. 1831--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>&#x03BC;</mi></math>s). Each
element in <span 
class="cmtt-10">&#x2019;focal&#x2019; </span>then delays the signal to the corresponding element in the array (given by the grid
matrix).
</p><!--l. 1836--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.4.3   </span> <a 
 id="x1-500007.4.3"></a>Beam Steering Parameters</h5>
<!--l. 1838--><p class="noindent" >The beam steering in the DREAM toolbox is controlled by the two parameters <span 
class="cmtt-10">steer</span><span 
class="cmtt-10">_met </span>and <span 
class="cmtt-10">steer</span><span 
class="cmtt-10">_par</span>. The
<span 
class="cmtt-10">steer</span><span 
class="cmtt-10">_met </span>is a text string with four alternatives: <span 
class="cmtt-10">&#x2019;off&#x2019;</span>, <span 
class="cmtt-10">&#x2019;x&#x2019;</span>, <span 
class="cmtt-10">&#x2019;y&#x2019;</span>, and <span 
class="cmtt-10">&#x2019;xy&#x2019;</span>. The <span 
class="cmtt-10">steer</span><span 
class="cmtt-10">_par </span>is a two-element
vector <span 
class="cmtt-10">steer</span><span 
class="cmtt-10">_par = [theta phi] </span>where <span 
class="cmtt-10">theta </span>[deg] is the x-direction steer angle and <span 
class="cmtt-10">phi </span>[deg] the y-direction
steer angle.
</p><!--l. 1844--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.4.4   </span> <a 
 id="x1-510007.4.4"></a>Apodization Parameters</h5>
<!--l. 1847--><p class="noindent" >The DREAM toolbox has five pre-defined apodization windows that can be used for the array functions:
</p>
<!--tex4ht:inline--><!--l. 1868--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" >
<mtable 
class="eqnarray" columnalign="right center left" >
<mtr><mtd 
class="eqnarray-1"> <msub><mrow 
><mi 
>w</mi></mrow><mrow 
><mi 
>t</mi><mi 
>r</mi><mi 
>i</mi><mi 
>a</mi><mi 
>n</mi><mi 
>g</mi><mi 
>l</mi><mi 
>e</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>r</mi><mo 
class="MathClass-close">)</mo></mtd><mtd 
class="eqnarray-2">   <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="eqnarray-3">   <mn>1</mn> <mo 
class="MathClass-bin">&#x2212;</mo> <mfrac><mrow 
><mo 
class="MathClass-rel">|</mo><mi 
>r</mi><mo 
class="MathClass-rel">|</mo></mrow> 
<mrow 
><msub><mrow 
><mi 
>r</mi></mrow><mrow 
><mi 
>m</mi><mi 
>a</mi><mi 
>x</mi></mrow></msub 
></mrow></mfrac>       </mtd><mtd 
class="eqnarray-4"> <mtext class="eqnarray">(10)</mtext><mtext 
   id="x1-51001r10"  class="label" ></mtext><mtext 
class="endlabel"></mtext></mtd>
</mtr><mtr><mtd 
class="eqnarray-1"> <msub><mrow 
><mi 
>w</mi></mrow><mrow 
><mi 
>g</mi><mi 
>a</mi><mi 
>u</mi><mi 
>s</mi><mi 
>s</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>r</mi><mo 
class="MathClass-punc">;</mo><mi 
>p</mi><mo 
class="MathClass-close">)</mo></mtd><mtd 
class="eqnarray-2">   <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="eqnarray-3">   <mo class="qopname">exp</mo><!--nolimits--><mo 
class="MathClass-open">(</mo><mo 
class="MathClass-bin">&#x2212;</mo><mi 
>p</mi><msup><mrow 
><mi 
>r</mi></mrow><mrow 
><mn>2</mn></mrow></msup 
><mo 
class="MathClass-close">)</mo><mo 
class="MathClass-bin">&#x2215;</mo><msubsup><mrow 
><mi 
>r</mi></mrow><mrow 
>
<mi 
>m</mi><mi 
>a</mi><mi 
>x</mi></mrow><mrow 
><mn>2</mn></mrow></msubsup 
></mtd><mtd 
class="eqnarray-4"> <mtext class="eqnarray">(11)</mtext><mtext 
   id="x1-51001r11"  class="label" ></mtext><mtext 
class="endlabel"></mtext></mtd>
</mtr><mtr><mtd 
class="eqnarray-1"> <msub><mrow 
><mi 
>w</mi></mrow><mrow 
><mi 
>r</mi><mi 
>a</mi><mi 
>i</mi><mi 
>s</mi><mi 
>e</mi><mi 
>d</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>r</mi><mo 
class="MathClass-punc">;</mo><mi 
>p</mi><mo 
class="MathClass-close">)</mo></mtd><mtd 
class="eqnarray-2">   <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="eqnarray-3">   <mi 
>p</mi> <mo 
class="MathClass-bin">+</mo><mo class="qopname"> cos</mo><!--nolimits--><mo 
class="MathClass-open">(</mo><mi 
>r</mi><mi 
>&#x03C0;</mi><mo 
class="MathClass-bin">&#x2215;</mo><msub><mrow 
><mi 
>r</mi></mrow><mrow 
><mi 
>m</mi><mi 
>a</mi><mi 
>x</mi></mrow></msub 
><mo 
class="MathClass-close">)</mo></mtd><mtd 
class="eqnarray-4"> <mtext class="eqnarray">(12)</mtext><mtext 
   id="x1-51001r12"  class="label" ></mtext><mtext 
class="endlabel"></mtext></mtd>
</mtr><mtr><mtd 
class="eqnarray-1">  <msub><mrow 
><mi 
>w</mi></mrow><mrow 
><mi 
>s</mi><mi 
>i</mi><mi 
>m</mi><mi 
>p</mi><mi 
>l</mi><mi 
>y</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>r</mi><mo 
class="MathClass-close">)</mo></mtd><mtd 
class="eqnarray-2">   <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="eqnarray-3">   <mn>1</mn> <mo 
class="MathClass-bin">&#x2212;</mo> <msup><mrow 
><mi 
>r</mi></mrow><mrow 
><mn>2</mn></mrow></msup 
><mo 
class="MathClass-bin">&#x2215;</mo><msubsup><mrow 
><mi 
>r</mi></mrow><mrow 
>
<mi 
>m</mi><mi 
>a</mi><mi 
>x</mi></mrow><mrow 
><mn>2</mn></mrow></msubsup 
>    </mtd><mtd 
class="eqnarray-4"> <mtext class="eqnarray">(13)</mtext><mtext 
   id="x1-51001r13"  class="label" ></mtext><mtext 
class="endlabel"></mtext></mtd>
</mtr><mtr><mtd 
class="eqnarray-1"> <msub><mrow 
><mi 
>w</mi></mrow><mrow 
><mi 
>c</mi><mi 
>l</mi><mi 
>a</mi><mi 
>m</mi><mi 
>p</mi><mi 
>e</mi><mi 
>d</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>r</mi><mo 
class="MathClass-close">)</mo></mtd><mtd 
class="eqnarray-2">   <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="eqnarray-3">   <msup><mrow 
><mo 
class="MathClass-open">(</mo><mn>1</mn> <mo 
class="MathClass-bin">&#x2212;</mo> <msup><mrow 
><mi 
>r</mi></mrow><mrow 
><mn>2</mn></mrow></msup 
><mo 
class="MathClass-bin">&#x2215;</mo><msubsup><mrow 
><mi 
>r</mi></mrow><mrow 
>
<mi 
>m</mi><mi 
>a</mi><mi 
>x</mi></mrow><mrow 
><mn>2</mn></mrow></msubsup 
><mo 
class="MathClass-close">)</mo></mrow><mrow 
><mn>2</mn></mrow></msup 
><mo 
class="MathClass-punc">.</mo> </mtd><mtd 
class="eqnarray-4"> <mtext class="eqnarray">(14)</mtext><mtext 
   id="x1-51001r14"  class="label" ></mtext><mtext 
class="endlabel"></mtext></mtd>                                                      </mtr></mtable>
</math>
<!--l. 1868--><p class="nopar" >
</p>
                                                                                       
                                                                                       
<!--l. 1871--><p class="indent" >   Additionally to the pre-defined apodizations one can have a user defined apodization weights. Figure&#x00A0;<a 
href="#x1-510077">7<!--tex4ht:ref: fig:apod_windows --></a> show
some examples of these function. </p><hr class="figure" /><div class="figure" 
>
                                                                                       
                                                                                       
<a 
 id="x1-510077"></a>
                                                                                       
                                                                                       
<div class="center" 
>
<!--l. 1875--><p class="noindent" >
</p><!--l. 1878--><p class="noindent" ><a 
 id="x1-51002r1"></a></p><div class="subfigure"><table><tr><td style="text-align:left"><img 
src="userman9x.png" alt="PIC" class="graphics" width="488.82626pt" height="408.52625pt"  /><!--tex4ht:graphics  
name="userman9x.png" src="eps/triangle.eps"  
-->
          <div class="subfigcaption"><span 
class="cmr-8">(a) Triangle</span></div>          </td></tr></table></div>    <a 
 id="x1-51003r2"></a><div class="subfigure"><table><tr><td style="text-align:left"><img 
src="userman10x.png" alt="PIC" class="graphics" width="488.82626pt" height="408.52625pt"  /><!--tex4ht:graphics  
name="userman10x.png" src="eps/gauss.eps"  
-->
                <div class="subfigcaption"><span 
class="cmr-8">(b) Gaussian</span></div>                   </td></tr></table></div>    <a 
 id="x1-51004r3"></a><div class="subfigure"><table><tr><td style="text-align:left"><img 
src="userman11x.png" alt="PIC" class="graphics" width="497.86pt" height="408.52625pt"  /><!--tex4ht:graphics  
name="userman11x.png" src="eps/raised.eps"  
-->
              <div class="subfigcaption"><span 
class="cmr-8">(c) Raised cosine</span></div>                </td></tr></table></div><br />
<a 
 id="x1-51005r4"></a><div class="subfigure"><table><tr><td style="text-align:left"><img 
src="userman12x.png" alt="PIC" class="graphics" width="488.82626pt" height="408.52625pt"  /><!--tex4ht:graphics  
name="userman12x.png" src="eps/simply.eps"  
-->
       <div class="subfigcaption"><span 
class="cmr-8">(d) Simply supported</span></div>       </td></tr></table></div>    <a 
 id="x1-51006r5"></a><div class="subfigure"><table><tr><td style="text-align:left"><img 
src="userman13x.png" alt="PIC" class="graphics" width="488.82626pt" height="408.52625pt"  /><!--tex4ht:graphics  
name="userman13x.png" src="eps/simply.eps"  
-->
                <div class="subfigcaption"><span 
class="cmr-8">(e) Clamped</span></div>                   </td></tr></table></div></div>
<br /> <div class="caption" 
><span class="id">Figure&#x00A0;7: </span><span  
class="content">The pre-defined apodization window functions in the DREAM toolbox. </span></div><!--tex4ht:label?: x1-510077 -->
                                                                                       
                                                                                       
   </div><hr class="endfigure" />
<!--l. 1887--><p class="indent" >   There are three parameters that controls the apodization in the DREAM toolbox, <span 
class="cmtt-10">apod</span><span 
class="cmtt-10">_met</span>, <span 
class="cmtt-10">apod</span>, and
<span 
class="cmtt-10">win</span><span 
class="cmtt-10">_par</span>. The <span 
class="cmtt-10">apod</span><span 
class="cmtt-10">_met </span>parameter is string variable for selecting apodization method, options
are:
     </p><dl class="description"><dt class="description">
<span 
class="cmtt-10">&#x2019;off&#x2019;</span> </dt><dd 
class="description">- No apodization
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;ud&#x2019;</span> </dt><dd 
class="description">- User defined apodization
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;triangle&#x2019;</span> </dt><dd 
class="description">- Triangular window
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;gauss&#x2019;</span> </dt><dd 
class="description">- Gaussian (bell-shaped) window
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;raised&#x2019;</span> </dt><dd 
class="description">- Raised cosine window
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;simply&#x2019;</span> </dt><dd 
class="description">- Simply supported
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;clamped&#x2019;</span> </dt><dd 
class="description">- Clamped.</dd></dl>
<!--l. 1902--><p class="noindent" >The second parameter, <span 
class="cmtt-10">apod</span>, is a vector of apodization weights that is used for the <span 
class="cmtt-10">&#x2019;ud&#x2019; </span>option. Pass an empty
matrix (<span 
class="cmtt-10">[]</span>) if one of the other options are used. The last parameter, <span 
class="cmtt-10">win</span><span 
class="cmtt-10">_par </span>(scalar), is used for raised cosine
and Gaussian apodization functions. See also Section&#x00A0;<a 
href="#x1-6100010.1">10.1<!--tex4ht:ref: sec:misc-apod --></a>.
</p>
   <h4 class="subsectionHead"><span class="titlemark">7.5   </span> <a 
 id="x1-520007.5"></a>Array Transducers</h4>
<!--l. 1911--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.5.1   </span> <a 
 id="x1-530007.5.1"></a>Array with Rectangular Elements</h5>
<!--l. 1913--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-33">
&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dream_arr_rect(Ro,geom_par,G,s_par,delay,m_par,foc_met,
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;focal,steer_met,steer_par,apod_met,apod,win_par,err_level);
</div>
<!--l. 1917--><p class="nopar" >
</p><!--l. 1919--><p class="noindent" ><span 
class="cmbx-10">Geometrical parameters</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-34">
&#x00A0;&#x00A0;geom_par&#x00A0;=&#x00A0;[a&#x00A0;b]:
&#x00A0;<br />&#x00A0;&#x00A0;a&#x00A0;&#x00A0;-&#x00A0;Element&#x00A0;size&#x00A0;in&#x00A0;x-direction.
&#x00A0;<br />&#x00A0;&#x00A0;b&#x00A0;&#x00A0;-&#x00A0;Element&#x00A0;size&#x00A0;in&#x00A0;y-direction.
</div>
<!--l. 1924--><p class="nopar" >
</p><!--l. 1927--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.5.2   </span> <a 
 id="x1-540007.5.2"></a>Array with Circular Elements</h5>
<!--l. 1929--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-35">
&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dream_arr_circ(Ro,a,G,s_par,delay,m_par,foc_met,
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;focal,steer_met,steer_par,apod_met,apod,win_par,err_level);
</div>
<!--l. 1933--><p class="nopar" >
</p><!--l. 1935--><p class="indent" >   Geometrical parameters: <span 
class="cmtt-10">r </span>- Radius of the transducer elements.
</p><!--l. 1939--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.5.3   </span> <a 
 id="x1-550007.5.3"></a>Array with Cylindrical Concave Elements</h5>
<!--l. 1941--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-36">
&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dream_arr_cylind_f(Ro,geom_par,G,s_par,delay,m_par,foc_met,
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;focal,steer_met,steer_par,apod_met,apod,win_par,err_level);
</div>
<!--l. 1945--><p class="nopar" >
</p><!--l. 1947--><p class="noindent" ><span 
class="cmbx-10">Geometrical parameters</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-37">
&#x00A0;geom_par&#x00A0;=&#x00A0;[a&#x00A0;b&#x00A0;r]:
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;a&#x00A0;&#x00A0;-&#x00A0;Element&#x00A0;size&#x00A0;in&#x00A0;x-direction.
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;b&#x00A0;&#x00A0;-&#x00A0;Element&#x00A0;size&#x00A0;in&#x00A0;y-direction.
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;r&#x00A0;&#x00A0;-&#x00A0;Radius&#x00A0;(y-direction).
</div>
<!--l. 1953--><p class="nopar" >
</p><!--l. 1955--><p class="noindent" ><span 
class="cmbx-10">Example (linear array)</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-38">
&#x00A0;&#x00A0;gx&#x00A0;=&#x00A0;-10:1:10;
&#x00A0;<br />&#x00A0;&#x00A0;gy&#x00A0;=&#x00A0;zeros(length(gx),1);
&#x00A0;<br />&#x00A0;&#x00A0;gz&#x00A0;=&#x00A0;zeros(length(gx),1);
&#x00A0;<br />&#x00A0;&#x00A0;gx=gx(:);&#x00A0;&#x00A0;gy=gy(:);&#x00A0;&#x00A0;gz=gz(:);
&#x00A0;<br />&#x00A0;&#x00A0;G&#x00A0;=&#x00A0;[gx&#x00A0;gy&#x00A0;gz];
&#x00A0;<br />
</div>
<!--l. 1963--><p class="nopar" >
</p><!--l. 1965--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.5.4   </span> <a 
 id="x1-560007.5.4"></a>Array with Cylindrical Convex Elements</h5>
<!--l. 1967--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-39">
&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dream_arr_cylind_d(Ro,geom_par,G,s_par,delay,m_par,foc_met,
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;focal,steer_met,steer_par,apod_met,apod,win_par,err_level);
</div>
<!--l. 1971--><p class="nopar" >
</p><!--l. 1973--><p class="noindent" ><span 
class="cmbx-10">Geometrical parameters</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-40">
&#x00A0;geom_par&#x00A0;=&#x00A0;[a&#x00A0;b&#x00A0;r]:
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;a&#x00A0;&#x00A0;-&#x00A0;Element&#x00A0;size&#x00A0;in&#x00A0;x-direction.
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;b&#x00A0;&#x00A0;-&#x00A0;Element&#x00A0;size&#x00A0;in&#x00A0;y-direction.
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;r&#x00A0;&#x00A0;-&#x00A0;Radius&#x00A0;(y-direction).
</div>
<!--l. 1979--><p class="nopar" >
</p><!--l. 1981--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">7.5.5   </span> <a 
 id="x1-570007.5.5"></a>Annular Array</h5>
<!--l. 1983--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-41">
&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dream_arr_annu(Ro,G,s_par,delay,m_par,foc_met,focal,apod_met,apod,
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;win_par,err_level);
</div>
<!--l. 1987--><p class="nopar" >
</p><!--l. 1989--><p class="noindent" ><span 
class="cmbx-10">Geometrical parameters</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-42">
&#x00A0;&#x00A0;G&#x00A0;&#x00A0;-&#x00A0;Vector&#x00A0;of&#x00A0;annulus&#x00A0;radies.
</div>
<!--l. 1992--><p class="nopar" > The first element in <span 
class="cmtt-10">G </span>is the radius of the center element; then <span 
class="cmtt-10">G </span>has two entries for each annulus (the inner and
outer radius). Hence, the length of <span 
class="cmtt-10">G </span>must be odd for the annular array.
</p><!--l. 1998--><p class="indent" >   The <span 
class="cmtt-10">apod</span><span 
class="cmtt-10">_met </span>parameter has the following entries for the annular array function:
     </p><dl class="description"><dt class="description">
<span 
class="cmtt-10">&#x2019;on&#x2019;</span> </dt><dd 
class="description">- Focusing on (xy), see Section&#x00A0;<a 
href="#x1-320007.1.5">7.1.5<!--tex4ht:ref: sec:focus --></a>,
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;off&#x2019;</span> </dt><dd 
class="description">- No focusing,
     </dd><dt class="description">
<span 
class="cmtt-10">&#x2019;ud&#x2019;</span> </dt><dd 
class="description">- User defined focusing.</dd></dl>
<!--l. 2006--><p class="noindent" >
</p>
   <h3 class="sectionHead"><span class="titlemark">8   </span> <a 
 id="x1-580008"></a>Parallel Processing Support</h3>
<!--l. 2009--><p class="noindent" >Since the SIR computation for two different observation points is independent one can easily divide the
observation points in sets and let a different process handle each set. On a multiprocessor machine, where each
process (or thread) can run on a separate CPU simultaneously, this will speed up the computations. In the
DREAM toolbox this is performed using (POSIX) threads; the SIRs for each set is computed in its
own thread.The DREAM functions with thread support has an extra parameter <span 
class="cmtt-10">n</span><span 
class="cmtt-10">_cpus </span>and a
&#x201C;<span 
class="cmtt-10">_p</span>&#x201D; in its function name. For example, to compute SIRs for a rectangular transducer on 2 CPUs
use:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-43">
&#x00A0;&#x00A0;&#x00A0;&#x00A0;n_cpus&#x00A0;=&#x00A0;2;
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;H&#x00A0;=&#x00A0;dreamrect_p(Ro,geom_par,s_par,delay,m_par,n_cpus,&#x2019;stop&#x2019;);
</div>
<!--l. 2020--><p class="nopar" > where <span 
class="cmtt-10">n</span><span 
class="cmtt-10">_cpus </span>is an integer <!--l. 2022--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mo 
class="MathClass-rel">&#x2265;</mo> <mn>1</mn></math>.
To see if the two threads are running using Linux, open new terminal window and use the command <span 
class="cmtt-10">top</span>. You
should see something like:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-44">
&#x00A0;&#x00A0;17:10:15&#x00A0;&#x00A0;up&#x00A0;62&#x00A0;days,&#x00A0;21:18,&#x00A0;&#x00A0;4&#x00A0;users,&#x00A0;&#x00A0;load&#x00A0;average:&#x00A0;0.77,&#x00A0;0.26,&#x00A0;0.16
&#x00A0;<br />&#x00A0;&#x00A0;80&#x00A0;processes:&#x00A0;77&#x00A0;sleeping,&#x00A0;3&#x00A0;running,&#x00A0;0&#x00A0;zombie,&#x00A0;0&#x00A0;stopped
&#x00A0;<br />&#x00A0;&#x00A0;CPU0&#x00A0;states:&#x00A0;100.0%&#x00A0;user&#x00A0;&#x00A0;&#x00A0;0.0%&#x00A0;system&#x00A0;&#x00A0;&#x00A0;&#x00A0;0.0%&#x00A0;nice&#x00A0;&#x00A0;&#x00A0;0.0%&#x00A0;iowait&#x00A0;&#x00A0;&#x00A0;0.0%&#x00A0;idle
&#x00A0;<br />&#x00A0;&#x00A0;CPU1&#x00A0;states:&#x00A0;100.0%&#x00A0;user&#x00A0;&#x00A0;&#x00A0;0.0%&#x00A0;system&#x00A0;&#x00A0;&#x00A0;&#x00A0;0.0%&#x00A0;nice&#x00A0;&#x00A0;&#x00A0;0.0%&#x00A0;iowait&#x00A0;&#x00A0;&#x00A0;0.0%&#x00A0;idle
&#x00A0;<br />&#x00A0;&#x00A0;Mem:&#x00A0;&#x00A0;6211732k&#x00A0;av,&#x00A0;5835092k&#x00A0;used,&#x00A0;&#x00A0;376640k&#x00A0;free,&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;0k&#x00A0;shrd,&#x00A0;&#x00A0;284960k&#x00A0;buff
&#x00A0;<br />&#x00A0;&#x00A0;1280556k&#x00A0;active,&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;4156076k&#x00A0;inactive
&#x00A0;<br />&#x00A0;&#x00A0;Swap:&#x00A0;4096496k&#x00A0;av,&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;420k&#x00A0;used,&#x00A0;4096076k&#x00A0;free&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;5000568k&#x00A0;cached
&#x00A0;<br />
&#x00A0;<br />&#x00A0;&#x00A0;PID&#x00A0;USER&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;PRI&#x00A0;&#x00A0;NI&#x00A0;&#x00A0;SIZE&#x00A0;&#x00A0;RSS&#x00A0;SHARE&#x00A0;STAT&#x00A0;LC&#x00A0;%CPU&#x00A0;%MEM&#x00A0;&#x00A0;&#x00A0;TIME&#x00A0;COMMAND
&#x00A0;<br />&#x00A0;&#x00A0;29403&#x00A0;fl&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;25&#x00A0;&#x00A0;&#x00A0;0&#x00A0;75916&#x00A0;&#x00A0;74M&#x00A0;11820&#x00A0;R&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;0&#x00A0;99.9&#x00A0;&#x00A0;1.2&#x00A0;&#x00A0;&#x00A0;0:11&#x00A0;matlab
&#x00A0;<br />&#x00A0;&#x00A0;29404&#x00A0;fl&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;25&#x00A0;&#x00A0;&#x00A0;0&#x00A0;75916&#x00A0;&#x00A0;74M&#x00A0;11820&#x00A0;R&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;1&#x00A0;99.9&#x00A0;&#x00A0;1.2&#x00A0;&#x00A0;&#x00A0;0:11&#x00A0;matlab
&#x00A0;<br />&#x00A0;&#x00A0;29395&#x00A0;fl&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;15&#x00A0;&#x00A0;&#x00A0;0&#x00A0;&#x00A0;1304&#x00A0;1304&#x00A0;&#x00A0;&#x00A0;968&#x00A0;R&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;2&#x00A0;&#x00A0;0.3&#x00A0;&#x00A0;0.0&#x00A0;&#x00A0;&#x00A0;0:00&#x00A0;top
&#x00A0;<br />&#x00A0;&#x00A0;1&#x00A0;root&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;15&#x00A0;&#x00A0;&#x00A0;0&#x00A0;&#x00A0;&#x00A0;472&#x00A0;&#x00A0;460&#x00A0;&#x00A0;&#x00A0;424&#x00A0;S&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;2&#x00A0;&#x00A0;0.0&#x00A0;&#x00A0;0.0&#x00A0;&#x00A0;&#x00A0;0:49&#x00A0;init
&#x00A0;<br />&#x00A0;&#x00A0;2&#x00A0;root&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;RT&#x00A0;&#x00A0;&#x00A0;0&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;0&#x00A0;&#x00A0;&#x00A0;&#x00A0;0&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;0&#x00A0;SW&#x00A0;&#x00A0;&#x00A0;&#x00A0;0&#x00A0;&#x00A0;0.0&#x00A0;&#x00A0;0.0&#x00A0;&#x00A0;&#x00A0;0:00&#x00A0;migration_CPU0
&#x00A0;<br />&#x00A0;&#x00A0;3&#x00A0;root&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;RT&#x00A0;&#x00A0;&#x00A0;0&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;0&#x00A0;&#x00A0;&#x00A0;&#x00A0;0&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;0&#x00A0;SW&#x00A0;&#x00A0;&#x00A0;&#x00A0;1&#x00A0;&#x00A0;0.0&#x00A0;&#x00A0;0.0&#x00A0;&#x00A0;&#x00A0;0:00&#x00A0;migration_CPU1
</div>
<!--l. 2042--><p class="nopar" > As one can see there are two <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span> </span>processes running on 99.9% instead on just one. Note that there is an
overhead when creating (and running) new threads. If the distributed computations are very short the
computations may not be faster for the parallel algorithm than the serial. On uni-processor computers the
thread enabled functions may be slower than the non-threaded functions due to this overhead (if the hardware
and software do not support hyper threading).
</p><!--l. 2060--><p class="indent" >   The functions currently available with parallel (thread) support is shown in Table&#x00A0;<a 
href="#x1-580012">2<!--tex4ht:ref: tab:parallel --></a>. </p><div class="table">
                                                                                       
                                                                                       
<!--l. 2061--><p class="indent" >   <a 
 id="x1-580012"></a></p><hr class="float" /><div class="float" 
>
                                                                                       
                                                                                       
<div class="tabular"> <table id="TBL-5" class="tabular" 
cellspacing="0" cellpadding="0" rules="groups" 
><colgroup id="TBL-5-1g"><col 
id="TBL-5-1" /></colgroup><colgroup id="TBL-5-2g"><col 
id="TBL-5-2" /></colgroup><colgroup id="TBL-5-3g"><col 
id="TBL-5-3" /></colgroup><colgroup id="TBL-5-4g"><col 
id="TBL-5-4" /></colgroup><colgroup id="TBL-5-5g"><col 
id="TBL-5-5" /></colgroup><tr 
class="hline"><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td></tr><tr 
class="hline"><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td></tr><tr  
 style="vertical-align:baseline;" id="TBL-5-1-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-1-1"  
class="td11"><span 
class="cmbx-10">Transducer type/operation       </span></td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-1-2"  
class="td11"><span 
class="cmbx-10">DREAM function    </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-1-3"  
class="td11"><span 
class="cmbx-10">Linux</span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-1-4"  
class="td11"><span 
class="cmbx-10">Mac</span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-1-5"  
class="td11">   <span 
class="cmbx-10">Windows    </span></td>
</tr><tr 
class="hline"><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td></tr><tr 
class="hline"><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td></tr><tr  
 style="vertical-align:baseline;" id="TBL-5-2-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-2-1"  
class="td11">Strip transducer                            </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-2-2"  
class="td11"><span 
class="cmtt-10">dreamline</span><span 
class="cmtt-10">_p         </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-2-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-2-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-2-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-3-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-3-1"  
class="td11">Rectangular transducer                   </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-3-2"  
class="td11"><span 
class="cmtt-10">dreamrect</span><span 
class="cmtt-10">_p         </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-3-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-3-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-3-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-4-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-4-1"  
class="td11">Focused rectangular transducer        </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-4-2"  
class="td11"><span 
class="cmtt-10">dreamrect</span><span 
class="cmtt-10">_f</span><span 
class="cmtt-10">_p       </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-4-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-4-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-4-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-5-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-5-1"  
class="td11">Circular transducer                        </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-5-2"  
class="td11"><span 
class="cmtt-10">dreamcirc</span><span 
class="cmtt-10">_p         </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-5-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-5-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-5-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-6-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-6-1"  
class="td11">Focused circular transducer             </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-6-2"  
class="td11"><span 
class="cmtt-10">dreamcirc</span><span 
class="cmtt-10">_f</span><span 
class="cmtt-10">_p       </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-6-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-6-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-6-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-7-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-7-1"  
class="td11">Spherical concave transducer            </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-7-2"  
class="td11"><span 
class="cmtt-10">dreamsphere</span><span 
class="cmtt-10">_f</span><span 
class="cmtt-10">_p     </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-7-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-7-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-7-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-8-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-8-1"  
class="td11">Spherical convex transducer             </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-8-2"  
class="td11"><span 
class="cmtt-10">dreamsphere</span><span 
class="cmtt-10">_d</span><span 
class="cmtt-10">_p     </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-8-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-8-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-8-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-9-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-9-1"  
class="td11">Cylindrical concave transducer         </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-9-2"  
class="td11"><span 
class="cmtt-10">dreamcylind</span><span 
class="cmtt-10">_f</span><span 
class="cmtt-10">_p     </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-9-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-9-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-9-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-10-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-10-1"  
class="td11">Cylindrical convex transducer          </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-10-2"  
class="td11"><span 
class="cmtt-10">dreamcylind</span><span 
class="cmtt-10">_d</span><span 
class="cmtt-10">_p     </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-10-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-10-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-10-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr 
class="hline"><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td></tr><tr  
 style="vertical-align:baseline;" id="TBL-5-11-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-11-1"  
class="td11">Array with rectangular elements       </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-11-2"  
class="td11"><span 
class="cmtt-10">dream</span><span 
class="cmtt-10">_arr</span><span 
class="cmtt-10">_rect</span><span 
class="cmtt-10">_p    </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-11-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-11-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-11-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-12-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-12-1"  
class="td11">Array with circular elements            </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-12-2"  
class="td11"><span 
class="cmtt-10">dream</span><span 
class="cmtt-10">_arr</span><span 
class="cmtt-10">_circ</span><span 
class="cmtt-10">_p    </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-12-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-12-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-12-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-13-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-13-1"  
class="td11">Array with cylindrical concave el.      </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-13-2"  
class="td11"><span 
class="cmtt-10">dream</span><span 
class="cmtt-10">_arr</span><span 
class="cmtt-10">_cylind</span><span 
class="cmtt-10">_f</span><span 
class="cmtt-10">_p</span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-13-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-13-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-13-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-14-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-14-1"  
class="td11">Array with cylindrical convex el.       </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-14-2"  
class="td11"><span 
class="cmtt-10">dream</span><span 
class="cmtt-10">_arr</span><span 
class="cmtt-10">_cylind</span><span 
class="cmtt-10">_d</span><span 
class="cmtt-10">_p</span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-14-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-14-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-14-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-15-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-15-1"  
class="td11">Annular array                               </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-15-2"  
class="td11"><span 
class="cmtt-10">dream</span><span 
class="cmtt-10">_arr</span><span 
class="cmtt-10">_annu</span><span 
class="cmtt-10">_p    </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-15-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-15-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-15-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr 
class="hline"><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td></tr><tr  
 style="vertical-align:baseline;" id="TBL-5-16-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-16-1"  
class="td11">Time-domain convolution                </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-16-2"  
class="td11"><span 
class="cmtt-10">conv</span><span 
class="cmtt-10">_p              </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-16-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-16-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-16-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-17-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-17-1"  
class="td11">Frequency-domain convolution         </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-17-2"  
class="td11"><span 
class="cmtt-10">fftconv</span><span 
class="cmtt-10">_p           </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-17-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-17-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-17-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-18-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-18-1"  
class="td11">Frequency-domain convolution         </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-18-2"  
class="td11"><span 
class="cmtt-10">sum</span><span 
class="cmtt-10">_fftconv</span><span 
class="cmtt-10">_p       </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-18-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-18-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-18-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-19-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-19-1"  
class="td11">Parallel copy of data                      </td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-19-2"  
class="td11"><span 
class="cmtt-10">copy</span><span 
class="cmtt-10">_p              </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-19-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-19-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-19-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr  
 style="vertical-align:baseline;" id="TBL-5-20-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-20-1"  
class="td11">Synthetic aperture focusing technique</td><td  style="text-align:left; white-space:nowrap;" id="TBL-5-20-2"  
class="td11"><span 
class="cmtt-10">saft</span><span 
class="cmtt-10">_p              </span></td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-20-3"  
class="td11"> Yes  </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-20-4"  
class="td11"> Yes </td><td  style="text-align:center; white-space:nowrap;" id="TBL-5-20-5"  
class="td11">Yes (see Sec.&#x00A0;<a 
href="#x1-80004.2">4.2<!--tex4ht:ref: sec:win-install --></a>)</td>
</tr><tr 
class="hline"><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td></tr><tr 
class="hline"><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td><td><hr /></td></tr><tr  
 style="vertical-align:baseline;" id="TBL-5-21-"><td  style="text-align:left; white-space:nowrap;" id="TBL-5-21-1"  
class="td11">                                </td></tr></table></div>
<br /> <div class="caption" 
><span class="id">Table&#x00A0;2: </span><span  
class="content">Functions in the DREAM Toolbox with parallel (thread) support. </span></div><!--tex4ht:label?: x1-580012 -->
                                                                                       
                                                                                       
   </div><hr class="endfloat" />
   </div>
   <h3 class="sectionHead"><span class="titlemark">9   </span> <a 
 id="x1-590009"></a>Analytic Transducer Functions</h3>
<!--l. 2101--><p class="noindent" >The DREAM Toolbox has two new time-continous analytic functions, and one sampled analytic
function, for circular and a rectangular transducers, respectively&#x00A0;[<a 
href="#XStepanishen1971a">4</a>, <a 
href="#XLockwood1973">6</a>]. The parameters for the
functions,
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-45">
[Y]&#x00A0;=&#x00A0;circ_sir(Ro,geom_par,delay,s_par,m_par);
&#x00A0;<br />
&#x00A0;<br />[Y]&#x00A0;=&#x00A0;rect_sir(Ro,geom_par,delay,s_par,m_par);
&#x00A0;<br />
&#x00A0;<br />[Y]&#x00A0;=&#x00A0;scirc_sir(Ro,geom_par,delay,s_par,m_par,n_int);
</div>
<!--l. 2111--><p class="nopar" > are similar to the other DR-based transducer functions, except for the sampled analytic circular function,
<span 
class="cmtt-10">scirc</span><span 
class="cmtt-10">_sir</span>, which has a parameter <span 
class="cmtt-10">n</span><span 
class="cmtt-10">_int </span>that determines the number of points to use in the (numerical)
temporal integration for each sampling interval [cf. Eq.&#x00A0;(<a 
href="#x1-22001r4">4<!--tex4ht:ref: eq:sampled_sir --></a>)].
</p><!--l. 2117--><p class="noindent" >
</p>
   <h3 class="sectionHead"><span class="titlemark">10   </span> <a 
 id="x1-6000010"></a>Misc Functions</h3>
<!--l. 2120--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">10.1   </span> <a 
 id="x1-6100010.1"></a>Apodization Windows</h4>
<!--l. 2123--><p class="noindent" >The DREAM toolbox includes function,
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-46">
&#x00A0;&#x00A0;&#x00A0;[w]&#x00A0;=&#x00A0;dream_apodwin(apod_met,a,win_par)
</div>
<!--l. 2127--><p class="nopar" > that can be used to compute apodization weights using the methods described is Section&#x00A0;<a 
href="#x1-510007.4.4">7.4.4<!--tex4ht:ref: sec:apod --></a>. The input
parameters are:
     </p><dl class="description"><dt class="description">
<span 
class="cmtt-10">apod</span><span 
class="cmtt-10">_met</span> </dt><dd 
class="description">- Text string for selecting apodization method. options are: <span 
class="cmtt-10">&#x2019;off&#x2019;</span>, <span 
class="cmtt-10">&#x2019;ud&#x2019;</span>, <span 
class="cmtt-10">&#x2019;triangle&#x2019;</span>, <span 
class="cmtt-10">&#x2019;gauss&#x2019;</span>,
     <span 
class="cmtt-10">&#x2019;raised&#x2019;</span>, <span 
class="cmtt-10">&#x2019;simply&#x2019;</span>, and <span 
class="cmtt-10">&#x2019;clamped&#x2019;</span>.
     </dd><dt class="description">
<span 
class="cmtt-10">a</span> </dt><dd 
class="description">- Is the number of points of the apodization window.
     </dd><dt class="description">
<span 
class="cmtt-10">win</span><span 
class="cmtt-10">_par</span> </dt><dd 
class="description">- Scalar parameter for raised cosine and Gaussian apodization functions.</dd></dl>
<!--l. 2143--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">10.2   </span> <a 
 id="x1-6200010.2"></a>Attenuation Response</h4>
<!--l. 2146--><p class="noindent" >The function,
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-47">
&#x00A0;&#x00A0;&#x00A0;[H]&#x00A0;=&#x00A0;dream_att(Ro,s_par,delay,m_par);
</div>
<!--l. 2149--><p class="nopar" > can be used to compute only the impulse response(s) that is due to attenuation. The input parameters for
<span 
class="cmtt-10">dream</span><span 
class="cmtt-10">_att </span>are:
     </p><dl class="description"><dt class="description">
<span 
class="cmtt-10">Ro</span> </dt><dd 
class="description">- See Section&#x00A0;<a 
href="#x1-280007.1.1">7.1.1<!--tex4ht:ref: sec:obsarg --></a>.
     </dd><dt class="description">
<span 
class="cmtt-10">s</span><span 
class="cmtt-10">_par = [dt,nt];</span> </dt><dd 
class="description">- See Section&#x00A0;<a 
href="#x1-290007.1.2">7.1.2<!--tex4ht:ref: sec:sarg --></a>.
     </dd><dt class="description">
<span 
class="cmtt-10">delay</span> </dt><dd 
class="description">- See Section&#x00A0;<a 
href="#x1-300007.1.3">7.1.3<!--tex4ht:ref: sec:delay --></a>.
     </dd><dt class="description">
<span 
class="cmtt-10">m</span><span 
class="cmtt-10">_par= [cp,alfa];</span> </dt><dd 
class="description">- See Section&#x00A0;<a 
href="#x1-310007.1.4">7.1.4<!--tex4ht:ref: sec:material --></a>.
     </dd></dl>
<!--l. 2166--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">10.3   </span> <a 
 id="x1-6300010.3"></a>One Dimensional Matrix Convolution Functions</h4>
<!--l. 2169--><p class="noindent" >The <span 
class="cmtt-10">conv</span><span 
class="cmtt-10">_p </span>and <span 
class="cmtt-10">fftconv</span><span 
class="cmtt-10">_p </span>functions computes the one dimensional convolution of the columns in a matrix <span 
class="cmtt-10">A</span>
and matrix (or vector) <span 
class="cmtt-10">B </span>using one or more threads. These functions are typically used to compute single-path or
double-path (pulse-echo) responses for a large number of observation points and thus avoiding a slow <span 
class="cmtt-10">for</span>-loop
using the <span 
class="cmtt-10">conv </span>function (that only takes vector arguments).
</p><!--l. 2177--><p class="noindent" ><span 
class="cmbx-10">Syntax</span>:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-48">
&#x00A0;&#x00A0;[Y]&#x00A0;=&#x00A0;conv_p(A,B,n_cpus)
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;conv_p(A,B,n_cpus,Y)
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;conv_p(A,B,n_cpus,Y,mode_string)
</div>
<!--l. 2182--><p class="nopar" > and
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-49">
&#x00A0;&#x00A0;[Y]&#x00A0;=&#x00A0;fftconv_p(A,B,n_cpus)
&#x00A0;<br />&#x00A0;&#x00A0;[Y,wisdom_string]&#x00A0;=&#x00A0;fftconv_p(A,B,n_cpus)
&#x00A0;<br />&#x00A0;&#x00A0;[Y]&#x00A0;=&#x00A0;fftconv_p(A,B,n_cpus,wisdom_string)
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;fftconv_p(A,B,n_cpus,Y,wisdom_string)
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;fftconv_p(A,B,n_cpus,Y,mode_string)
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;fftconv_p(A,B,n_cpus,Y,wisdom_string,mode_string)
</div>
<!--l. 2193--><p class="nopar" > where <span 
class="cmtt-10">A </span>is an <!--l. 2195--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>M</mi> <mo 
class="MathClass-bin">&#x00D7;</mo> <mi 
>N</mi></math>
matrix, <span 
class="cmtt-10">B </span>is a <!--l. 2195--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>K</mi> <mo 
class="MathClass-bin">&#x00D7;</mo> <mi 
>N</mi></math>
matrix or a <!--l. 2196--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>K</mi></math>-length
vector. If <!--l. 2196--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><!--mstyle 
class="text"--><mtext class="texttt" mathvariant="monospace" >&#x00A0;B</mtext><!--/mstyle--></math>
is a vector then each column in <span 
class="cmtt-10">A </span>is convolved with <span 
class="cmtt-10">B</span>. The parameter <span 
class="cmtt-10">n</span><span 
class="cmtt-10">_cpus </span>is
the number of threads to use, which must be greater or equal to 1, and <span 
class="cmtt-10">Y </span>is the
<!--l. 2199--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-open">(</mo><mi 
>M</mi> <mo 
class="MathClass-bin">+</mo> <mi 
>K</mi> <mo 
class="MathClass-bin">&#x2212;</mo> <mn>1</mn><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-bin">&#x00D7;</mo> <mi 
>N</mi></math> output
matrix.
</p><!--l. 2202--><p class="indent" >   The <span 
class="cmtt-10">fftconv</span><span 
class="cmtt-10">_p </span>performs the convolutions in the frequency domain using the FFTW library&#x00A0;[<a 
href="#Xfftw">7</a>] which is
significantly faster than the time-domain implementation <span 
class="cmtt-10">conv</span><span 
class="cmtt-10">_p </span>for long vectors. To use the <span 
class="cmtt-10">fftconv</span><span 
class="cmtt-10">_p </span>the
FFTW3 lib must be available. The windows version of <span 
class="cmtt-10">fftconv</span><span 
class="cmtt-10">_p </span>is linked to the FFTW lib which, as
previously described, can be found at <span 
class="cmtt-10">ftp://ftp.fftw.org/pub/fftw/fftw3win32mingw.zip</span>.
</p><!--l. 2210--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">10.3.1   </span> <a 
 id="x1-6400010.3.1"></a>Using Pre-computed FFTW Plans</h5>
<!--l. 2212--><p class="noindent" >To speed up computation of repeated <span 
class="cmtt-10">fftconv</span><span 
class="cmtt-10">_p </span>operations (of the same size) one can use pre-computed fftw
plans. First compute the plan for the corresponding vector length,
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-50">
&#x00A0;&#x00A0;[tmp,wisdom_string]&#x00A0;=&#x00A0;fftconv_p(A(:,1),B(:,1),n_cpus);
</div>
<!--l. 2217--><p class="nopar" > then use the plan in consecutive computations of the same size,
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-51">
&#x00A0;&#x00A0;for&#x00A0;n=1:N
&#x00A0;<br />
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;Compute&#x00A0;new&#x00A0;A&#x00A0;and&#x00A0;B&#x00A0;here.
&#x00A0;<br />
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;[Y]&#x00A0;=&#x00A0;fftconv_p(A,B,n_cpus,wisdom_string);
&#x00A0;<br />
&#x00A0;<br />&#x00A0;&#x00A0;end
</div>
<!--l. 2229--><p class="nopar" > The time-consuming call to fftw plan functions is then avoided at each call to <span 
class="cmtt-10">fftconv</span><span 
class="cmtt-10">_p </span>inside the
loop.
</p><!--l. 2233--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">10.3.2   </span> <a 
 id="x1-6500010.3.2"></a>Using the In-place Mode</h5>
<!--l. 2235--><p class="noindent" >If the involved matrices are large then memory allocation can be time consuming. To alleviate this problem both
<span 
class="cmtt-10">conv</span><span 
class="cmtt-10">_p</span>, <span 
class="cmtt-10">fftconv</span><span 
class="cmtt-10">_p </span>and <span 
class="cmtt-10">sum</span><span 
class="cmtt-10">_fftconv</span><span 
class="cmtt-10">_p </span>(see Section&#x00A0;<a 
href="#x1-6600010.3.3">10.3.3<!--tex4ht:ref: sec:sumfftconv_p --></a>) have an in-place mode that uses a
pre-allocated output matrix, hence memory allocation for the (large) output matrix <span 
class="cmtt-10">Y </span>is avoided. For the
<span 
class="cmtt-10">conv</span><span 
class="cmtt-10">_p </span>and <span 
class="cmtt-10">fftconv</span><span 
class="cmtt-10">_p </span>functions, the in-place operation has three modes, <span 
class="cmtt-10">&#x2019;=&#x2019;</span>, <span 
class="cmtt-10">&#x2019;+=&#x2019;</span>, and <span 
class="cmtt-10">&#x2019;-=&#x2019;</span>,
respectively.
</p><!--l. 2241--><p class="indent" >   The default <span 
class="cmtt-10">&#x2019;=&#x2019; </span>mode
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-52">
&#x00A0;<br />&#x00A0;&#x00A0;[Y]&#x00A0;=&#x00A0;fftconv_p(H,u,n_cpus);
&#x00A0;<br />
&#x00A0;<br />&#x00A0;&#x00A0;for&#x00A0;n=2:N
&#x00A0;<br />
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;%&#x00A0;Compute&#x00A0;new&#x00A0;H&#x00A0;and&#x00A0;u&#x00A0;here.
&#x00A0;<br />
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;fftconv_p(H,u,n_cpus,Y,&#x2019;+=&#x2019;);
&#x00A0;<br />
&#x00A0;<br />&#x00A0;&#x00A0;end
</div>
<!--l. 2254--><p class="nopar" >
</p><!--l. 2256--><p class="indent" >   Note the in-place mode have the side effect that, in the code
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-53">
&#x00A0;&#x00A0;&#x00A0;&#x00A0;X&#x00A0;=&#x00A0;Y;
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;fftconv_p(H,u,n_cpus,Y,&#x2019;+=&#x2019;);
</div>
<!--l. 2261--><p class="nopar" > both <span 
class="cmtt-10">X </span>and <span 
class="cmtt-10">Y </span>will be altered, since Malab/Octave do not make a copy of a matrix unless it is changed after <span 
class="cmtt-10">X =</span>
<span 
class="cmtt-10">Y </span>assignment.
</p><!--l. 2266--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">10.3.3   </span> <a 
 id="x1-6600010.3.3"></a>Computing Array Responses for Arbitrary Input Signals</h5>
<!--l. 2269--><p class="noindent" >The pressure response at an observation point <!--l. 2269--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></math>
can be computed by super-imposing the responses from the individual array elements. Assume that we have an array with
<!--l. 2270--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>K</mi></math> transmit elements.
The pressure response <!--l. 2271--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>p</mi><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math>
is then given by,  </p><table class="equation"><tr><td> <a 
 id="x1-66001r15"></a>
<!--l. 2293--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
                      <mi 
>p</mi><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-rel">=</mo><munderover accentunder="false" accent="false"><mrow  
><mo mathsize="big" 
> &#x2211;</mo>
  </mrow><mrow 
><mi 
>k</mi><mo 
class="MathClass-rel">=</mo><mn>0</mn></mrow><mrow 
><mi 
>K</mi><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></mrow></munderover 
><msubsup><mrow 
><mi 
>h</mi></mrow><mrow 
>
<mi 
>k</mi></mrow><mrow 
><mi 
>f</mi><mo 
class="MathClass-bin">&#x2212;</mo><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;sir</mtext><!--/mstyle--></mrow></msubsup 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-bin">&#x2217;</mo> <msubsup><mrow 
><mi 
>h</mi></mrow><mrow 
>
<mi 
>k</mi></mrow><mrow 
><mi 
>e</mi><mi 
>f</mi></mrow></msubsup 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-bin">&#x2217;</mo> <msub><mrow 
><mi 
>u</mi></mrow><mrow 
>
<mi 
>k</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo><mo 
class="MathClass-punc">,</mo>
</math></td><td class="eq-no">(15)</td></tr></table>
<!--l. 2293--><p class="indent" >   where <!--l. 2293--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msubsup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>k</mi></mrow><mrow 
><mi 
>f</mi><mo 
class="MathClass-bin">&#x2212;</mo><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;sir</mtext><!--/mstyle--></mrow></msubsup 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math> is the forward SIR
for the <!--l. 2293--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>k</mi></math>th transmit element,
<!--l. 2293--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msubsup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>k</mi></mrow><mrow 
><mi 
>e</mi><mi 
>f</mi></mrow></msubsup 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math> is the forward electro-acoustical
impulse response, and <!--l. 2293--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>u</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math>
is the <!--l. 2293--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>k</mi></math>th
input signal.  The DREAM Toolbox has a function, <span 
class="cmtt-10">sum</span><span 
class="cmtt-10">_fftconv</span><span 
class="cmtt-10">_p</span>, to facilitate computation of discrete array
responses with arbitrary input signals. Similar to the <span 
class="cmtt-10">fftconv</span><span 
class="cmtt-10">_p </span>function, the <span 
class="cmtt-10">sum</span><span 
class="cmtt-10">_fftconv</span><span 
class="cmtt-10">_p </span>function uses a
FFT based algorithm to compute the convolutions. The <span 
class="cmtt-10">sum</span><span 
class="cmtt-10">_fftconv</span><span 
class="cmtt-10">_p </span>function performs an operation similar
to the code:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-54">
&#x00A0;&#x00A0;YF&#x00A0;=&#x00A0;zeros(M+K-1,N);
&#x00A0;<br />&#x00A0;&#x00A0;for&#x00A0;l=1:L
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;for&#x00A0;n=1:N
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;YF(:,n)&#x00A0;=&#x00A0;YF(:,n)&#x00A0;+&#x00A0;fft(A(:,n,l),M+K-1).*&#x00A0;fft(B(:,l),M+K-1);
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;end
&#x00A0;<br />&#x00A0;&#x00A0;end
&#x00A0;<br />&#x00A0;&#x00A0;Y&#x00A0;=&#x00A0;real(ifft(Y));
</div>
<!--l. 2308--><p class="nopar" > where <span 
class="cmtt-10">A </span>is a 3D matrix.
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-55">
&#x00A0;&#x00A0;[Y]&#x00A0;=&#x00A0;sum_fftconv_p(A,B,n_cpus);
&#x00A0;<br />&#x00A0;&#x00A0;[Y]&#x00A0;=&#x00A0;sum_fftconv_p(A,B,n_cpus,wisdom_str);
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;sum_fftconv_p(A,B,n_cpus,Y);
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;sum_fftconv_p(A,B,n_cpus,Y,wisdom_str);
</div>
<!--l. 2317--><p class="nopar" > Input parameters: </p>
     <ul class="itemize1">
     <li class="itemize"><span 
class="cmtt-10">A </span>An <!--l. 2322--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>M</mi> <mo 
class="MathClass-bin">&#x00D7;</mo> <mi 
>N</mi> <mo 
class="MathClass-bin">&#x00D7;</mo> <mi 
>L</mi></math>
     three-dimensional matrix.
     </li>
     <li class="itemize"><span 
class="cmtt-10">B </span>A <!--l. 2324--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>K</mi> <mo 
class="MathClass-bin">&#x00D7;</mo> <mi 
>L</mi></math>
     matrix.
     </li>
     <li class="itemize"><span 
class="cmtt-10">n</span><span 
class="cmtt-10">_cpus </span>Number of threads to use where <span 
class="cmtt-10">n</span><span 
class="cmtt-10">_cpus </span>must be greater or equal to 1.
     </li>
     <li class="itemize"><span 
class="cmtt-10">wisdom</span><span 
class="cmtt-10">_str </span>Optional parameter (see Section&#x00A0;<a 
href="#x1-6300010.3">10.3<!--tex4ht:ref: sec:misc-conv --></a>).
     </li></ul>
<!--l. 2332--><p class="noindent" >and the output parameter, <span 
class="cmtt-10">Y </span>, is an <!--l. 2332--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-open">(</mo><mi 
>M</mi> <mo 
class="MathClass-bin">+</mo> <mi 
>K</mi> <mo 
class="MathClass-bin">&#x2212;</mo> <mn>1</mn><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-bin">&#x00D7;</mo> <mi 
>N</mi></math>
matrix. A typical usage is:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-56">
&#x00A0;<br />%&#x00A0;Compute&#x00A0;a&#x00A0;new&#x00A0;fftw&#x00A0;wisdom&#x00A0;string.
&#x00A0;<br />[tmp,wisdom_str]&#x00A0;&#x00A0;=&#x00A0;fftconv_p(A(:,1,1),B(:,1),n_cpus);
&#x00A0;<br />
&#x00A0;<br />for&#x00A0;i=1:N
&#x00A0;<br />
&#x00A0;<br />&#x00A0;&#x00A0;%&#x00A0;Do&#x00A0;some&#x00A0;stuff&#x00A0;here.
&#x00A0;<br />
&#x00A0;<br />&#x00A0;&#x00A0;Y&#x00A0;=&#x00A0;sum_fftconv_p&#x00A0;(A,B,n_cpus,wisdom_str);
&#x00A0;<br />end
</div>
<!--l. 2347--><p class="nopar" > where the overhead of calling fftw plan functions is now avoided inside the for loop.
</p><!--l. 2351--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">10.4   </span> <a 
 id="x1-6700010.4"></a>Parallel Matrix Copy</h4>
<!--l. 2353--><p class="noindent" >The impulse response matrices can often become rather large and the time taken to copy data between matrices
can therefore be considerable. The DREAM Toolbox comes with a threaded function <span 
class="cmtt-10">copy</span><span 
class="cmtt-10">_p </span>to speed up data
copy.
</p><!--l. 2357--><p class="indent" >   In-place, threaded copy of data into a matrix:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-57">
&#x00A0;&#x00A0;copy_p(B,row_idx,col_idx,A,n_cpus);
</div>
<!--l. 2360--><p class="nopar" >
</p><!--l. 2362--><p class="noindent" >Input parameters:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-58">
&#x00A0;B&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;-&#x00A0;Pre-allocated&#x00A0;Output&#x00A0;matrix&#x00A0;of&#x00A0;size&#x00A0;&#x003E;=&#x00A0;(r2-r1)x(c2-c1).
&#x00A0;<br />&#x00A0;row_idx&#x00A0;=&#x00A0;[r1&#x00A0;r2]&#x00A0;-&#x00A0;Two&#x00A0;element&#x00A0;vector&#x00A0;defining&#x00A0;rows&#x00A0;in&#x00A0;B&#x00A0;where
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;the&#x00A0;data&#x00A0;is&#x00A0;copied.
&#x00A0;<br />&#x00A0;col_idx&#x00A0;=&#x00A0;[c1&#x00A0;c2]&#x00A0;-&#x00A0;Two&#x00A0;element&#x00A0;vector&#x00A0;defining&#x00A0;columns&#x00A0;in&#x00A0;B&#x00A0;where
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;the&#x00A0;data&#x00A0;is&#x00A0;copied.
&#x00A0;<br />&#x00A0;B&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;-&#x00A0;Input&#x00A0;matrix&#x00A0;of&#x00A0;size&#x00A0;(r2-r1)x(c2-c1);
&#x00A0;<br />&#x00A0;n_cpus&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;-&#x00A0;Number&#x00A0;of&#x00A0;threads&#x00A0;to&#x00A0;use,&#x00A0;n_cpus&#x00A0;must&#x00A0;be&#x00A0;greater&#x00A0;or&#x00A0;equal&#x00A0;to&#x00A0;1.
</div>
<!--l. 2371--><p class="nopar" >
</p><!--l. 2373--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">10.5   </span> <a 
 id="x1-6800010.5"></a>The Speed of Sound in Water</h4>
<!--l. 2375--><p class="noindent" >The SIRs are a function of the sound speed in the propagation medium which often is water. The DREAM
toolbox comes with a function <span 
class="cmtt-10">h2o</span><span 
class="cmtt-10">_soundspeed</span>, based on a method by V.A. Del Grosso&#x00A0;[<a 
href="#XGrosso1974">8</a>], to facilitate
computation of the water sound speed (as function of temperature, pressure, and salinity).
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-59">
&#x00A0;&#x00A0;[cp]&#x00A0;=&#x00A0;h2o_soundspeed(T,P,unit,S)
</div>
<!--l. 2382--><p class="nopar" >
</p><!--l. 2384--><p class="noindent" >Input parameters:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-60">
&#x00A0;T&#x00A0;&#x00A0;&#x00A0;&#x00A0;-&#x00A0;Temperture&#x00A0;[in&#x00A0;degrees&#x00A0;Celsius].
&#x00A0;<br />&#x00A0;P&#x00A0;&#x00A0;&#x00A0;&#x00A0;-&#x00A0;Pressure&#x00A0;(optional).
&#x00A0;<br />&#x00A0;unit&#x00A0;-&#x00A0;Text&#x00A0;string&#x00A0;defining&#x00A0;the&#x00A0;pressure&#x00A0;unit&#x00A0;of&#x00A0;arg&#x00A0;2
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;[&#x2019;Pa&#x2019;,&#x2019;bar&#x2019;,&#x2019;at&#x2019;,&#x2019;atm&#x2019;,&#x2019;mmHg&#x2019;,&#x00A0;or,&#x00A0;&#x2019;psi&#x2019;]&#x00A0;&#x00A0;(optional).
&#x00A0;<br />&#x00A0;S&#x00A0;&#x00A0;&#x00A0;&#x00A0;-&#x00A0;Salinity&#x00A0;[in&#x00A0;parts&#x00A0;per&#x00A0;thousand]&#x00A0;(optional).
</div>
<!--l. 2391--><p class="nopar" >
</p><!--l. 2394--><p class="noindent" >
</p>
   <h3 class="sectionHead"><span class="titlemark">11   </span> <a 
 id="x1-6900011"></a>Signal Processing Examples</h3>
<!--l. 2400--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">11.1   </span> <a 
 id="x1-7000011.1"></a>Double-path Modeling</h4>
<!--l. 2402--><p class="noindent" >Double-path responses can be modeled as convolutions between the forward and backward responses&#x00A0;[<a 
href="#XStepanishen1981">9</a>]. This
operation can be time consuming when the number of observation points is large. The DREAM toolbox has the
threaded functions <span 
class="cmtt-10">conv</span><span 
class="cmtt-10">_p </span>and <span 
class="cmtt-10">fftconv</span><span 
class="cmtt-10">_p </span>that can be used to speed up this operation. A typical example
is:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-61">
H&#x00A0;=&#x00A0;fftconv_p(H_t,H_r,n_cpus);&#x00A0;%&#x00A0;Double-path.
&#x00A0;<br />
&#x00A0;<br />P&#x00A0;=&#x00A0;fftconv_p(H,h_e,n_cpus);&#x00A0;%&#x00A0;Electrical&#x00A0;impulse&#x00A0;response.
</div>
<!--l. 2413--><p class="nopar" > where we first compute the double-path SIRs and then add (convolve) the double-path electrical impulse
response to get the (double-path) propagation response matrix <span 
class="cmtt-10">P</span>.
</p><!--l. 2418--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">11.2   </span> <a 
 id="x1-7100011.2"></a>Synthetic Aperture Imaging &#x2014; The Synthetic Aperture Focusing Technique</h4>
<!--l. 2422--><p class="noindent" >Synthetic aperture imaging (SAI) was developed to improve resolution in the along track direction for
side-looking radar. The idea was to record data from a sequence of pulses from a single moving real aperture and
then, with suitable computation, combine the signals so the output can be treated as a much larger aperture.
The first synthetic aperture radar (SAR) systems appeared in the beginning of the 1950&#x2019;s&#x00A0;[<a 
href="#XWhiley1985">10</a>, <a 
href="#XSherwin1962">11</a>]. Later on the
method has carried over to ultrasound imaging in areas such as synthetic aperture sonar (SAS)&#x00A0;[<a 
href="#XGough1997">12</a>], medical
imaging, and nondestructive testing&#x00A0;[<a 
href="#XSeydel1982">13</a>, <a 
href="#XDoctor1986">14</a>], where the method is often called the synthetic aperture focusing
technique (SAFT).
</p><!--l. 2433--><p class="indent" >   The conventional time-domain SAFT algorithm performs synthetic focusing
by means of coherent summations, of responses from point scatterers, along
hyperbolas.<span class="footnote-mark"><a 
href="userman11.xml#fn10x0"><sup class="textsuperscript">10</sup></a></span><a 
 id="x1-71001f10"></a> 
These hyperbolas simply express the distances, or time-delays, from transducer positions in the synthetic
aperture to the observation points, see illustration in Figure&#x00A0;<a 
href="#x1-710028">8<!--tex4ht:ref: fig:saft --></a>. </p><hr class="figure" /><div class="figure" 
>
                                                                                       
                                                                                       
<a 
 id="x1-710028"></a>
                                                                                       
                                                                                       
<div class="center" 
>
<!--l. 2441--><p class="noindent" >
</p><!--l. 2442--><p class="noindent" ><img 
src="userman14x.png" alt="PIC" class="graphics" width="329.23pt" height="204.765pt"  /><!--tex4ht:graphics  
name="userman14x.png" src="eps/saft_geometry.eps"  
--></p></div>
<br /> <div class="caption" 
><span class="id">Figure&#x00A0;8: </span><span  
class="content">Typical measurement setup for a SAFT experiment. The transducer is mechanically scanned
along the <!--l. 2449--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>x</mi></math>-axis
and at each sampling position, <!--l. 2449--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>x</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
></math>,
<!--l. 2449--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>n</mi> <mo 
class="MathClass-rel">=</mo> <mn>0</mn><mo 
class="MathClass-punc">,</mo><mn>1</mn><mo 
class="MathClass-punc">,</mo><mo 
class="MathClass-op">&#x2026;</mo><mo 
class="MathClass-punc">,</mo><mi 
>L</mi> <mo 
class="MathClass-bin">&#x2212;</mo> <mn>1</mn></math>,
a data vector (A-scan) of length <!--l. 2449--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>K</mi></math>
is recorded. The distance between the transducer, at <!--l. 2449--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>x</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
><mo 
class="MathClass-punc">,</mo><mi 
>z</mi> <mo 
class="MathClass-rel">=</mo> <mn>0</mn><mo 
class="MathClass-close">)</mo></math>,
and the observation point, <!--l. 2449--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>x</mi></mrow><mrow 
><mi 
>&#x00F1;</mi></mrow></msub 
><mo 
class="MathClass-punc">,</mo><msub><mrow 
><mi 
>z</mi></mrow><mrow 
><mi 
>m</mi></mrow></msub 
><mo 
class="MathClass-close">)</mo></math>,
is given by <!--l. 2449--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>R</mi></math>.
</span></div><!--tex4ht:label?: x1-710028 -->
                                                                                       
                                                                                       
   </div><hr class="endfigure" />
<!--l. 2452--><p class="indent" >   More specifically, to achieve focus at an observation point
<!--l. 2452--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>x</mi></mrow><mrow 
><mi 
>&#x00F1;</mi></mrow></msub 
><mo 
class="MathClass-punc">,</mo><msub><mrow 
><mi 
>z</mi></mrow><mrow 
><mi 
>m</mi></mrow></msub 
><mo 
class="MathClass-close">)</mo></math>,
the SAFT algorithm time shifts and performs a summation of the received signals
<!--l. 2453--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>y</mi><mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>x</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math> measured at
transducer positions <!--l. 2454--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>x</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
></math>
for all <!--l. 2454--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>n</mi></math>
in the synthetic aperture. The time shifts which aim to compensate for differences in pulse traveling time, are
simply calculated using the Pythagorean theorem and the operation is commonly expressed in the continuous
time form&#x00A0;[<a 
href="#XFrazier1998">15</a>]  </p><table class="equation"><tr><td> <a 
 id="x1-71003r16"></a>
<!--l. 2473--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
                      <mi 
>o</mi><mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>x</mi></mrow><mrow 
><mi 
>&#x00F1;</mi></mrow></msub 
><mo 
class="MathClass-punc">,</mo><msub><mrow 
><mi 
>z</mi></mrow><mrow 
><mi 
>m</mi></mrow></msub 
><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-rel">=</mo><munder class="msub"><mrow 
><mo mathsize="big" 
> &#x2211;</mo>
   </mrow><mrow 
><mi 
>n</mi></mrow></munder 
><msub><mrow 
><mi 
>w</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
><mi 
>y</mi><mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>x</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
><mo 
class="MathClass-punc">,</mo> <mfrac><mrow 
><mn>2</mn></mrow> 
<mrow 
><mi 
>c</mi><mi 
>p</mi></mrow></mfrac><msqrt><mrow><msup><mrow 
><mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>x</mi></mrow><mrow 
><mi 
>&#x00F1;</mi> </mrow> </msub 
> <mo 
class="MathClass-bin">&#x2212;</mo> <msub><mrow 
><mi 
>x</mi></mrow><mrow 
><mi 
>n</mi> </mrow> </msub 
> <mo 
class="MathClass-close">)</mo></mrow><mrow 
><mn>2</mn> </mrow> </msup 
> <mo 
class="MathClass-bin">+</mo> <msubsup><mrow 
><mi 
>z</mi></mrow><mrow 
><mi 
>m</mi> </mrow> <mrow 
>  <mn>2</mn></mrow></msubsup 
></mrow></msqrt><mo 
class="MathClass-close">)</mo><mo 
class="MathClass-punc">.</mo>
</math></td><td class="eq-no">(16)</td></tr></table>
<!--l. 2475--><p class="indent" >   where <!--l. 2475--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>o</mi><mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>x</mi></mrow><mrow 
><mi 
>&#x00F1;</mi></mrow></msub 
><mo 
class="MathClass-punc">,</mo><msub><mrow 
><mi 
>z</mi></mrow><mrow 
><mi 
>m</mi></mrow></msub 
><mo 
class="MathClass-close">)</mo></math> is
the beamformed image.
</p><!--l. 2477--><p class="indent" >   The DREAM Toolbox has two functions <span 
class="cmtt-10">saft </span>and <span 
class="cmtt-10">saft</span><span 
class="cmtt-10">_p</span>, respectively, that performs the SAFT operation
(with linear interpolation):
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-62">
&#x00A0;&#x00A0;&#x00A0;Y&#x00A0;=&#x00A0;saft(B,To,delay,s_par,m_par,Ro,a);
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;Y&#x00A0;=&#x00A0;saft_p(B,To,delay,s_par,m_par,Ro,a,n_cpus);
</div>
<!--l. 2510--><p class="nopar" >
</p><!--l. 2512--><p class="noindent" >Input parameters:
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-63">
&#x00A0;B&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;-&#x00A0;KxL&#x00A0;Ultrasonic&#x00A0;B-scan&#x00A0;data&#x00A0;matrix.
&#x00A0;<br />&#x00A0;To&#x00A0;&#x00A0;&#x00A0;&#x00A0;-&#x00A0;A&#x00A0;matrix&#x00A0;of&#x00A0;the&#x00A0;form&#x00A0;&#x00A0;[xo1&#x00A0;yo1&#x00A0;zo2;&#x00A0;xo2&#x00A0;yo2&#x00A0;zo2;&#x00A0;...&#x00A0;xoL&#x00A0;yoL&#x00A0;zoL];
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;where&#x00A0;L&#x00A0;is&#x00A0;the&#x00A0;number&#x00A0;of&#x00A0;transducer&#x00A0;positions.
&#x00A0;<br />&#x00A0;delay&#x00A0;-&#x00A0;A&#x00A0;scalar&#x00A0;(or&#x00A0;vector)&#x00A0;of&#x00A0;starting&#x00A0;point(s)&#x00A0;of&#x00A0;the&#x00A0;A-scans&#x00A0;in&#x00A0;B.
&#x00A0;<br />
&#x00A0;<br />&#x00A0;n_cpus&#x00A0;-&#x00A0;Number&#x00A0;of&#x00A0;threads&#x00A0;to&#x00A0;use.&#x00A0;n_cpus&#x00A0;must&#x00A0;be&#x00A0;greater&#x00A0;or&#x00A0;equal&#x00A0;to&#x00A0;1.
</div>
<!--l. 2520--><p class="nopar" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">11.3   </span> <a 
 id="x1-7200011.3"></a>Delay-and-sum Imaging</h4>
<!--l. 2529--><p class="noindent" >The SAFT method described in Section&#x00A0;<a 
href="#x1-7100011.2">11.2<!--tex4ht:ref: sec:saft --></a> is a special case of methods based on so-called delay-and-sum
imaging (DAS). The simple idea is just to compensate for the double-path propagation delay from each
transmitter/receiver to each observation point and then perform a (coherent) summation. This operation is
essentially based on an geometrical optics approach and is analogous to the operation of an acoustical
lens&#x00A0;[<a 
href="#XKino1987">16</a>].
</p><!--l. 2535--><p class="indent" >   The DREAM Toolbox has two functions to facilitate (matrix based) delay-and-sum processing. The two DAS
functions <span 
class="cmtt-10">das </span>and <span 
class="cmtt-10">das</span><span 
class="cmtt-10">_arr </span>is similar to the transducer functions in the sense that they return a
matrix with responses corresponding to each observation point. The difference from the transducer
functions is that only the time delay is computed which is represented with a &#x201C;1&#x201D; at the corresponding
index.
</p><!--l. 2540--><p class="indent" >   The <span 
class="cmtt-10">das </span>function is for single transducers and the <span 
class="cmtt-10">das</span><span 
class="cmtt-10">_arr </span>function is for arrays. The input
parameters,
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-64">
[D,err]&#x00A0;=&#x00A0;das(Ro,s_par,delay,m_par,err_level)
&#x00A0;<br />
&#x00A0;<br />[D,err]&#x00A0;=&#x00A0;das_arr(Ro,G,s_par,delay,m_par,foc_met,...
&#x00A0;<br />&#x00A0;&#x00A0;&#x00A0;focal,steer_met,steer_par,apod_met,apod,win_par,err_level)
</div>
<!--l. 2548--><p class="nopar" > are similar to the ones used in the transducer functions previously described.
</p><!--l. 2552--><p class="noindent" >
</p>
   <h4 class="subsectionHead"><span class="titlemark">11.4   </span> <a 
 id="x1-7300011.4"></a>Model Based Ultrasonic Array Imaging</h4>
<!--l. 2554--><p class="noindent" >In this section a short introduction to model based ultrasonic imaging is presented. Model based ultrasonic array
imaging&#x00A0;[<a 
href="#XStoughton1993">17</a>&#x2013;<a 
href="#XLingvall2007">19</a>] is different from delay-and-sum imaging in the sense that is based on optimal information
processing whereas delay-and-sum imaging is based on geometrical focusing. The idea is to use a (linear) model,
taking into account the diffraction effects associated with each transmitter/receiver, the electrical
characteristics for each transmitter/receiver, as well as the used input signal(s), and then estimate
the parameters (the scattering strengths) of the model based on both data and prior information.
The DREAM toolbox can be used in this process for computing the SIRs for the model which
can then be convolved with measured electrical impulse responses to obtain a model for a real
measurement setup or using only simulated impulse responses to evaluate different array designs, for
example.
</p><!--l. 2566--><p class="indent" >   To obtain a linear mode we need to consider both the forward process and the backward process. As
discussed in Section&#x00A0;<a 
href="#x1-210005.1">5.1<!--tex4ht:ref: sec:analythical --></a> [Eq.&#x00A0;(<a 
href="#x1-21003r2">2<!--tex4ht:ref: eq:pressure_response --></a>)] the forward response can be divided in three parts: the input signal
<!--l. 2568--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>u</mi><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math>, the forward
electro-acoustical response  <!--l. 2575--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>e</mi><mi 
>f</mi></mrow></msup 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math>,
and the forward SIR  <!--l. 2582--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>f</mi><mo 
class="MathClass-bin">&#x2212;</mo><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;sir</mtext><!--/mstyle--></mrow></msup 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math>.
The backward response can similarly be divided in two parts: the backward acousto-electrical impulse response
<!--l. 2591--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>e</mi><mi 
>b</mi></mrow></msup 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math> and the backward
SIR <!--l. 2591--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>b</mi><mo 
class="MathClass-bin">&#x2212;</mo><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;sir</mtext><!--/mstyle--></mrow></msup 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math>.  Now, consider
an array with <!--l. 2592--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>K</mi></math>
transmit elements and <!--l. 2592--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>L</mi></math>
receive elements and contributions from a single observation point,
<!--l. 2593--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>r</mi></mstyle> <mo 
class="MathClass-rel">=</mo><msup><mrow 
>  <mfenced separators="" 
open="["  close="]" ><mrow><mtable  style="text-align:axis;"  
equalrows="false" columnlines="none none none none none none none none none" equalcolumns="false" class="array"><mtr><mtd 
class="array"  columnalign="center"><mi 
>x</mi></mtd><mtd 
class="array"  columnalign="center"><mi 
>y</mi></mtd><mtd 
class="array"  columnalign="center"><mi 
>z</mi></mtd></mtr> <!--*\c@MaxMatrixCols c--></mtable>                                                                                                              </mrow></mfenced></mrow><mrow 
><mi 
>T</mi></mrow></msup 
></math>, where
<!--l. 2593--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msup><mrow 
></mrow><mrow 
><mi 
>T</mi></mrow></msup 
></math> denotes the transpose
operator. The received signal, <!--l. 2594--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>y</mi></mrow><mrow 
><mi 
>l</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math>,
from the <!--l. 2594--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>l</mi></math>th
receive element can be expressed  </p><table class="equation"><tr><td> <a 
 id="x1-73001r17"></a>
                                                                                       
                                                                                       
<!--l. 2623--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
   <mtable 
class="equation"><mtr><mtd>
   <mtable  
columnalign="right left" class="split">
<mtr class="split-mtr"><mtd 
class="split-mtd"> <msub><mrow 
><mi 
>y</mi></mrow><mrow 
><mi 
>l</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></mtd><mtd 
class="split-mtd"> <mo 
class="MathClass-rel">=</mo> <mover class="overset"><mrow 
><mover accent="false"><mrow> <mfenced separators="" 
open="("  close=")" ><mrow><munderover accentunder="false" accent="false"><mrow  
><mo mathsize="big" 
>&#x2211;</mo>
  </mrow><mrow 
><mi 
>k</mi><mo 
class="MathClass-rel">=</mo><mn>0</mn></mrow><mrow 
><mi 
>K</mi><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></mrow></munderover 
><msubsup><mrow 
><mi 
>h</mi></mrow><mrow 
>
<mi 
>k</mi></mrow><mrow 
><mi 
>f</mi><mo 
class="MathClass-bin">&#x2212;</mo><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;sir</mtext><!--/mstyle--></mrow></msubsup 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-bin">&#x2217;</mo> <msubsup><mrow 
><mi 
>h</mi></mrow><mrow 
>
<mi 
>k</mi></mrow><mrow 
><mi 
>e</mi><mi 
>f</mi></mrow></msubsup 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo><mo 
class="MathClass-punc">,</mo><mo 
class="MathClass-bin">&#x2217;</mo><msub><mrow 
><mi 
>u</mi></mrow><mrow 
>
<mi 
>k</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></mrow></mfenced></mrow><mo>&#xFE37;</mo></mover></mrow><mrow 
><mi 
>F</mi><mi 
>o</mi><mi 
>r</mi><mi 
>w</mi><mi 
>a</mi><mi 
>r</mi><mi 
>d</mi><mi 
>i</mi><mi 
>m</mi><mi 
>p</mi><mi 
>u</mi><mi 
>l</mi><mi 
>s</mi><mi 
>e</mi><mi 
>r</mi><mi 
>e</mi><mi 
>s</mi><mi 
>p</mi><mi 
>o</mi><mi 
>n</mi><mi 
>s</mi><mi 
>e</mi><mo 
class="MathClass-open">(</mo><mi 
>f</mi><mo 
class="MathClass-close">)</mo></mrow></mover><mi 
>o</mi><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-close">)</mo><mo 
class="MathClass-bin">&#x2217;</mo></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">      </mtd><mtd 
class="split-mtd"><mover class="overset"><mrow 
><mover accent="false"><mrow><msubsup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>l</mi></mrow><mrow 
><mi 
>b</mi><mo 
class="MathClass-bin">&#x2212;</mo><!--mstyle 
class="text"--><mtext class="textsc" mathvariant="normal" >&#x00A0;sir</mtext><!--/mstyle--></mrow></msubsup 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-bin">&#x2217;</mo> <msubsup><mrow 
><mi 
>h</mi></mrow><mrow 
>
<mi 
>l</mi></mrow><mrow 
><mi 
>e</mi><mi 
>b</mi></mrow></msubsup 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></mrow><mo>&#xFE37;</mo></mover></mrow><mrow 
><mi 
>B</mi><mi 
>a</mi><mi 
>c</mi><mi 
>k</mi><mi 
>w</mi><mi 
>a</mi><mi 
>r</mi><mi 
>d</mi><mi 
>i</mi><mi 
>m</mi><mi 
>p</mi><mi 
>u</mi><mi 
>l</mi><mi 
>s</mi><mi 
>e</mi><mi 
>r</mi><mi 
>e</mi><mi 
>s</mi><mi 
>p</mi><mi 
>o</mi><mi 
>n</mi><mi 
>s</mi><mi 
>e</mi><mo 
class="MathClass-open">(</mo><mi 
>b</mi><mo 
class="MathClass-close">)</mo></mrow></mover> <mo 
class="MathClass-bin">+</mo> <msub><mrow 
><mi 
>e</mi></mrow><mrow 
>
<mi 
>l</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo><mo 
class="MathClass-punc">,</mo></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">      </mtd><mtd 
class="split-mtd"> <mo 
class="MathClass-rel">=</mo> <msup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>f</mi></mrow></msup 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-bin">&#x2217;</mo> <msubsup><mrow 
><mi 
>h</mi></mrow><mrow 
>
<mi 
>l</mi></mrow><mrow 
><mi 
>b</mi></mrow></msubsup 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo><mi 
>o</mi><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-bin">+</mo> <msub><mrow 
><mi 
>e</mi></mrow><mrow 
>
<mi 
>l</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo><mo 
class="MathClass-punc">,</mo></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">      </mtd><mtd 
class="split-mtd"> <mo 
class="MathClass-rel">=</mo> <msub><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>l</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-punc">,</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo><mi 
>o</mi><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-close">)</mo> <mo 
class="MathClass-bin">+</mo> <msub><mrow 
><mi 
>e</mi></mrow><mrow 
><mi 
>l</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo><mo 
class="MathClass-punc">,</mo></mtd>
   </mtr></mtable>                                                                                    </mtd><mtd>
   </mtd></mtr></mtable>
</math></td><td class="eq-no">(17)</td></tr></table>
<!--l. 2625--><p class="indent" >   where <!--l. 2625--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x2217;</mo></math> denotes
temporal convolution and <!--l. 2625--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>e</mi></mrow><mrow 
><mi 
>l</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math>
is the noise for the <!--l. 2625--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>l</mi></math>th
receive element. Note that the total forward impulse response is a superposition of the
forward impulse responses corresponding to all transmit elements. The <span 
class="cmti-10">object function</span>
<!--l. 2628--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>o</mi><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>r</mi></mstyle><mo 
class="MathClass-close">)</mo></math> is the scattering strength
at the observation point <!--l. 2628--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></math>,
<!--l. 2634--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msubsup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>k</mi></mrow><mrow 
><mi 
>e</mi><mi 
>f</mi></mrow></msubsup 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math> is the forward electrical impulse
response for the <!--l. 2635--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>k</mi></math>th transmit
element,  <!--l. 2641--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msubsup><mrow 
><mi 
>h</mi></mrow><mrow 
><mi 
>l</mi></mrow><mrow 
><mi 
>e</mi><mi 
>b</mi></mrow></msubsup 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math>  the backward electrical
impulse response for the <!--l. 2643--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>l</mi></math>th
receive element, and <!--l. 2643--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mi 
>u</mi></mrow><mrow 
><mi 
>k</mi></mrow></msub 
><mo 
class="MathClass-open">(</mo><mi 
>t</mi><mo 
class="MathClass-close">)</mo></math> is
the input signal for the <!--l. 2643--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>k</mi></math>th
transmit element.
</p><!--l. 2647--><p class="indent" >   A discrete-time version of&#x00A0;(<a 
href="#x1-66001r15">15<!--tex4ht:ref: eq:system_impulse_response --></a>) is obtained by sampling the impulse responses and by using discrete-time convolutions.
If we consider <!--l. 2648--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>N</mi></math>
observation points then the received discrete waveform from a target at the
<!--l. 2649--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>n</mi></math>th observation
point, <!--l. 2650--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mstyle mathvariant="bold"><mi 
>r</mi></mstyle></mrow><mrow 
><mi 
>n</mi></mrow></msub 
> <mo 
class="MathClass-rel">=</mo> <mo 
class="MathClass-open">(</mo><msub><mrow 
><mi 
>x</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
><mo 
class="MathClass-punc">,</mo><msub><mrow 
><mi 
>y</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
><mo 
class="MathClass-punc">,</mo><msub><mrow 
><mi 
>z</mi></mrow><mrow 
><mi 
>n</mi></mrow></msub 
><mo 
class="MathClass-close">)</mo></math>,
can be expressed as </p><table class="equation"><tr><td> <a 
 id="x1-73002r18"></a>
<!--l. 2652--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation"><msubsup><mrow 
>
                                  <mstyle mathvariant="bold"><mi 
>y</mi></mstyle></mrow><mrow 
><mi 
>l</mi></mrow><mrow 
><mo 
class="MathClass-open">(</mo><mi 
>n</mi><mo 
class="MathClass-close">)</mo></mrow></msubsup 
> <mo 
class="MathClass-rel">=</mo><msubsup><mrow 
> <mstyle mathvariant="bold"><mi 
>h</mi></mstyle></mrow><mrow 
>
<mi 
>l</mi></mrow><mrow 
><mo 
class="MathClass-open">(</mo><mi 
>n</mi><mo 
class="MathClass-close">)</mo></mrow></msubsup 
><msub><mrow 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>o</mi></mstyle><mo 
class="MathClass-close">)</mo></mrow><mrow 
>
<mi 
>n</mi></mrow></msub 
> <mo 
class="MathClass-bin">+</mo><msub><mrow 
> <mstyle mathvariant="bold"><mi 
>e</mi></mstyle></mrow><mrow 
><mi 
>l</mi></mrow></msub 
><mo 
class="MathClass-punc">,</mo>
</math></td><td class="eq-no">(18)</td></tr></table>
<!--l. 2657--><p class="indent" >   where the column vector <!--l. 2657--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msubsup><mrow 
><mstyle mathvariant="bold"><mi 
>h</mi></mstyle></mrow><mrow 
><mi 
>l</mi></mrow><mrow 
><mo 
class="MathClass-open">(</mo><mi 
>n</mi><mo 
class="MathClass-close">)</mo></mrow></msubsup 
></math> is the discrete
system impulse response for the <!--l. 2658--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>l</mi></math>th
                                                                                       
                                                                                       
receive element.<span class="footnote-mark"><a 
href="userman12.xml#fn11x0"><sup class="textsuperscript">11</sup></a></span><a 
 id="x1-73003f11"></a>  The
vector <!--l. 2658--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>o</mi></mstyle></math> represents the
<!--l. 2659--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>N</mi></math> scattering amplitudes in the
region-of-interest, and the notation <!--l. 2659--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>n</mi></mstyle><mo 
class="MathClass-close">)</mo></mrow><mrow 
><mi 
>n</mi></mrow></msub 
></math>
denotes the <!--l. 2659--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>n</mi></math>th element in
<!--l. 2660--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>o</mi></mstyle></math>.<span class="footnote-mark"><a 
href="userman13.xml#fn12x0"><sup class="textsuperscript">12</sup></a></span><a 
 id="x1-73004f12"></a> 
</p><!--l. 2664--><p class="indent" >   To obtain the received signal for all observation points we need to perform a summation over
<!--l. 2664--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>n</mi></math>, which
equivalently can be expressed as a matrix-vector multiplication, according to </p><table class="equation"><tr><td> <a 
 id="x1-73005r19"></a>
<!--l. 2667--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
   <mtable 
class="equation"><mtr><mtd>
   <mtable  
columnalign="right left" class="split">
<mtr class="split-mtr"><mtd 
class="split-mtd"> <msub><mrow 
><mstyle mathvariant="bold"><mi 
>y</mi></mstyle></mrow><mrow 
><mi 
>l</mi></mrow></msub 
> <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="split-mtd"><munder class="msub"><mrow 
><mo mathsize="big" 
>&#x2211;</mo>
   </mrow><mrow 
><mi 
>n</mi></mrow></munder 
><msubsup><mrow 
><mstyle mathvariant="bold"><mi 
>h</mi></mstyle></mrow><mrow 
><mi 
>l</mi></mrow><mrow 
><mo 
class="MathClass-open">(</mo><mi 
>n</mi><mo 
class="MathClass-close">)</mo></mrow></msubsup 
><msub><mrow 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>o</mi></mstyle><mo 
class="MathClass-close">)</mo></mrow><mrow 
>
<mi 
>n</mi></mrow></msub 
> <mo 
class="MathClass-bin">+</mo><msub><mrow 
> <mstyle mathvariant="bold"><mi 
>e</mi></mstyle></mrow><mrow 
><mi 
>l</mi></mrow></msub 
><mo 
class="MathClass-punc">,</mo></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">   <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="split-mtd"> <mfenced separators="" 
open="["  close="]" ><mrow><mtable  style="text-align:axis;"  
equalrows="false" columnlines="none none none none none none none none none" equalcolumns="false" class="array"><mtr><mtd 
class="array"  columnalign="center"><msubsup><mrow 
><mstyle mathvariant="bold"><mi 
>h</mi></mstyle></mrow><mrow 
><mi 
>l</mi></mrow><mrow 
><mo 
class="MathClass-open">(</mo><mn>0</mn><mo 
class="MathClass-close">)</mo></mrow></msubsup 
></mtd><mtd 
class="array"  columnalign="center"><msubsup><mrow 
><mstyle mathvariant="bold"><mi 
>h</mi></mstyle></mrow><mrow 
>
<mi 
>l</mi></mrow><mrow 
><mo 
class="MathClass-open">(</mo><mn>1</mn><mo 
class="MathClass-close">)</mo></mrow></msubsup 
></mtd><mtd 
class="array"  columnalign="center"><mo 
class="MathClass-rel">&#x22EF;</mo><mspace width="0.3em" class="thinspace"/></mtd><mtd 
class="array"  columnalign="center"><msubsup><mrow 
><mstyle mathvariant="bold"><mi 
>h</mi></mstyle></mrow><mrow 
>
<mi 
>l</mi></mrow><mrow 
><mo 
class="MathClass-open">(</mo><mi 
>N</mi><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn><mo 
class="MathClass-close">)</mo></mrow></msubsup 
></mtd>
</mtr>    <!--*\c@MaxMatrixCols c--></mtable>                                                                                                                                                                  </mrow></mfenced> <mstyle mathvariant="bold"><mi 
>o</mi></mstyle> <mo 
class="MathClass-bin">+</mo><msub><mrow 
> <mstyle mathvariant="bold"><mi 
>e</mi></mstyle></mrow><mrow 
><mi 
>l</mi></mrow></msub 
><mo 
class="MathClass-punc">,</mo></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">   <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="split-mtd"><msub><mrow 
><mstyle mathvariant="bold"><mi 
>P</mi></mstyle></mrow><mrow 
><mi 
>l</mi></mrow></msub 
><mstyle mathvariant="bold"><mi 
>o</mi></mstyle> <mo 
class="MathClass-bin">+</mo><msub><mrow 
> <mstyle mathvariant="bold"><mi 
>e</mi></mstyle></mrow><mrow 
><mi 
>l</mi></mrow></msub 
><mo 
class="MathClass-punc">,</mo></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">    </mtd>
   </mtr></mtable>                                                                                             </mtd><mtd>
   </mtd></mtr></mtable>
</math></td><td class="eq-no">(19)</td></tr></table>
<!--l. 2676--><p class="indent" >   which gives us a liner model for the data for one receive element.
</p><!--l. 2678--><p class="indent" >   To obtain a model for all elements we can append all
<!--l. 2678--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mi 
>L</mi></math> receive signals
<!--l. 2678--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><msub><mrow 
><mstyle mathvariant="bold"><mi 
>y</mi></mstyle></mrow><mrow 
><mi 
>l</mi></mrow></msub 
></math> into a single
vector <!--l. 2678--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>y</mi></mstyle></math>
and we finally have linear model for the total array setup </p><table class="equation"><tr><td> <a 
 id="x1-73006r20"></a>
                                                                                       
                                                                                       
<!--l. 2681--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
   <mtable 
class="equation"><mtr><mtd>
   <mtable  
columnalign="right left" class="split">
<mtr class="split-mtr"><mtd 
class="split-mtd"> <mstyle mathvariant="bold"><mi 
>y</mi></mstyle> <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="split-mtd"> <mfenced separators="" 
open="["  close="]" ><mrow><mtable  style="text-align:axis;"  
equalrows="false" columnlines="none none none none none none none none none" equalcolumns="false" class="array"><mtr><mtd 
class="array"  columnalign="center"><msub><mrow 
> <mstyle mathvariant="bold"><mi 
>y</mi></mstyle></mrow><mrow 
><mn>0</mn></mrow></msub 
>  </mtd>
</mtr><mtr><mtd 
class="array"  columnalign="center"><msub><mrow 
><mstyle mathvariant="bold"><mi 
>y</mi></mstyle></mrow><mrow 
><mn>1</mn></mrow></msub 
>  </mtd>
</mtr><mtr><mtd 
class="array"  columnalign="center"> <mo 
class="MathClass-op">&#x22EE;</mo>  </mtd></mtr><mtr><mtd 
class="array"  columnalign="center"><msub><mrow 
><mstyle mathvariant="bold"><mi 
>y</mi></mstyle> </mrow><mrow 
>
<mi 
>L</mi><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></mrow></msub 
></mtd></mtr><mtr><mtd 
class="array"  columnalign="center"></mtd></mtr> <!--*\c@MaxMatrixCols c--></mtable>                                                                                                                                                               </mrow></mfenced> <mo 
class="MathClass-rel">=</mo>  <mfenced separators="" 
open="["  close="]" ><mrow><mtable  style="text-align:axis;"  
equalrows="false" columnlines="none none none none none none none none none" equalcolumns="false" class="array"><mtr><mtd 
class="array"  columnalign="center"><msub><mrow 
> <mstyle mathvariant="bold"><mi 
>P</mi></mstyle></mrow><mrow 
><mn>0</mn></mrow></msub 
>  </mtd>
</mtr><mtr><mtd 
class="array"  columnalign="center"><msub><mrow 
><mstyle mathvariant="bold"><mi 
>P</mi></mstyle></mrow><mrow 
><mn>1</mn></mrow></msub 
>  </mtd>
</mtr><mtr><mtd 
class="array"  columnalign="center">  <mo 
class="MathClass-op">&#x22EE;</mo>  </mtd></mtr><mtr><mtd 
class="array"  columnalign="center"><msub><mrow 
><mstyle mathvariant="bold"><mi 
>P</mi></mstyle> </mrow><mrow 
>
<mi 
>L</mi><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></mrow></msub 
></mtd></mtr><mtr><mtd 
class="array"  columnalign="center"></mtd></mtr> <!--*\c@MaxMatrixCols c--></mtable>                                                                                                                                                              </mrow></mfenced> <mstyle mathvariant="bold"><mi 
>o</mi></mstyle> <mo 
class="MathClass-bin">+</mo>  <mfenced separators="" 
open="["  close="]" ><mrow><mtable  style="text-align:axis;"  
equalrows="false" columnlines="none none none none none none none none none" equalcolumns="false" class="array"><mtr><mtd 
class="array"  columnalign="center"><msub><mrow 
> <mstyle mathvariant="bold"><mi 
>e</mi></mstyle></mrow><mrow 
><mn>0</mn></mrow></msub 
>  </mtd>
</mtr><mtr><mtd 
class="array"  columnalign="center"><msub><mrow 
><mstyle mathvariant="bold"><mi 
>e</mi></mstyle></mrow><mrow 
><mn>1</mn></mrow></msub 
>  </mtd>
</mtr><mtr><mtd 
class="array"  columnalign="center"> <mo 
class="MathClass-op">&#x22EE;</mo>  </mtd></mtr><mtr><mtd 
class="array"  columnalign="center"><msub><mrow 
><mstyle mathvariant="bold"><mi 
>e</mi></mstyle> </mrow><mrow 
>
<mi 
>L</mi><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></mrow></msub 
></mtd></mtr><mtr><mtd 
class="array"  columnalign="center"></mtd></mtr> <!--*\c@MaxMatrixCols c--></mtable>                                                                                                                                                               </mrow></mfenced> </mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">   <mo 
class="MathClass-rel">=</mo></mtd><mtd 
class="split-mtd"><mstyle mathvariant="bold"><mi 
>P</mi></mstyle><mstyle mathvariant="bold"><mi 
>o</mi></mstyle> <mo 
class="MathClass-bin">+</mo> <mstyle mathvariant="bold"><mi 
>e</mi></mstyle><mo 
class="MathClass-punc">,</mo></mtd>
   </mtr></mtable>                                                                                                                                                                                                                                                                         </mtd><mtd>
   </mtd></mtr></mtable>
</math></td><td class="eq-no">(20)</td></tr></table>
<!--l. 2695--><p class="indent" >   for the total array imaging system&#x00A0;[<a 
href="#XLingvall2004">20</a>]. The <span 
class="cmti-10">propagation matrix</span>,
<!--l. 2697--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>P</mi></mstyle></math>, in&#x00A0;(<a 
href="#x1-73006r20">20<!--tex4ht:ref: eq:extended --></a>)
now describes both the transmission and the reception process for an arbitrary focused array. Note that the
position of the observation points, and the corresponding scattering amplitudes represented by the vector
<!--l. 2700--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>o</mi></mstyle></math>, is not
restricted to a regular two-dimensional grid, which is often used in ultrasonic imaging. Furthermore, the
array elements can in fact, similar to the observation points , be positioned at arbitrary locations in
tree-dimensional space space. Thus, the model&#x00A0;(<a 
href="#x1-73006r20">20<!--tex4ht:ref: eq:extended --></a>) can also be used to model two-dimensional arrays
as well as to model array responses in tree-dimensional space. Also note that the &#x201C;noise&#x201D; vector
<!--l. 2705--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>e</mi></mstyle></math> describes the <span 
class="cmti-10">uncertainty </span>of
the model&#x00A0;(<a 
href="#x1-73006r20">20<!--tex4ht:ref: eq:extended --></a>). The noise <!--l. 2705--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>e</mi></mstyle></math>
does not only model the measurement noise but also all other errors that we may have, such as:
multiple scattering effects, cross talk between array elements, non-uniform sound speed in the media,
etc.
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">11.4.1   </span> <a 
 id="x1-7400011.4.1"></a>The Matched Filter</h5>
<!--l. 2716--><p class="noindent" >The matched filter has the property of maximizing the signal-to-noise ratio (at a single point). The matched
filter for each observation point is given by&#x00A0;[<a 
href="#XLingvall2003">18</a>] </p><table class="equation"><tr><td> <a 
 id="x1-74001r21"></a>
<!--l. 2719--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
                                       <mover 
accent="true"><mrow 
><mstyle mathvariant="bold"><mi 
>o</mi></mstyle></mrow><mo 
class="MathClass-op">&#x0302;</mo></mover> <mo 
class="MathClass-rel">=</mo><msup><mrow 
> <mstyle mathvariant="bold"><mi 
>P</mi></mstyle></mrow><mrow 
><mi 
>T</mi></mrow></msup 
><mstyle mathvariant="bold"><mi 
>y</mi></mstyle><mo 
class="MathClass-punc">.</mo>
</math></td><td class="eq-no">(21)</td></tr></table>
<!--l. 2724--><p class="indent" >   Note that the structure of the matched filter is similar to delay-and-sum processing which also can be
expressed as a matrix-vector multiplication (see the <span 
class="cmtt-10">model</span><span 
class="cmtt-10">_based</span><span 
class="cmtt-10">_example.m </span>on the DREAM website), </p><table class="equation"><tr><td>
<a 
 id="x1-74002r22"></a>
                                                                                       
                                                                                       
<!--l. 2726--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
                                       <mover 
accent="true"><mrow 
><mstyle mathvariant="bold"><mi 
>o</mi></mstyle></mrow><mo 
class="MathClass-op">&#x0302;</mo></mover> <mo 
class="MathClass-rel">=</mo><msup><mrow 
> <mstyle mathvariant="bold"><mi 
>D</mi></mstyle></mrow><mrow 
><mi 
>T</mi></mrow></msup 
><mstyle mathvariant="bold"><mi 
>y</mi></mstyle>
</math></td><td class="eq-no">(22)</td></tr></table>
<!--l. 2731--><p class="indent" >   where the delay matrix <!--l. 2731--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>D</mi></mstyle></math>
has ones in the positions corresponding the the propagation delays and zeros otherwise.
</p><!--l. 2733--><p class="noindent" >
</p>
   <h5 class="subsubsectionHead"><span class="titlemark">11.4.2   </span> <a 
 id="x1-7500011.4.2"></a>The Optimal Linear Estimator</h5>
<!--l. 2735--><p class="noindent" >The optimal linear estimator (or the Wiener filter) is given by&#x00A0;[<a 
href="#XStoughton1993">17</a>, <a 
href="#XLingvall2007">19</a>] </p><table class="equation"><tr><td> <a 
 id="x1-75001r23"></a>
<!--l. 2737--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="block" class="equation">
   <mtable 
class="equation"><mtr><mtd>
   <mtable  
columnalign="right left" class="split">
<mtr class="split-mtr"><mtd 
class="split-mtd"> <mover 
accent="true"><mrow 
><mstyle mathvariant="bold"><mi 
>o</mi></mstyle></mrow><mo 
class="MathClass-op">&#x0302;</mo></mover></mtd><mtd 
class="split-mtd"> <mo 
class="MathClass-rel">=</mo> <mstyle mathvariant="bold"><mi 
>C</mi></mstyle><mi 
>o</mi><msup><mrow 
><mstyle mathvariant="bold"><mi 
>P</mi></mstyle></mrow><mrow 
><mi 
>T</mi></mrow></msup 
><msup><mrow 
><mo 
class="MathClass-open">(</mo><mstyle mathvariant="bold"><mi 
>P</mi></mstyle><mstyle mathvariant="bold"><mi 
>C</mi></mstyle>
<mi 
>o</mi><msup><mrow 
><mstyle mathvariant="bold"><mi 
>P</mi></mstyle></mrow><mrow 
><mi 
>T</mi></mrow></msup 
> <mo 
class="MathClass-bin">+</mo> <mstyle mathvariant="bold"><mi 
>C</mi></mstyle>
<mi 
>e</mi><mo 
class="MathClass-close">)</mo></mrow><mrow 
><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></mrow></msup 
><mstyle mathvariant="bold"><mi 
>y</mi></mstyle></mtd>
</mtr><mtr class="split-mtr"><mtd 
class="split-mtd">   </mtd><mtd 
class="split-mtd"> <mo 
class="MathClass-rel">=</mo> <msup><mrow 
><mo 
class="MathClass-open">(</mo><msup><mrow 
><mstyle mathvariant="bold"><mi 
>P</mi></mstyle></mrow><mrow 
><mi 
>T</mi></mrow></msup 
><mstyle mathvariant="bold"><mi 
>C</mi></mstyle>
<mi 
>e</mi><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn><mstyle mathvariant="bold"><mi 
>P</mi></mstyle> <mo 
class="MathClass-bin">+</mo> <mstyle mathvariant="bold"><mi 
>C</mi></mstyle>
<mi 
>o</mi><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn><mo 
class="MathClass-close">)</mo></mrow><mrow 
><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn></mrow></msup 
><msup><mrow 
><mstyle mathvariant="bold"><mi 
>P</mi></mstyle></mrow><mrow 
><mi 
>T</mi></mrow></msup 
><mstyle mathvariant="bold"><mi 
>C</mi></mstyle>
<mi 
>e</mi><mo 
class="MathClass-bin">&#x2212;</mo><mn>1</mn><mstyle mathvariant="bold"><mi 
>y</mi></mstyle><mo 
class="MathClass-punc">,</mo></mtd>
   </mtr></mtable>                                                                                    </mtd><mtd>
   </mtd></mtr></mtable>
</math></td><td class="eq-no">(23)</td></tr></table>
<!--l. 2745--><p class="indent" >   where <!--l. 2745--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>C</mi></mstyle><mi 
>o</mi></math> is the
covariance matrix for <!--l. 2745--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>o</mi></mstyle></math>
and <!--l. 2745--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>C</mi></mstyle><mi 
>e</mi></math> is the covariance
matrix for <!--l. 2745--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mstyle mathvariant="bold"><mi 
>e</mi></mstyle></math>,
respectively. The estimator&#x00A0;(<a 
href="#x1-75001r23">23<!--tex4ht:ref: eq:optimal --></a>) has the property, not found for the matched filter or for delay-and-sum
methods, namely that any beampattern can be compensated given that the signal-to-noise ratio is
sufficient.
</p><!--l. 2749--><p class="indent" >   As a final not on model based imaging is that the matrices involved normally become rather large. It is
therefore highly recommended to used a tuned linear algebra library, such as <a 
href="http://www.tacc.utexas.edu/resources/software/" >K. Goto&#x2019;s</a> BLAS library or the
<a 
href="http://math-atlas.sourceforge.net/" >ATLAS</a> library, for example. These libraries often have thread support so that all CPUs on the computer can be
utilized.
</p><!--l. 2755--><p class="indent" >   An example of model based (and matrix based delay-and-sum) imaging can be found on the DREAM website
(see the <span 
class="cmtt-10">model</span><span 
class="cmtt-10">_base</span><span 
class="cmtt-10">_example.m </span>file on the examples page).
                                                                                       
                                                                                       
</p><!--l. 2758--><p class="noindent" >
</p>
   <h3 class="sectionHead"><span class="titlemark">12   </span> <a 
 id="x1-7600012"></a>The Graphical User Interface (Matlab only)</h3>
<!--l. 2761--><p class="noindent" >To launch the DREAM Toolbox GUI, type <span 
class="cmtt-10">dream</span><span 
class="cmtt-10">_gui </span>in the <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;Command Window and a graphical user
interface will be raised as shown in Figure&#x00A0;<a 
href="#x1-760019">9<!--tex4ht:ref: fig:gui --></a>. </p><hr class="figure" /><div class="figure" 
>
                                                                                       
                                                                                       
<a 
 id="x1-760019"></a>
                                                                                       
                                                                                       
<div class="center" 
>
<!--l. 2766--><p class="noindent" >
</p><!--l. 2767--><p class="noindent" ><span class="fbox"><img 
src="userman15x.png" alt="PIC" class="graphics" width="1145.27873pt" height="838.13124pt"  /><!--tex4ht:graphics  
name="userman15x.png" src="eps/gui.ps"  
--></span></p></div>
<br /> <div class="caption" 
><span class="id">Figure&#x00A0;9: </span><span  
class="content">The graphical user interface. </span></div><!--tex4ht:label?: x1-760019 -->
                                                                                       
                                                                                       
   </div><hr class="endfigure" />
<!--l. 2774--><p class="indent" >   After activating the user interface, users can set parameters, compute SIRs, and save and process the
resulting SIR by using the graphical controls. For setting of geometry parameters, please also refer to the
schematic diagram of transducer displayed in the center of the graphic interface. After setting all the parameters,
clicking on the <span 
class="cmti-10">Compute </span>button starts to compute SIR. In addition, the DREAM GUI provides several
post-processing operations to process the SIRs, including computing pressure response, computing the spectrum
of the SIR, and convolving the SIR with an excitation signal. Notice that if users tick the checkbox of pressure
response, the spectrum and convolution operations will be performed on the pressure instead of
on the SIR. The parameters and resulting SIR can be stored in an <span 
class="cmtt-10">*.mat </span>file by clicking on the
button of <span 
class="cmti-10">Save</span>. The parameters settings can then be restored by loading the file using the <span 
class="cmti-10">Load</span>
button.
</p>
   <h3 class="sectionHead"><span class="titlemark">13   </span> <a 
 id="x1-7700013"></a>Known Issues</h3>
     <ul class="itemize1">
     <li class="itemize">On Windows platforms the MEX-files can not be aborted by pressing <span 
class="cmtt-10">CTRL-C </span>since Windows lacks
     real
     asynchronous signals, see: <a 
href="http://www.mathworks.com/support/solutions/data/1-188VX.html" class="url" ><span 
class="cmtt-10">http://www.mathworks.com/support/solutions/data/1-188VX.html</span></a>
     Therefore, when <span 
class="cmtt-10">CTRL-C </span>is pressed, using Windows, the operation is interrupted after the MEX-file
     has finished.
     </li>
     <li class="itemize">On Linux x86 platforms the <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;release 14 library <span 
class="cmtt-10">matlab/sys/os/glnx86/libgcc</span><span 
class="cmtt-10">_s.so </span>seems to be
     buggy causing <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;to abort when a <span 
class="cmtt-10">mexErrMsg </span>call is done within a MEX-file. The threaded
     functions uses the <span 
class="cmtt-10">mexErrMsg </span>function when <span 
class="cmtt-10">CTRL-C </span>is pressed. A work-around is to set the environment
     variable <span 
class="cmtt-10">LD</span><span 
class="cmtt-10">_PRELOAD </span>to point to a working library. If you, for example, are using gcc 3.4.4, then you can
     set
                                                                                       
                                                                                       
     <div class="verbatim" id="verbatim-65">
     &#x00A0;&#x00A0;&#x00A0;export&#x00A0;LD_PRELOAD=/usr/lib/gcc/i686-pc-linux-gnu/3.4.4/libgcc_s.so
</div>
     <!--l. 2814--><p class="nopar" > or rename <span 
class="cmtt-10">matlab/sys/os/glnx86/libgcc</span><span 
class="cmtt-10">_s.so </span>and copy (or link) a working <span 
class="cmtt-10">libgcc</span><span 
class="cmtt-10">_s.so </span>to the
     <span 
class="cmtt-10">matlab/sys/os/glnx86/ </span>directory.
     </p></li>
     <li class="itemize">Matlab&#x2019;s memory manager is not thread safe (at least not R2007b and
     older). The functions that use the fftw library may therefore crash if <span 
class="cmtt-10">n</span><span 
class="cmtt-10">_cpus</span>
     <!--l. 2821--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mo 
class="MathClass-rel">&#x003E;</mo> <mn>1</mn></math>. A
     workaround is to set the env. variable <span 
class="cmtt-10">MATLAB</span><span 
class="cmtt-10">_MEM</span><span 
class="cmtt-10">_MGR=system </span>(i.e., <span 
class="cmtt-10">export MATLAB</span><span 
class="cmtt-10">_MEM</span><span 
class="cmtt-10">_MGR=system</span>).
     </li>
     <li class="itemize">The file <span 
class="cmtt-10">mex</span><span 
class="cmtt-10">_sum</span><span 
class="cmtt-10">_fftconv</span><span 
class="cmtt-10">_p.c </span>do not compile unless
     <span 
class="cmcsc-10">M<span 
class="small-caps">a</span><span 
class="small-caps">t</span><span 
class="small-caps">l</span><span 
class="small-caps">a</span><span 
class="small-caps">b</span></span>&#x00A0;<!--l. 2824--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" > <mo 
class="MathClass-rel">&#x2265;</mo></math>
     R2006b is installed. The problem is that <span 
class="cmtt-10">mwSize </span>must be defined in <span 
class="cmtt-10">matlab/extern/include/matrix.h</span>
     (<span 
class="cmtt-10">sum</span><span 
class="cmtt-10">_fftconv</span><span 
class="cmtt-10">_p </span>compiles for Octave).
     </li>
     <li class="itemize">The computation of responses for lossy media is rather time consuming; the computation time can be as
     large as a factor of 1000 times longer than for loss-less media. This due to the fact that the frequency
     domain attenuation response is computed, and an inverse FFT is performed, for every surface element,
     <span 
class="cmtt-10">dx</span><!--l. 2831--><math 
 xmlns="http://www.w3.org/1998/Math/MathML" display="inline" ><mo 
class="MathClass-bin">&#x00D7;</mo></math><span 
class="cmtt-10">dy</span>,
     of the transducer surface.
     </li></ul>
<!--l. 2835--><p class="noindent" >
                                                                                       
                                                                                       
<a 
 id="Q1-1-89"></a>
</p>
   <h3 class="likesectionHead"><a 
 id="x1-7800013"></a>References</h3>
<!--l. 1--><p class="noindent" >
    </p><div class="thebibliography">
    <p class="bibitem" ><span class="biblabel">
 <a 
 id="XPiwakowski1989"></a>[1] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> B.&#x00A0;Piwakowski and B.&#x00A0;Delannoy, &#x201C;Method for computing spatial pulse response: Time-domain
    approach&#x201D;, J. Acoust. Soc. America <span 
class="cmbx-10">86</span>, 2422&#x2013;32 (1989).
    </p>
    <p class="bibitem" ><span class="biblabel">
 <a 
 id="XPiwakowski1999"></a>[2] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> B.&#x00A0;Piwakowski and K.&#x00A0;Sbai, &#x201C;A new approach to calculate the field radiated from arbitrarily
    structured  transducer  arrays&#x201D;,  IEEE  Transactions  on  Ultrasonics,  Ferroelectrics  and  Frequency
    Control <span 
class="cmbx-10">46</span>, 422&#x2013;40 (1999).
    </p>
    <p class="bibitem" ><span class="biblabel">
 <a 
 id="XTupholme1969"></a>[3] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> G.&#x00A0;E. Tupholme, &#x201C;Generation of acoustic pulses by baffled plane pistons&#x201D;, Mathematika <span 
class="cmbx-10">16</span>,
    209&#x2013;224 (1969).
    </p>
    <p class="bibitem" ><span class="biblabel">
 <a 
 id="XStepanishen1971a"></a>[4] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> P.&#x00A0;Stepanishen, &#x201C;Transient radiation fom pistons in an infinite planar baffle&#x201D;, J. Acoust. Soc.
    America <span 
class="cmbx-10">49</span>, 1629&#x2013;38 (1971).
    </p>
    <p class="bibitem" ><span class="biblabel">
 <a 
 id="XAki1980"></a>[5] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> K.&#x00A0;Aki and P.&#x00A0;Richards, <span 
class="cmti-10">Quantitative Seismology </span>(W.H. Freeman, San Francisco) (1980).
    </p>
    <p class="bibitem" ><span class="biblabel">
 <a 
 id="XLockwood1973"></a>[6] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> J.&#x00A0;Lockwood and J.&#x00A0;Willette, &#x201C;High-speed method for computing the exact solution for the
    pressure variations in the nearfield of a baffled piston&#x201D;, J. Acoust. Soc. America <span 
class="cmbx-10">53</span>, 735&#x2013;741 (1973).
    </p>
    <p class="bibitem" ><span class="biblabel">
 <a 
 id="Xfftw"></a>[7] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> <a 
href="http://www.fftw.org" class="url" ><span 
class="cmtt-10">http://www.fftw.org</span></a>.
    </p>
    <p class="bibitem" ><span class="biblabel">
 <a 
 id="XGrosso1974"></a>[8] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> V.&#x00A0;A. Del&#x00A0;Grosso, &#x201C;New equation for the speed of sound in natural waters (with comparisons
    to other equations)&#x201D;, J. Acoust. Soc. America <span 
class="cmbx-10">56</span>, 1084&#x2013;109 (1974).
    </p>
    <p class="bibitem" ><span class="biblabel">
 <a 
 id="XStepanishen1981"></a>[9] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> P.&#x00A0;Stepanishen, &#x201C;Pulsed transmit/receive response of ultrasonic piezoelectric transducers&#x201D;, J.
    Acoust. Soc. America <span 
class="cmbx-10">69</span>, 1815&#x2013;1827 (1981).
    </p>
    <p class="bibitem" ><span class="biblabel">
<a 
 id="XWhiley1985"></a>[10] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> C.&#x00A0;Wiley, &#x201C;Synthetic aperture radars&#x201D;, IEEE Trans. on Aerosp. Electron. Syst. <span 
class="cmbx-10">21</span>, 440&#x2013;443
    (1985).
                                                                                       
                                                                                       
    </p>
    <p class="bibitem" ><span class="biblabel">
<a 
 id="XSherwin1962"></a>[11] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> C.&#x00A0;Sherwin, J.&#x00A0;Ruina, and R.&#x00A0;Rawcliffe, &#x201C;Some early developments in synthetic aperture radar
    systems&#x201D;, IRE Trans. Military Electron. <span 
class="cmbx-10">6</span>, 111&#x2013;115 (1962).
    </p>
    <p class="bibitem" ><span class="biblabel">
<a 
 id="XGough1997"></a>[12] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span>  P.&#x00A0;Gough  and  D.&#x00A0;Hawkins,  &#x201C;Imaging  algorithms  for  strip-map  synthetic  aperture  sonar:
    Minimizing the effects of aperure errors and aperture undersampling&#x201D;, IEEE Journal of Oceanic
    Engineering <span 
class="cmbx-10">22</span>, 27&#x2013;39 (1997).
    </p>
    <p class="bibitem" ><span class="biblabel">
<a 
 id="XSeydel1982"></a>[13] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> J.&#x00A0;Seydel, &#x201C;Ultrasonic synthetic-aperture focusing techniques in NDT&#x201D;, Research Techniques
    for Nondestructive Testing (Academic Press) (1982).
    </p>
    <p class="bibitem" ><span class="biblabel">
<a 
 id="XDoctor1986"></a>[14] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> S.&#x00A0;Doctor, T.&#x00A0;Hall, and L.&#x00A0;Reid, &#x201C;SAFT&#x2014;the evolution of a signal processing technology for
    ultrasonic testing&#x201D;, NDT International <span 
class="cmbx-10">19</span>, 163&#x2013;172 (1986).
    </p>
    <p class="bibitem" ><span class="biblabel">
<a 
 id="XFrazier1998"></a>[15] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> C.&#x00A0;Frazier and J.&#x00A0;W.D.&#x00A0;O&#x2019;Brien, &#x201C;Synthetic aperture techniques with a virtual source element&#x201D;,
    IEEE Transactions on Ultrasonics, Ferroelectrics, and Frequency Control <span 
class="cmbx-10">45</span>, 196&#x2013;207 (1998).
    </p>
    <p class="bibitem" ><span class="biblabel">
<a 
 id="XKino1987"></a>[16] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span>  G.&#x00A0;S.  Kino,  <span 
class="cmti-10">Acoustic Waves: Devices, Imaging and Analog Signal Processing</span>,  volume&#x00A0;6  of
    <span 
class="cmti-10">Prentice-Hall Signal Processing Series </span>(Prentice-Hall) (1987).
    </p>
    <p class="bibitem" ><span class="biblabel">
<a 
 id="XStoughton1993"></a>[17] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> R.&#x00A0;Stoughton, &#x201C;Source imaging with minimum mean-squared error&#x201D;, jasa <span 
class="cmbx-10">94</span>, 827&#x2013;834 (1993).
    </p>
    <p class="bibitem" ><span class="biblabel">
<a 
 id="XLingvall2003"></a>[18] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> F.&#x00A0;Lingvall, T.&#x00A0;Olofsson, and T.&#x00A0;Stepinski, &#x201C;Synthetic aperture imaging using sources with
    finite aperture: Deconvolution of the spatial impulse response&#x201D;, J. Acoust. Soc. America <span 
class="cmbx-10">114</span>, 225&#x2013;234
    (2003).
    </p>
    <p class="bibitem" ><span class="biblabel">
<a 
 id="XLingvall2007"></a>[19] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span> F.&#x00A0;Lingvall and T.&#x00A0;Olofsson, &#x201C;On time-domain model based ultrasonic array imaging&#x201D;, <span 
class="cmbx-10">54</span>,
    1623&#x2013;1633 (2007).
    </p>
    <p class="bibitem" ><span class="biblabel">
<a 
 id="XLingvall2004"></a>[20] <span class="bibsp">&#x00A0;&#x00A0;&#x00A0;</span></span>  F.&#x00A0;Lingvall,  &#x201C;A  method  of  improving  overall  resolution  in  ultrasonic  array  imaging  using
    spatio-temporal deconvolution&#x201D;, Ultrasonics <span 
class="cmbx-10">42</span>, 961&#x2013;968 (2004).
</p>
    </div>
<!--l. 2843--><p class="indent" >
                                                                                       
                                                                                       
</p>
   <h3 class="sectionHead"><span class="titlemark">A   </span> <a 
 id="x1-79000A"></a>Building the Pthreads Library for 32 and 64 bit Windows</h3>
<!--l. 2849--><p class="noindent" >The DREAM toolbox uses pthreads (POSIX threads) to run computations in parallel on several cores/cpus. To
run the parallel functions on Windows the <span 
class="cmti-10">Pthreads-win32 </span>library is used:<br 
class="newline" /><a 
href="http://sourceware.org/pthreads-win32/" class="url" ><span 
class="cmtt-10">http://sourceware.org/pthreads-win32/</span></a>. The most current version of the Pthreads-win32 library, which
is the one used by DREAM, is version 2.8.0 (2006-12-22). A 32-bit binary version of the library
can be found at: <a 
href="ftp://sourceware.org/pub/pthreads-win32/" class="url" ><span 
class="cmtt-10">ftp://sourceware.org/pub/pthreads-win32/</span></a>. The <a 
href="http://sourceforge.net/projects/mingw-w64/" >MinGW-w64</a> project has a
patch to build the Pthreads-win32 lib for 64-bit Windows, and there are some more 64-bit patches
at:<br 
class="newline" /><a 
href="http://www.cadforte.com/wiki/index.php/Pthreads" class="url" ><span 
class="cmtt-10">http://www.cadforte.com/wiki/index.php/Pthreads</span></a>.
</p><!--l. 2857--><p class="indent" >   To facilite building the lib we have included our own (experimental) patch, which is a combination of the
patches above (with some minor changes), and the source code for the Pthreads-win32 lib in the source code
packge of the DREAM toolbox. There are also two (bash) build scripts which can be used for building the 32-bit
and 64-bit libs, respectively. This is tested using the MinGW-w32 and MinGW-w64 cross compiler tool chains on
Linux. After uncompressing the DREAM source code packge you can find these files in the <span 
class="cmtt-10">windows</span>
folder.
</p><!--l. 2863--><p class="indent" >   Given that you have installed the MinGW-w32 cross compiler you can build the 32-bit Pthreads-win32
with
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-66">
#&#x00A0;./build_pthreads_win32.sh
</div>
<!--l. 2867--><p class="nopar" > This will build the <span 
class="cmtt-10">pthreadGC2.dll </span>file and copy it (the <span 
class="cmtt-10">pthread.def </span>file, and the header files <span 
class="cmtt-10">pthread.h</span>,
<span 
class="cmtt-10">sched.h </span>and, <span 
class="cmtt-10">semaphore.h</span>) to the <span 
class="cmtt-10">windows/dll </span>folder.
</p><!--l. 2872--><p class="indent" >   For 64-bit windows you first need to install the MinGW-w64 cross compiler and then the script
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-67">
#&#x00A0;./build_pthreads_win64.sh
</div>
<!--l. 2875--><p class="nopar" > will copy the Pthreads-win32 sources, patch them for 64-bits support, and build the lib. The 64-bit lib (the
<span 
class="cmtt-10">pthread.def </span>file, and the header files <span 
class="cmtt-10">pthread.h</span>, <span 
class="cmtt-10">sched.h </span>and, <span 
class="cmtt-10">semaphore.h</span>) will be installed in the
<span 
class="cmtt-10">windows/dll</span><span 
class="cmtt-10">_64 </span>folder.
</p><!--l. 2881--><p class="indent" >   Note: if you intend to use these libs with one of the MSVC compilers then you also need the corresponding
<span 
class="cmtt-10">lib </span>files. These <span 
class="cmtt-10">lib </span>files can be generated using the windows bat-files found in the <span 
class="cmtt-10">windows/dll </span>and
<span 
class="cmtt-10">windows/dll</span><span 
class="cmtt-10">_64 </span>folders, respectively.
</p><!--l. 2886--><p class="noindent" >
</p>
   <h3 class="sectionHead"><span class="titlemark">B   </span> <a 
 id="x1-80000B"></a>Building the FFTW Library for 32 and 64 bit Windows</h3>
<!--l. 2889--><p class="noindent" >For conveniance we have also included the sources for the FFTW library and two scripts to build the library for
both 32 and 64 bit Windows. The (bash) scripts uses MinGW-w32 and MinGW-w64 cross compiler tool chains,
respectively. Change directory to the <span 
class="cmtt-10">windows </span>folder and run
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-68">
#&#x00A0;./BUILD-MINGW-FFTW.sh
</div>
<!--l. 2895--><p class="nopar" > to build for 32-bit Windows or
                                                                                       
                                                                                       
</p>
   <div class="verbatim" id="verbatim-69">
#&#x00A0;./BUILD-MINGW_64-FFTW.sh
</div>
<!--l. 2901--><p class="nopar" > for 64-bit Windows. The two build scripts are based on the corresponding ones at the FFTW <a 
href="http://www.fftw.org" >site</a> adapted for
building DREAM on Windows. The scripts install the libraries in the <span 
class="cmtt-10">windows/dll </span>and <span 
class="cmtt-10">windows/dll</span><span 
class="cmtt-10">_64 </span>folders,
respectively.
</p><!--l. 2907--><p class="indent" >   Similary to the Pthreads-win32 lib you need to build the <span 
class="cmtt-10">lib </span>files if you intend to use these libs with one of
the MSVC compilers. These <span 
class="cmtt-10">lib </span>files can be generated using the corresponding windows bat-files found in the
<span 
class="cmtt-10">windows/dll </span>and <span 
class="cmtt-10">windows/dll</span><span 
class="cmtt-10">_64 </span>folders, respectively.
</p>
    
</body> 
</html> 

                                                                                       



