Hi,
I would like to discuss the time gain compensation that is presented in the Example "Simulating B-mode Ultrasound Images". 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?
I think that the factor 2 in
tgc = exp(tgc_alpha_np_m * 2 * r)
is not correct. Angelsen writes in his book "Ultrasound Imaging Waves Signals and Signal Processing (Vol I)" that the attenuation in dB is defined as
alpha_dB = (1/r)*10log(I0/I(r))
where I0
is the intensity in the incident wave and I(r)
is the intensity at depth r
.
The intensity at depth r
is then again:
I(r) = I0*exp(-µ(f)*r)
where µ(f)
is the intensity absorption coefficient: µ(f)=A*(f/f1)^m
with A
in Np/length element and m
beeing the equivalent to alpha_power in k-Wave.
For pressure we can use the amplitude absorption coefficient k(f)
:
p(r) = p0*exp(-k(f)*r)
where p0
is the pressure amplitude at r=0
and p(r)
is the pressure at depth r
.
Since the intensity is the square of the amplitude we can see that µ(f)=2k(f)
and we can calculate the attenuation in dB as:
alpha_dB = (1/r)*10log(I0/I(r)) = (1/r)*20log(p0/p(r)) = 4.34*A*(f/f1)^m
We can rewrite the equation of p(r)
as:
p(r) = p0*exp(-k(f)*r) = p0*exp(-(1/2)*µ(f)*r) = p0*exp(-(1/2)*A*(f/f1)^m*r)
with A
in units of Neper. If we want to insert alpha_coeff
in dB we have to write:
p(r) = p0*exp(-(1/2)*(1/4.34)*alpha_coeff*100*(f/1MHz)^m*r)
(with [alpha_coeff]=dB/(cmMHz))
Thus the TGC has to be:
tgc = exp(+(1/2)*(1/4.34)*alpha_coeff*100*(f/1MHz)^m*r)
This equals tgc = exp(tgc_alpha_np_m * 2 * r)
as it is written in the example except for the factor 2. I think the correct code is tgc = exp(tgc_alpha_np_m * r)
without factor 2.
A test of both TGCs also shows that Time Gain Compensation without the factor of 2 provides better results.