<?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: TGC in B-Mode Example Script</title>
		<link>http://www.k-wave.org/forum/topic/tgc-in-b-mode-example-script</link>
		<description>Support for the k-Wave MATLAB toolbox</description>
		<language>en-US</language>
		<pubDate>Wed, 13 May 2026 01:49:26 +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/tgc-in-b-mode-example-script" rel="self" type="application/rss+xml" />

		<item>
			<title>Bradley Treeby on "TGC in B-Mode Example Script"</title>
			<link>http://www.k-wave.org/forum/topic/tgc-in-b-mode-example-script#post-8252</link>
			<pubDate>Wed, 21 Jul 2021 15:59:52 +0000</pubDate>
			<dc:creator>Bradley Treeby</dc:creator>
			<guid isPermaLink="false">8252@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi Neo,&#60;/p&#62;
&#60;p&#62;Yes, the factor of 2 in the k-Wave example is to account for the round trip to a depth of r. You can think of it as calculating the correct distance the wave has travelled, rather than a correction to the attenuation factor.&#60;/p&#62;
&#60;p&#62;Brad.
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Neo on "TGC in B-Mode Example Script"</title>
			<link>http://www.k-wave.org/forum/topic/tgc-in-b-mode-example-script#post-8159</link>
			<pubDate>Wed, 26 May 2021 18:43:24 +0000</pubDate>
			<dc:creator>Neo</dc:creator>
			<guid isPermaLink="false">8159@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;I can't edit my post, so I have to write another answer....&#60;br /&#62;
In my second post the factor &#60;code&#62;r&#60;/code&#62; is missing in both &#60;code&#62;tgc&#60;/code&#62; equations.&#60;/p&#62;
&#60;p&#62;I had an error in my code, the TGC with factor 2 as written in the example now works better than my proposed TGC. &#60;/p&#62;
&#60;p&#62;Do we have to include the additional factor 2 because &#60;code&#62;alpha_coeff&#60;/code&#62; is the &#34;one-way&#34; attenuation? If we measure the signal arriving from a depth &#60;code&#62;r&#60;/code&#62; with a transducer, do we have to use the &#34;two-way&#34; attenuation &#60;code&#62;2*alpha_coeff&#60;/code&#62;?
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Neo on "TGC in B-Mode Example Script"</title>
			<link>http://www.k-wave.org/forum/topic/tgc-in-b-mode-example-script#post-8158</link>
			<pubDate>Wed, 26 May 2021 12:48:37 +0000</pubDate>
			<dc:creator>Neo</dc:creator>
			<guid isPermaLink="false">8158@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;To make things easier... Here is the complete code that I refer to in the &#34;Simulating B-mode Ultrasound Images&#34; example:&#60;br /&#62;
&#60;code&#62;t0 = length(input_signal)*kgrid.dt/2;&#60;/code&#62;&#60;br /&#62;
&#60;code&#62;r = c0 * ( (1:length(kgrid.t_array)) * kgrid.dt / 2 -t0);&#60;/code&#62;&#60;br /&#62;
&#60;code&#62;tgc_alpha_db_cm = medium.alpha_coeff * (tone_burst_freq * 1e-6)^medium.alpha_power;&#60;/code&#62;&#60;br /&#62;
&#60;code&#62;tgc_alpha_np_m = tgc_alpha_db_cm / 8.686 * 100;&#60;/code&#62;&#60;br /&#62;
&#60;code&#62;tgc = exp(tgc_alpha_np_m * 2 * r);&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;If we substitute everything the tgc would then be defined as&#60;br /&#62;
&#60;code&#62;tgc = exp((1/4.343)*alpha_coeff*100*(f/1MHz)^alpha_power)&#60;/code&#62;&#60;br /&#62;
instead of&#60;br /&#62;
&#60;code&#62;tgc = exp((1/2)*(1/4.343)*alpha_coeff*100*(f/1MHz)^alpha_power)&#60;/code&#62;
&#60;/p&#62;</description>
		</item>
		<item>
			<title>Neo on "TGC in B-Mode Example Script"</title>
			<link>http://www.k-wave.org/forum/topic/tgc-in-b-mode-example-script#post-8157</link>
			<pubDate>Wed, 26 May 2021 12:42:36 +0000</pubDate>
			<dc:creator>Neo</dc:creator>
			<guid isPermaLink="false">8157@http://www.k-wave.org/forum/</guid>
			<description>&#60;p&#62;Hi,&#60;br /&#62;
I would like to discuss the time gain compensation that is presented in the Example &#34;Simulating B-mode Ultrasound Images&#34;. I saw that you corrected/modified the time gain compensation in the last release and you added the convertion of the tgc alpha from dB to Np. Is it possible that there is still a mistake in the tgc calculation?&#60;br /&#62;
I think that the factor 2 in&#60;br /&#62;
&#60;code&#62;tgc = exp(tgc_alpha_np_m * 2 * r)&#60;/code&#62;&#60;br /&#62;
is not correct. Angelsen writes in his book &#34;Ultrasound Imaging Waves Signals and Signal Processing (Vol I)&#34; that the attenuation in dB is defined as&#60;br /&#62;
&#60;code&#62;alpha_dB = (1/r)*10log(I0/I(r))&#60;/code&#62;&#60;br /&#62;
where &#60;code&#62;I0&#60;/code&#62; is the intensity in the incident wave and &#60;code&#62;I(r)&#60;/code&#62; is the intensity at depth &#60;code&#62;r&#60;/code&#62;.&#60;br /&#62;
The intensity at depth &#60;code&#62;r&#60;/code&#62; is then again:&#60;br /&#62;
&#60;code&#62;I(r) = I0*exp(-µ(f)*r)&#60;/code&#62;&#60;br /&#62;
where &#60;code&#62;µ(f)&#60;/code&#62; is the intensity absorption coefficient: &#60;code&#62;µ(f)=A*(f/f1)^m&#60;/code&#62; with &#60;code&#62;A&#60;/code&#62; in Np/length element and &#60;code&#62;m&#60;/code&#62; beeing the equivalent to alpha_power in k-Wave.&#60;br /&#62;
For pressure we can use the amplitude absorption coefficient &#60;code&#62;k(f)&#60;/code&#62;:&#60;br /&#62;
&#60;code&#62;p(r) = p0*exp(-k(f)*r)&#60;/code&#62;&#60;br /&#62;
where &#60;code&#62;p0&#60;/code&#62; is the pressure amplitude at &#60;code&#62;r=0&#60;/code&#62; and &#60;code&#62;p(r)&#60;/code&#62; is the pressure at depth &#60;code&#62;r&#60;/code&#62;.&#60;/p&#62;
&#60;p&#62;Since the intensity is the square of the amplitude we can see that &#60;code&#62;µ(f)=2k(f)&#60;/code&#62;&#60;br /&#62;
and we can calculate the attenuation in dB as:&#60;br /&#62;
&#60;code&#62;alpha_dB = (1/r)*10log(I0/I(r)) = (1/r)*20log(p0/p(r)) = 4.34*A*(f/f1)^m&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;We can rewrite the equation of &#60;code&#62;p(r)&#60;/code&#62; as:&#60;br /&#62;
&#60;code&#62;p(r) = p0*exp(-k(f)*r) = p0*exp(-(1/2)*µ(f)*r) = p0*exp(-(1/2)*A*(f/f1)^m*r)&#60;/code&#62;&#60;br /&#62;
with &#60;code&#62;A&#60;/code&#62; in units of Neper. If we want to insert &#60;code&#62;alpha_coeff&#60;/code&#62; in dB we have to write:&#60;br /&#62;
&#60;code&#62;p(r) = p0*exp(-(1/2)*(1/4.34)*alpha_coeff*100*(f/1MHz)^m*r)&#60;/code&#62;&#60;br /&#62;
(with [alpha_coeff]=dB/(cmMHz))&#60;/p&#62;
&#60;p&#62;Thus the TGC has to be:&#60;br /&#62;
&#60;code&#62;tgc = exp(+(1/2)*(1/4.34)*alpha_coeff*100*(f/1MHz)^m*r)&#60;/code&#62;&#60;/p&#62;
&#60;p&#62;This equals &#60;code&#62;tgc = exp(tgc_alpha_np_m * 2 * r)&#60;/code&#62; as it is written in the example except for the factor 2. I think the correct code is &#60;code&#62;tgc = exp(tgc_alpha_np_m * r)&#60;/code&#62; without factor 2.&#60;/p&#62;
&#60;p&#62;A test of both TGCs also shows that Time Gain Compensation without the factor of 2 provides better results.
&#60;/p&#62;</description>
		</item>

	</channel>
</rss>
