Texas Instruments | The Built-In AGC Function in TSC2100/2101 & TLV320AIC26/28/32/33 Devices | Application notes | Texas Instruments The Built-In AGC Function in TSC2100/2101 & TLV320AIC26/28/32/33 Devices Application notes

Texas Instruments The Built-In AGC Function in TSC2100/2101 & TLV320AIC26/28/32/33 Devices Application notes
Application Report
SLAA260 – September 2005
The Built-In AGC Function in TSC2100/01 and
TLV320AIC26/28/32/33 Devices
Wendy Fang and Nitesh Kekre ............................................................................................ DAP Group
ABSTRACT
Applying the built-in AGC function requires initializing or setting up a group of
corresponding control registers inside the TSC2100/01 and TLV320AIC26/28/32/33
devices. This application report describes how to set up the AGC properly and provides
examples.
1
2
3
4
5
Contents
Introduction ..........................................................................................
AGC Variables ......................................................................................
AGC Settings and Status ..........................................................................
Application Examples ..............................................................................
References ..........................................................................................
1
2
4
6
7
List of Figures
1
2
AGC Function ....................................................................................... 2
AGC Hysteresis ..................................................................................... 3
List of Tables
1
1
2
3
4
AGC Variables Description ........................................................................
TSC2100 or AIC26 AGC Variable Values and Locations .....................................
TSC2101 or AIC28 AGC Variable Values and Locations .....................................
AIC32 or AIC33 AGC Variable Values and Locations .........................................
5
AGC Control and Status ........................................................................... 5
2
4
4
4
Introduction
One or more automatic gain control (AGC) modules are built into the analog input circuitry of a touch
screen controller (TSC) with audio codec devices, such as the TSC2100 and TSC2101, or an audio codec
device, such as TLV320AIC26 (AIC26 for short) and TLV320AIC33 (or AIC33), to help users to improve
audio recording performance under certain applications and environments.
An AGC is a smart programmable gain amplifier (PGA) in which the input signal, corresponding to its
amplitude or volume, is automatically adjusted in a specified manner. The AGC is useful where the audio
input volume changes dynamically and frequently so that any manual or linear PGA cannot provide proper
gain. As an example, during a teleconference, because some people sit near the microphone and some
farther away, the voice signal to the microphone may be too weak or too strong; thus, any non-automatic
PGA can delivery only poor recording results. An AGC, on the other hand, can automatically adjust the
gain, as shown in Figure 1 (see the Reference section of this application report), so that the signal is
maintained at a certain nominal constant level (called target gain) over a changing range of real-world
conditions.
SLAA260 – September 2005
The Built-In AGC Function in TSC2100/01 and TLV320AIC26/28/32/33 Devices
1
www.ti.com
AGC Variables
Figure 1. AGC Function
Using the AGC function on a TI device involves the initialization or configuration of a group of control
registers, through the device’s SPI or I2C interface and by software. This application report provides a
detailed explanation and setup examples for using the built-in AGC on TI devices TSC2100, TSC2101,
AIC26, AIC28, AIC32, or AIC33.
2
AGC Variables
Usually, an AGC module or algorithm includes a set of variables or parameters, such as that shown in
Table 1. These variables make it possible for the AGC to be used in many different applications and
situations.
Table 1. AGC Variables Description
AGC VARIABLE
AGC Gain
Target Gain
FUNCTION/DESCRIPTION
The desired nominal output level or gain, at which the AGC attempts to maintain the output
signal level. See Figure 1.
Target gain is defined relative to the full scale (0 dB) of the ADC range and thus it can be,
for example, –8 dB or –20 dB.
Or:
Time taken by the output signal average to decay down to the Target Gain level when the
input signal increased.
Transient/
Dynamic
Variables
Attack Time
When the input signal becomes larger, attack time defines the length of the transient time (a
delay time in milliseconds or ms) for the output signal to reach the target gain. See Figure 1.
Or:
Time taken by the output signal average to decay down to the Target Gain level when the
input signal increased.
Decay Time
When the input signal becomes weaker, decay time defines the length of the transient time
(a delay time in milliseconds or ms) for the output to reach the target gain. See Figure 1.
Or:
Time taken by the output signal average to increase to the Target Gain level when the input
signal decreased.
2
The Built-In AGC Function in TSC2100/01 and TLV320AIC26/28/32/33 Devices
SLAA260 – September 2005
www.ti.com
AGC Variables
Table 1. AGC Variables Description (continued)
AGC VARIABLE
Noise-Related
Variables
FUNCTION/DESCRIPTION
Noise Threshold
A level or threshold for AGC to distinguish noise from a small signal, so that noise lower
than the threshold cannot be amplified. For the AGC, a signal lower than the noise threshold
is considered as noise, and a signal higher than the noise threshold it considered to be the
signal or normal.
Maximum Gain
Applicable
The level or limitation of the AGC gain, applicable to the input signal, in those cases in
which, if noise is louder than the noise threshold, that noise can be restricted to the
maximum gain.
Hysteresis
The hysteresis around the noise threshold to avoid the AGC gain from cycling between high
gain and no gain (0 dB) when the input signal is around the noise threshold.
Normal-to-Silence The debounce/delay time for AGC gain to change from normal (high gain) to silence (0 dB)
Debounce Time
after the audio input signal became lower than the noise threshold minus hysteresis.
Silence-to-Normal The debounce/delay time for AGC gain to change from 0 dB (silence) to high gain (normal)
Debounce Time
after the audio input signal became higher than the noise threshold plus hysteresis.
Note the following characteristics of the AGC in device TSC2100, TSC2101, AIC26, AIC28, AIC32 or
AIC33:
• The AGC uses an absolute average of the signals for calculating the algorithm.
• When the absolute average of the input signal becomes lower than the noise threshold, the AGC
reduces the gain to 0 dB in the soft stepping of 0.5 dB every FS.
• The AGC hysteresis is illustrated in Figure 2.
Input Signal
Absolute Average
Normal
Hysteresis Setting
Noise Threshold
Hysteresis Setting
Silent
Figure 2. AGC Hysteresis
Experience and trade-offs may be needed when selecting the values of the variables in Table 1. For
example, if the noise threshold selected is too low, the larger noise may be picked up and amplified with a
large gain; on the other hand, if the noise threshold selected is set too high, the weaker signal may be
considered by the AGC as noise and fail to be amplified. Similarly, if the maximum gain applicable variable
is kept too high, then any noise which is above the noise threshold may become gained by a large amount
and create a noisy output; but if it is kept too low, normal speech signals may not be gained up enough to
reach the target gain level at the output.
The selection of the AGC variables depend greatly on practical application and environment. Some
variables become more important under certain conditions. For example, if the input signal is often
hovering around the noise threshold, hysteresis and debounce time become critical.
SLAA260 – September 2005
The Built-In AGC Function in TSC2100/01 and TLV320AIC26/28/32/33 Devices
3
www.ti.com
AGC Settings and Status
3
AGC Settings and Status
In the TSC2100, TSC2101, AIC26, AIC28, AIC32, or AIC33 device, control registers are located in the
internal memory-mapped pages. The built-in AGC variables or parameters, as given in Table 1, should be
initialized and configured by writing to the corresponding control registers. Table 2, Table 3, and Table 4
list the applicable values of AGC variables in these TI devices, including the bit locations inside the
devices’ control registers.
Table 2. TSC2100 or AIC26 AGC Variable Values and Locations
AGC VARIABLE
APPLICABLE VALUES
LOCATIONS
Target Gain (dB)
– 5.5 , –8, –10, –12, –14, –17, –20, –24
Page2/Reg01H/D7 ~ D5
Attack Time (ms)
8, 11, 16, 20
Page2/Reg01H/D4 ~ D1
Decay Time (ms)
100, 200, 400, 500
Noise Threshold (dB)
– 60, –70, –80, –90
Page2/Reg06H/D5 ~ D4
Maximum Gain Applicable (1)
From 0 dB to +59.5 dB with resolution of 0.5 dB
Page2/Reg1EH/D15 ~ D9
Hysteresis (dB)
0, 1, 2, 4
Page2/Reg1DH/D10 ~ D9
Normal-to-Silence
Debounce Time (ms)
0, 0.5, 1, 2, 4, 8, 16, 32
Page2/Reg1EH/D8 ~ D6
Silence-to-Normal
Debounce Time (ms)
0, 0.5, 1, 2, 4, 8, 16, 32
Page2/Reg1EH/D5 ~ D3
(1)
When the AGC Noise Threshold variable is set to be less than or equal to –70 dB, the Maximum Gain Applicable variable must
be set as greater than or equal to –Noise Threshold –58.5 dB.
Table 3. TSC2101 or AIC28 AGC Variable Values and Locations
AGC VARIABLE
APPLICABLE VALUES
LOCATIONS
HEADSET INPUT
HANDSET INPUT
CELL-PHONE INPUT
Target Gain (dB)
–5.5, –8, –10, –12, –14 , –17, –20, –24
Page2/Reg01H/ D7 ~ D5
Page2/Reg1EH/ D7 ~ D5
Page2/Reg24H/ D7 ~ D5
Attack Time (ms)
8, 11, 16, 20
Page2/Reg01H/ D4 ~ D1
Page2/Reg1EH/ D4 ~ D1
Page2/Reg24H/ D4 ~ D1
Decay Time (ms)
100, 200, 400, 500
Noise Threshold
30 dB to –90 dB with resolution of 10
dB (1)
Page2/Reg24H/D13 ~ D11
Maximum Gain Ap- From 0 dB to +59.5 dB with resolution of
plicable (2)
0.5 dB
Page2/Reg26H/D15 ~ D9
Page2/Reg27H/ D15 ~ D9
Hysteresis (dB)
No Hysteresis (= 0), 1, 2, 4
Page2/Reg1DH/D10 ~ D9
Page2/Reg24H/ D10 ~ D9
Normal-to-Silence
Debounce Time
(ms)
0, 0.5, 1, 2, 4, 8, 16, 32
Page2/Reg26H/D8 ~ D6
Page2/Reg27H/ D8 ~ D6
Silence-to-Normal
Debounce Time
(ms)
0, 0.5, 1, 2, 4, 8, 16, 32
Page2/Reg26H/D5 ~ D3
Page2/Reg27H/ D5 ~ D3
(1)
(2)
Noise Threshold applicable values do not include –70, –80 and –90 for cell-phone input.
When the AGC Noise Threshold variable is set to be less than or equal to –70 dB, the Maximum Gain Applicable variable must
be set as greater than or equal to –Noise Threshold –58.5 dB.
Table 4. AIC32 or AIC33 AGC Variable Values and Locations
AGC VARIABLE
APPLICABLE VALUES
LOCATIONS
LEFT AGC
4
RIGHT AGC
Target Gain (dB)
– 5.5, –8, –10, –12, –14, –17, –20, –24
Page0/ Reg26/D6 ~ D4
Page0/Reg29/D6 ~ D4
Attack Time (ms)
8, 11, 16, 20
Page0/Reg26/D3 ~ D2
Page0/Reg29/D3 ~ D2
Decay Time (ms)
100, 200, 400, 500
Page0/Reg26/D1 ~ D0
Page0/Reg29/D1 ~ D0
The Built-In AGC Function in TSC2100/01 and TLV320AIC26/28/32/33 Devices
SLAA260 – September 2005
www.ti.com
AGC Settings and Status
Table 4. AIC32 or AIC33 AGC Variable Values and Locations (continued)
AGC VARIABLE
APPLICABLE VALUES
LOCATIONS
LEFT AGC
RIGHT AGC
Noise Threshold
– 30 dB to –90 dB with resolution of 2 dB
Page0/Reg28/D5 ~ D1
Page0/Reg31/D5 ~ D1
Maximum Gain
Applicable (1)
From 0 dB to +59.5 dB with resolution of 0.5 dB
Page0/Reg27/D7 ~ D1
Page0/Reg30/D7 ~ D1
Hysteresis (dB)
No Hysteresis (= 0), 1, 2, 3
Page0/Reg28/D7 ~ D6
Page0/Reg31/D7 ~ D6
Normal-to-Silence 0, 0.5, 1, 2, 4, 8, 16, 32, 64, 64*2 , 64*3 , …, … 64*23,
Debounce Time
64*24
(ms)
Page0/Reg34/D7 ~ D3
Page0/Reg35/D7 ~ D3
Silence-to-Normal 0, 0.5, 1, 2, 4, 8, 16, 32
Debounce Time
Page0/Reg34/D2 ~ D0
Page0/Reg35/D2 ~ D0
(1)
When the AGC Noise Threshold variable is set to be less than or equal to –70 dBm, the Maximum Gain Applicable variable
must be set as greater than or equal to –Noise Threshold –58.5 dB.
In addition to the AGC variables listed in Table 1 through Table 4, Table 5 also lists several control and
status bits designed for AGC use.
Table 5. AGC Control and Status
AGC CONTROL/STATUS
Control
AGC Enable
DEFINITION
Enable (= 1) or disable (= 0) the AGC function
LOCATION
– TSC2100/AIC26:
Page2/Reg01H/D0
– TSC2101/AIC28:
headset: Page2/Reg01H/D0
handset: Page2/Reg1EH/D0
cell-In: Page2/Reg24H/D0
– AIC32/AIC33:
left: Page0/Reg26/D7
right: Page0/Reg29/D7
Clip-Stepping Enable
Enable (= 1) or disable (= 0) Clip stepping. Clip
– TSC2100/AIC26:
stepping is, when ADC is saturated, the AGC reduces
Page2/Reg06H/D3
the gain 0.5 dB per frame until the ADC is not
– TSC2101/AIC28:
saturated. (Not recommended for normal usage because it tries to break the AGC loop.)
head/handset: Page2/Reg06H/D3
cell-In: Page2/Reg24H/D8
– AIC32/AIC33:
left: Page0/Reg28/D0
right: Page0/Reg31/D0
SLAA260 – September 2005
The Built-In AGC Function in TSC2100/01 and TLV320AIC26/28/32/33 Devices
5
www.ti.com
Application Examples
Table 5. AGC Control and Status (continued)
AGC CONTROL/STATUS
Status
Actual Gain Applied by AGC
DEFINITION
The actual gain AGC applied on the input signal,
which is from -12 dB to +59.5 dB (from -34.5 dB to
+12 dB for cell-in on TSC2101/AIC28 device) with the
resolution of 0.5 dB.
LOCATION
– TSC2100/AIC26:
Page2/Reg01H/D15~D8
– TSC2101/AIC28:
headset: Page2/Reg01H/D15~D8
handset: Page2/Reg1EH/D15~D8
cell-In: Page2/Reg1FH/D14~D8
– AIC32/AIC33:
left: Page0/Reg32
right: Page0/Reg33
Noise Threshold
Flag
Indicating input signal lower (= 1) or higher (= 0) than
Noise Threshold. Note that this flag is generated
when the input signal is lower than Noise Threshold
minus Hysteresis for a period of time given by
Noise-to-Silence debounce time. The flag is reset
when the input signal is higher than Noise Threshold
plus Hysteresis for a period of time given by
Silence-to-Normal Debounce time.
– TSC2100/AIC26:
Page2/Reg04H/D11
– TSC2101/AIC28:
head/handset: Page2/Reg04H/D11
cell-In: Page2/Reg24H/D14
– AIC32/AIC33:
left: Page0/Reg36/D5
right: Page0/Reg36/D1
Saturation Flag
Indicating that the AGC output is saturated (= 1) or
not saturated (= 0) on the ADC full scale. Note that
when this flag = 1, this indicates that the AGC cannot
further gain up the input signal even if the output
signal has not reached the target gain.
– TSC2100/AIC26:
Page2/Reg04H/D0
– TSC2101/AIC28:
head/handset: Page2/Reg04H/D0
cell-In: Page2/Reg1FH/D7
– AIC32/AIC33:
left: Page0/Reg36/D4
right: Page0/Reg36/D0
4
Application Examples
Three examples for the AGC setup follow. Example 1 can be used as a starting point for an application
where the noise is small compared to the input signal amplitude. Example 2 may be more suitable as the
starting point for a condition where noise is relatively large. Example 3 can be used as the starting point in
general.
4.1
Example 1
1.
2.
3.
4.
5.
6.
7.
Target gain = –5.5 dB
Attack time = 20 ms and decay time = 500 ms
Noise threshold = –90 dB
Maximum gain applicable = 50 dB
Hysteresis disabled.
Debounce time from normal to silence = 0 ms
Debounce time from silence to normal = 0 ms
Note that with Example 1 settings, the background noise may become considerable when noise is beyond
the noise threshold because the maximum gain applicable is higher (+50 dB) and thus big noise may get
gained up with high gain.
6
The Built-In AGC Function in TSC2100/01 and TLV320AIC26/28/32/33 Devices
SLAA260 – September 2005
www.ti.com
References
4.2
Example 2
1.
2.
3.
4.
5.
6.
7.
Target gain = –10 dB
Attack time = 20 ms and decay time = 500 ms
Noise threshold = –90 dB
Maximum gain applicable= 40 dB
Hysteresis = 2 dB
Debounce time from normal to silence = 2 ms
Debounce time from silence to normal = 0 ms.
Note that the Example 2 settings, even though the noise is above the noise threshold, will not be as much
gain as in Example 1; the AGC output gain has also been reduced due to the smaller maximum gain
applicable.
4.3
Example 3
1.
2.
3.
4.
5.
6.
7.
5
Target gain = –5.5 dB
Attack time = 8 ms and decay time = 500 ms
Noise threshold = –90 dB
Maximum gain applicable= 59.5 dB
Hysteresis = 2 dB
Debounce time from normal to silence = 0 ms
Debounce time from silence to normal = 0 ms
Without speech or signal, decrease the Maximum Gain Applicable variable to have an acceptable level
of amplified noise. Next, with the lowest speech or signal source, increase the Noise Threshold
variable to a level so that the weak signal can be detected and gained. Then, increase the attack time
if the speech initially sounds bad; decrease the decay time if the speech sounds too noisy for too long
at the end.
References
1. TSC2100, Programmable Touch Screen Controller With Integrated Stereo Audio Codec and
Headphone/Speaker Amplifier data sheet (SLAS378)
2. TSC2101, Audio Codec With Integrated Headphone, Speaker Amplifier and Touch Screen Controller
data sheet (SLAS392)
3. TLV320AIC26, Low Power Stereo Audio Codec With Headphone/Speaker Amplifier and 12-Bit
Battery/Temperature/Auxiliary ADC data sheet (SLAS412)
4. TLV320AIC28, Stereo Audio Codec With Integrated Headphone and Speaker Amplifiers data sheet
(SLAS418)
5. TLV320AIC32, Low Power Stereo Audio Codec for Portable Audio/Telephony data sheet (SLAS479)
6. TLV320AIC33, Low Power Stereo Audio Codec for Portable Audio/Telephony data sheet (SLAS480)
SLAA260 – September 2005
The Built-In AGC Function in TSC2100/01 and TLV320AIC26/28/32/33 Devices
7
IMPORTANT NOTICE
Texas Instruments Incorporated and its subsidiaries (TI) reserve the right to make corrections, modifications,
enhancements, improvements, and other changes to its products and services at any time and to discontinue
any product or service without notice. Customers should obtain the latest relevant information before placing
orders and should verify that such information is current and complete. All products are sold subject to TI’s terms
and conditions of sale supplied at the time of order acknowledgment.
TI warrants performance of its hardware products to the specifications applicable at the time of sale in
accordance with TI’s standard warranty. Testing and other quality control techniques are used to the extent TI
deems necessary to support this warranty. Except where mandated by government requirements, testing of all
parameters of each product is not necessarily performed.
TI assumes no liability for applications assistance or customer product design. Customers are responsible for
their products and applications using TI components. To minimize the risks associated with customer products
and applications, customers should provide adequate design and operating safeguards.
TI does not warrant or represent that any license, either express or implied, is granted under any TI patent right,
copyright, mask work right, or other TI intellectual property right relating to any combination, machine, or process
in which TI products or services are used. Information published by TI regarding third-party products or services
does not constitute a license from TI to use such products or services or a warranty or endorsement thereof.
Use of such information may require a license from a third party under the patents or other intellectual property
of the third party, or a license from TI under the patents or other intellectual property of TI.
Reproduction of information in TI data books or data sheets is permissible only if reproduction is without
alteration and is accompanied by all associated warranties, conditions, limitations, and notices. Reproduction
of this information with alteration is an unfair and deceptive business practice. TI is not responsible or liable for
such altered documentation.
Resale of TI products or services with statements different from or beyond the parameters stated by TI for that
product or service voids all express and any implied warranties for the associated TI product or service and
is an unfair and deceptive business practice. TI is not responsible or liable for any such statements.
Following are URLs where you can obtain information on other Texas Instruments products and application
solutions:
Products
Applications
Amplifiers
amplifier.ti.com
Audio
www.ti.com/audio
Data Converters
dataconverter.ti.com
Automotive
www.ti.com/automotive
DSP
dsp.ti.com
Broadband
www.ti.com/broadband
Interface
interface.ti.com
Digital Control
www.ti.com/digitalcontrol
Logic
logic.ti.com
Military
www.ti.com/military
Power Mgmt
power.ti.com
Optical Networking
www.ti.com/opticalnetwork
Microcontrollers
microcontroller.ti.com
Security
www.ti.com/security
Telephony
www.ti.com/telephony
Video & Imaging
www.ti.com/video
Wireless
www.ti.com/wireless
Mailing Address:
Texas Instruments
Post Office Box 655303 Dallas, Texas 75265
Copyright  2005, Texas Instruments Incorporated
Was this manual useful for you? yes no
Thank you for your participation!

* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project

Download PDF

advertising