Gain Engine

This gives a brief overview of the gain systems within the Ultrasonix engine.

Analog TGC

There are 4 parameters that adjust the TGC in the Ultrasonix engine.


 * TGC Analog (B)
 * This is the system gain curve that is used, assuming the parameters below are not applied.
 * TGC Max
 * This is a curve that ensures that the analog gain does not go beyond a certain limit. This is useful in removing saturations that can occur by overgaining, especially in the near-field.
 * User TGC
 * This is the slider control on the console that can also be programmed through software.
 * Gain (B)
 * This parameter is the overall offset that adjusts the TGC curve.
 * Gn Curve Depth (B)
 * This is the maximum depth that the gain curve is applied to. At greater depths the image is adjusted to the last point in the curve.

Internally, the gain range is from 0 to 3000. The parameters described above work together to create a table of a certain length, where each point is within the gain range. The TGC Analog (B) parameter is the starting point, this is a UTX_CURVE variable, and its values are interpolated to be within the gain range. The number of vertical values depends on the Gn Curve Depth (B) parameter. The User TGC sliders range from 0 to 255, with an output range from -500 to 500 (programmable internally), this parameter, along with the Gain (B) general offset parameter get applied to the gain table created from the TGC Analog (B) parameter.

Here is some pseudo code for programming the gainTable: numpoints = calculate from Gn Curve Depth (B) tgcA = Interpolate TGC Analog (B) curve to gain range within numpoints tgcU = Interpolate User TGC to user range within numpoints

for(i = 0 to numpoints) {   gainTable[i] = tgcA[i] + tgcU[i] + genOffset check min and max on gainTable[i] }

load gainTable to hardware

Lateral Gain Curve

The lateral gain curve is applied across the image in a digital manner. It does not program the analog components, but rather applies an offset to an entire line of data once it arrives on the FPGA. The range of this parameter is 0 to 2000 (programmable internally), and on-screen, is represented as the curve for half of the image, the other half is mirrored symmetrically in the computations. The name of the parameter is TGC Lateral, and it is a UTX_CURVE variable.