<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="bbPress/1.0.2" -->
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>k-Wave User Forum &#187; Topic: Defining Ultrasound Transducer example</title>
		<link>http://www.k-wave.org/forum/topic/defining-ultrasound-transducer-example</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 00:09:09 +0000</pubDate>
		<generator>http://bbpress.org/?v=1.0.2</generator>
		<textInput>
			<title><![CDATA[Search]]></title>
			<description><![CDATA[Search all topics from these forums.]]></description>
			<name>q</name>
			<link>http://www.k-wave.org/forum/search.php</link>
		</textInput>
		<atom:link href="http://www.k-wave.org/forum/rss/topic/defining-ultrasound-transducer-example" rel="self" type="application/rss+xml" />

		<item>
			<title>Anthony on "Defining Ultrasound Transducer example"</title>
			<link>http://www.k-wave.org/forum/topic/defining-ultrasound-transducer-example#post-5139</link>
			<pubDate>Fri, 10 Jul 2015 13:12:16 +0000</pubDate>
			<dc:creator>Anthony</dc:creator>
			<guid isPermaLink="false">5139@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Suryakant,&#60;/p&#62;
&#60;p&#62;It is a problem of matrix size when you write :&#60;br /&#62;
&#60;pre&#62;&#60;code&#62;imput_signal = (source_strength./(medium.sound_speed*medium.density)).*input_signal;&#60;/code&#62;&#60;/pre&#62;
&#60;p&#62;First of all, you should use .* instead of * to multiply term by therm the density and the sound speed... but I don't exactly get what you are trying to do (I am not familiar with the use of the transducer class): if the input signal is the same at every point of your transducer, should'nt you set your source term as a matrix of size [1,Nt] (or [Nt,1], I don't remember), with Nt the number of time steps?&#60;br /&#62;
If the signal is different at every point of your transducer (phased array for example), I guess your source term should be of size [Ntr,Nt] (or [Nt, Ntr], I don't remember), with Ntr the number of points in your transducer. &#60;/p&#62;
&#60;p&#62;Your definition of the transducer does not seem correct. Once again I am not familiar with the transducer class as I do everything manually but look at the help of the function &#60;code&#62;makeTransducer&#60;/code&#62; to define its properties. I am not sure you are allowed to manually set &#60;code&#62;transducer.number_elements&#60;/code&#62; and the other properties directly.&#60;/p&#62;
&#60;p&#62;You can probably find the other examples helpful too. &#60;/p&#62;
&#60;p&#62;Good luck :-)&#60;br /&#62;
Anthony&#60;/p&#62;
&#60;p&#62;PS: by the way, you have a little typo in your code : &#34;imput_signal&#34; instead of &#34;input_signal&#34;.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Suryakant on "Defining Ultrasound Transducer example"</title>
			<link>http://www.k-wave.org/forum/topic/defining-ultrasound-transducer-example#post-5137</link>
			<pubDate>Thu, 09 Jul 2015 19:48:25 +0000</pubDate>
			<dc:creator>Suryakant</dc:creator>
			<guid isPermaLink="false">5137@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;We tried running the aforementioned example however we were getting a few errors&#60;br /&#62;
The first error being that it says &#34;error using *&#34; in the following&#60;br /&#62;
input_signal = (source_strength./(medium.sound_speed*medium.density)).*inputsignal&#60;/p&#62;
&#60;p&#62;Can anyone please help us on how to correct this error &#60;/p&#62;
&#60;p&#62;% defining an ultrasound sognle frequency toneburst&#60;br /&#62;
sample_frequency =20000000;&#60;/p&#62;
&#60;p&#62;signal_frequency =1000000;&#60;br /&#62;
num_cycles = 10;&#60;/p&#62;
&#60;p&#62;Nx =128;&#60;br /&#62;
Ny =128;&#60;br /&#62;
Nz =128;&#60;br /&#62;
dx = .00001;&#60;br /&#62;
dy = .00001;&#60;br /&#62;
dz = .00001;&#60;br /&#62;
kgrid = makeGrid(Nx,dx,Ny,dy,Nz,dz);&#60;br /&#62;
kgrid.t_array = makeTime(kgrid,1500);&#60;br /&#62;
 medium.sound_speed =1500*ones(Nx,Ny,Nz);&#60;br /&#62;
 medium.sound_speed(1:Nx/2,:,:)=1800;&#60;br /&#62;
 medium.density =1000*ones(Nx,Ny,Nz);&#60;/p&#62;
&#60;p&#62; medium.density(:,Ny/4:end, :)=1200;&#60;br /&#62;
 signal = toneBurst(sample_frequency,signal_frequency,num_cycles);&#60;br /&#62;
 toneBurst(sample_frequency,signal_frequency,num_cycles,'Plot',true);&#60;br /&#62;
 source_strength = 1*10^6;&#60;br /&#62;
 tone_burst_freq = .5*10^6;&#60;br /&#62;
 tone_burst_cycles = 5;&#60;br /&#62;
 input_signal = toneBurst(1/kgrid.dt,tone_burst_freq,tone_burst_cycles);&#60;br /&#62;
 imput_signal = (source_strength./(medium.sound_speed*medium.density)).*input_signal;&#60;br /&#62;
 transducer.number_elements = 64;&#60;br /&#62;
 transducer.element_width =1 ;&#60;br /&#62;
 transducer.element_length = 12;&#60;br /&#62;
 transducer.element_spacing = 0;&#60;br /&#62;
 transducer.radius = inf;&#60;/p&#62;
&#60;p&#62; transducer_width = transducer.number_elements*transducer.element_width + (transducer.number_elements -1)*transducer.element_spacing;&#60;br /&#62;
 transducer.position = round([1,32-transducer_width/2,32-transducer.element_length/2]);&#60;br /&#62;
 transducer.sound_speed = 1540;&#60;br /&#62;
 transducer.focus_distance = 20*10^-3;&#60;br /&#62;
 transducer.elevation_focus_distance = 19*10^-3;&#60;br /&#62;
 transducer.steering_angle = 0;&#60;br /&#62;
 transducer.transmit_apodization = 'Rectangular';&#60;br /&#62;
 transducer.receive_apodization = 'Rectangular';&#60;br /&#62;
 transducer.active_elements = zeros(transducer.number_elements,1);&#60;br /&#62;
 transducer.active_elements(21:52) = 1;&#60;br /&#62;
 transducer.input_signal = input_signal;&#60;br /&#62;
 transducer = makeTransducer(kgrid,transducer);&#60;br /&#62;
 [sensor_data] = kspaceFirstOrder3D(kgrid,medium,transducer, sensor,input_args{:});
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
