TOBY-L2 Audio tuning - U-blox · TOBY-L2 series Audio tuning Application Note Abstract This...
Transcript of TOBY-L2 Audio tuning - U-blox · TOBY-L2 series Audio tuning Application Note Abstract This...
TOBY-L2 series Audio tuning Application Note
Abstract
This document provides information and procedures to perform the audio tuning in TOBY-L2 series modules. It gives some hints for a correct enclosure design. It describes the procedures for tuning the audio parameters for the whole audio system, the hands-free algorithm (echo cancellation, automatic gain
control, noise reduction) and the external audio management.
www.u-blox.com
UBX-15015834 - R01
TOBY-L2 series - Application Note
UBX-15015834 - R01
Page 2 of 39
Document Information
Title TOBY-L2 series
Subtitle Audio tuning
Document type Application Note
Document number UBX-15015834
Revision, date R01 03-May-2016
Document status Early Production Information
Document status explanation
Objective Specification Document contains target values. Revised and supplementary data will be published later.
Advance Information Document contains data based on early testing. Revised and supplementary data will be published later.
Early Production Information Document contains data from product verification. Revised and supplementary data may be published later.
Production Information Document contains the final product specification.
This document applies to the following products:
Product name
TOBY-L2
u-blox reserves all rights to this document and the information contained herein. Products, names, logos and designs described herein may in whole or in part be subject to intellectual property rights. Reproduction, use, modification or disclosure to third parties of this
document or any part thereof without the express permission of u-blox is strictly prohibited. The information contained herein is provided “as is” and u-blox assumes no liability for the use of the information. No warranty, either
express or implied, is given, including but not limited, with respect to the accuracy, correctness, reliability and fitness for a particular purpose of the information. This document may be revised by u-blox at any time. For most recent documents, please visit
www.u-blox.com. Copyright © 2016, u-blox AG
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information Contents
Page 3 of 39
Contents
Contents .............................................................................................................................. 3
1 Introduction .................................................................................................................. 5
2 Hints for LEM design .................................................................................................... 6
3 System gains tuning ..................................................................................................... 7
3.1 Step 1: defining maximum loudness of speaker (RLR) ........................................................................... 7
3.1.1 Procedure ...................................................................................................................................... 8
3.2 Step 2: define the maximum gain in uplink audio path (SLR) ................................................................ 8
3.2.1 Procedure ...................................................................................................................................... 8
3.3 Step 3: verify mic sensitivity .................................................................................................................. 9
3.3.1 Procedure ...................................................................................................................................... 9
3.4 Step 4: final check ................................................................................................................................ 9
4 EC algorithm and filters tuning ................................................................................. 10
4.1 Block diagram and tunable parameters ............................................................................................... 10
4.1.1 Microphone levels (ML) ............................................................................................................... 11
4.1.2 Echo Cancellation (EC) ................................................................................................................ 11
4.1.3 Residual Echo Suppression (RES) .................................................................................................. 13
4.1.4 Noise Suppression (NS) and Comfort Noise (CN) .......................................................................... 15
4.1.5 Low Pass Filter (LPF) ..................................................................................................................... 17
4.1.6 High Pass Filter (HPF) ................................................................................................................... 18
4.1.7 Equalizer (EQ) .............................................................................................................................. 19
4.1.8 Additional Gain Control (AGC) .................................................................................................... 21
4.1.9 Dynamic Range Compression (DRC) ............................................................................................ 23
4.1.10 Sidetone ...................................................................................................................................... 25
4.2 No-duplex configuration ..................................................................................................................... 26
5 Audio profiles management ...................................................................................... 27
5.1 Personal profiles ................................................................................................................................. 27
5.1.1 Managing personal profiles using m-center ................................................................................. 28
5.2 Factory-programmed profile ............................................................................................................... 28
6 Mobile Voice Tuning tool .......................................................................................... 29
7 External codec management ..................................................................................... 31
7.1 Setting ................................................................................................................................................ 32
7.2 External device configuration +UEXTDCONF ....................................................................................... 33
8 EVK suggested parameters ........................................................................................ 35
9 Supported speech codecs .......................................................................................... 36
Appendix .......................................................................................................................... 37
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information Contents
Page 4 of 39
A List of acronyms ......................................................................................................... 37
Related documents .......................................................................................................... 38
Revision history ................................................................................................................ 38
Contact .............................................................................................................................. 39
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information Introduction
Page 5 of 39
1 Introduction
The audio interface is supported by TOBY-L200-02S, TOBY-L210-02S, TOBY-L210-62S, TOBY-L220-02S and TOBY-L280-02S.
This document provides information and procedures to achieve the best audio performance in systems using TOBY-L2 series modules.
The audio performance of a device depends on a multiplicity of factors related to module, external circuitry and enclosure mechanical characteristics, too. Often these factors are in opposition and a good knowledge of them is needed to find out the best compromise that fulfills the specific needs.
The audio tuning starts with a good design of the LEM (Loudspeaker – Enclosure – Microphone) system. It is not the aim of the document to offer an exhaustive guide on this complex task, although it provides some information about the basic requirements.
The second step concerns the tuning of the gains in overall audio paths. This means that the gains related to all audio subsystems (both internal to the module and in external circuitry) must be adjusted in order to obtain clear, undistorted audio and comfortable volume levels.
Finally, it is possible to tune the hands-free algorithm to reduce possible echo.
For a detailed description of TOBY-L2 series module audio interface, see the TOBY-L2 series System Integration Manual[2].
The following symbols are used to highlight important information within the document:
An index finger points out key information pertaining to integration and performance.
A warning symbol indicates actions that could negatively impact or damage the module.
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information Hints for LEM design
Page 6 of 39
2 Hints for LEM design Acoustic echo is one of the most critical issues that afflict hands-free phones. It is a disturbance that occurs when the sound emitted by the loudspeaker is captured by microphone and sent back to the originating user (far-end device).
Its prevention starts with an accurate design for the LEM system: loudspeaker and microphone characteristics have to be carefully chosen and the enclosure has to be designed in order to reduce any possible coupling:
1. Direct Acoustic Coupling from outside 2. Direct Acoustic Coupling from inside 3. Mechanical Coupling
Figure 1: Possible causes of echo
Orient the microphone and speaker to reduce the amount of sound emitted by speaker and captured by microphone.
Place the microphone in a cavity (i.e. a compartment in the enclosure). The partitions delimiting the cavity should be designed to insulate acoustically microphone from speaker.. A rubber grommet has to be used to insulate the mic capsule from mechanical vibrations and to close any possible air gap between mic and the inside of enclosure.
Figure 2: Example of mic cavity design
The speaker does not have to be fixed directly to the enclosure, but a foam has to be placed between the sides of the enclosure to reduce vibrations than could propagate to the enclosure and then to the microphone.
13
2
Microphone
Loudspeaker
Enclosure
Outside Inside
Mic holeMic
Rubber
grommet
Enclosure
Foam for pressure
to push mic into
plastic housing
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information System gains tuning
Page 7 of 39
3 System gains tuning The echo canceller algorithm is based on the assumption that the LEM is linear and stable; if these conditions are not satisfied the echo cancellation will be ineffective. Therefore it is crucial to check the external components and remove any source of non linearity that includes:
1. variable gains 2. non linear processing, e.g. compressors on mic and loudspeaker amplifiers 3. distortions, e.g. due to saturations.
Figure 3: Typical audio setup of device under test (DUT)
Points 1 and 2 require an appropriate choice of components during the schematic design.
Distortions can be avoided by calibrating all the gains in both uplink and downlink audio paths. This task requires advanced test suites. The 3GPP TS 26131-32 specification defines standard procedure audio tests and characterization. Approximate tuning can be performed by following the simplified procedure described in next sections.
The procedure consists of different steps aiming to determine the gains for all the audio blocks which satisfy both project and HF requirements. Usually these factors are in opposition and a compromise should be accepted between:
speaker loudness
microphone sensitivity
no-distorted echo
3.1 Step 1: defining maximum loudness of speaker (RLR)
Receive Loudness Rating (RLR) is the signal loudness in receiving direction.
The first step in the gain calibration procedure is to define the gains in downlink path in order to achieve the requested speaker loudness on DUT side when a reference signal is played at the far-end of the device. The reference signal has to simulate the typical use case at the far-end side. It should be an artificial voice so that the test can be repeated.
Figure 4: Gains calibration - step 1
Device
Cellular
module
External
circuitry
DUT
Cellular module
Reference
signal
FarEnd
Signal to be
evaluated
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information System gains tuning
Page 8 of 39
3.1.1 Procedure
1. Set up a call and send a reference signal 2. Set the loudspeaker volume at max value (e.g. AT+CLVL=100)
The speaker volume control by the end user has to only act on +CLVL.
3. Tune the gains in the downlink audio path in order to achieve the requirements for speaker loudness, but avoiding any distortion. Properly distribute all audio gains among all audio blocks in downlink path: o AT+UAPT=8,<profile>,0,1,8,<rate>,<parameterOffset>,<numberOfParameters>,<MLnominalLevel>,0,0,0
o External gains in downlink path
Overall Speaker Gain Max is the sum of Microphone level gain (set by +UAPT) and external gains:
SpkGMAX
= GML Nominal Level
+ Gexternal downlink
3.2 Step 2: define the maximum gain in uplink audio path (SLR)
The Send Loudness Rating (SLR) is the signal loudness in sending direction.
This step aims to define the maximum gain in the uplink audio path (SLR) applicable without having echo distortions.
Figure 5: Gains calibration - step 2
3.2.1 Procedure
1. Use downlink calibrations values defined in step above (max RLR) 2. Disable the HF facilities
o EC: AT+UAPT=6,<profile>,0,0,0,0 o RES: AT+UAPT=6,<profile>,0,0,1,0 o NS: AT+UAPT=6,<profile>,0,0,2,0 o LPF AT+UAPT=6,<profile>,0,0,3,0 o HPF: AT+UAPT=6,<profile>,0,0,4,0 o EQ: AT+UAPT=6,<profile>,0,0,5,0 o AGC: AT+UAPT=6,<profile>,0,0,6,0 o DRC: AT+UAPT=6,<profile>,0,0,7,0 o AT+UAPT=0
3. Set up a call, send a reference signal as in step 1 and evaluate the echo at far-end 4. Increase the gains in uplink audio path in order to achieve maximum level without having any distortion in
the echo at far-end. 5. Distribute properly the gains all audio among all audio blocks in uplink path.
Overall Microphone Gain is the sum of Microphone level gain (set by +UAPT) and external gains:
MicGMAX
= GUAPT
+ Gexternal uplink
Cellular module
DUT
Reference
signal
FarEnd
Signal to be
evaluated
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information System gains tuning
Page 9 of 39
3.3 Step 3: verify mic sensitivity
After downlink and uplink gains have been defined, evaluate the microphone sensitivity to verify the requirements for capturing signals at both short and long distances. The distance boundaries must be specified in the project requirements.
The reference signal must simulate the typical use case at near end side. It should be an artificial voice so that the test can be repeated.
Figure 6: Microphone sensitivity at long distance
Figure 7: Microphone sensitivity at short distance
3.3.1 Procedure
1. Set up a call 2. Verify the signal received at the far end when the near-end user is placed far from the DUT 3. Adjust the gains in the uplink audio path aiming to have both enough level at far-end and no distortions.
The overall mic gain applied when the reference signal is placed at maximum distance MicGNE low
has to be in any case lower than MicG
MAX , defined in previous steps, otherwise distortions would be introduced
MicGNE low
< MicGMAX
The same test should be done by placing the reference signal at a minimum distance from the device. Also in this case, the signal at far-end side must not be distorted.
3.4 Step 4: final check
The fundamental constraint is
MicGMAX
> MicGNE low
If it is not satisfied, repeat all the steps (even more and more times) to find out the best compromise among speaker loudness, microphone sensitivity and no-distorted echo.
If a satisfying compromise cannot be found, it will be needed to modify the hardware and/or the mechanical design.
Cellular module
DUT FarEnd
Reference
signal
far
Cellular module
DUT FarEnd
Reference
signal
near
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 10 of 39
4 EC algorithm and filters tuning The EC functionality implemented in TOBY-L2 modules allows the echo removal.
Next sections describe the effects of the various parameters and settings and present a step-by-step procedure for choosing parameters to remove the echo heard on the far-end side.
4.1 Block diagram and tunable parameters
The signal processing blocks perform digital processing of the audio signals in both the Uplink (Tx) and Downlink (Rx) branches of the voice paths. The uplink modules process the digital samples coming out of the codec before their encoding by the voice encoder. The downlink modules process the voice decoder output samples before their transmission into the codec.
Filtering is performed by the HPF, LPF, and equalizers in both the uplink and downlink paths.
Echo and noise cancellation are handled in several uplink modules: Echo Cancellation (EC) and Noise and Residual Echo Suppression (NRES). The noise cancellation is also performed in the Rx path by the Rx-NS module.
Level adjustment and dynamic range compression are handled by the AGC and DRC (both uplink and downlink).
The voice enhancement modules are configured by +UAPT command; it has different sets of parameters assigned to different features.
The parameters are divided into the following categories:
Customer-tunable parameters: these parameters tune the major functions and are useful for enhance audio performance in customer applications. They are listed and described in this document.
Expertly set parameters: these parameters are intended for enhanced use. Although they are mentioned in this document, they are not described here and they should not be changed.
The management and parameters tuning of audio paths can be configured by means of the following AT commands:
+UAPT (Audio Parameter Tuning): audio parameters management for all the signal processing blocks:
o High Pass Filter (HPF)
o Echo Cancellation (EC)
o Noise Suppression (NS)
o Residual Echo Suppression (RES)
o Equalizer (EQ)
o Additional Gain Control (AGC)
o Dynamic Range Compression (DRC)
o Low Pass Filter (LPF)
+USPM (Set Path Mode)
+UVGC (Volume Gain Control): gains of external Maxim MAX9860 audio codec (connected via I2C interface)
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 11 of 39
EC[0]
HFP[4]
To Radio TX
From Radio RX
RES[1]
NS[2]
DRC[7]
LPF[3]
EQ[5]
AGC[6]
I2S_RXD
I2S_TXD
Volume & Mute
CNG[2]
AGC[6]
EQ[5]
LPF[3]
DRC[7]
NS[2]
HPF[4]
Volume & Mute
PCM Player
Tone Generator
Legend:
EC = Echo CancellationRES = Residual Echo Suppression
NS = Noise SuppressionLPF = Low Pass FilterHPF = High Pass Filter
TOBY-L2
TxBe
RxAe
TxAe
RxBe
<direction> = 1
<direction> = 0
EQU = EqualizerAGC = Additional Gain ControlDRC = Dynamic Range CompressionCNG = Comfort Noise Generator
[x] = Block ID
Figure 8: TOBY-L2 speech processing block diagram
4.1.1 Microphone levels (ML)
All modules in uplink path share a set of microphone level (ML) parameters. In this document, a signal “level” is defined as the RMS over the specific signal duration, expressed in dBFS. The levels are measured on the I2S_RxD signal.
4.1.1.1 Syntax
Type Syntax Response Example
Modify parameters
Set AT+UAPT=8,<profile>,0,0,8,<rate>,<parameterOffset>,<numberOfParameters>,<nominalLevel>,0,0,0
4.1.1.2 Defined values
Parameter Type Description
<nominalLevel> Number
[dBFS]
Speech level as measured at the primary-microphone input to the uplink voice enhancement path under nominal conditions. Nominal conditions are defined in the SLR test which requires a
specific test setup.
Range: -90 to 0
4.1.1.3 Default values
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 nominalLevel -30 -30 -52 -44 -36 -36 -30 -30 -30 -30
1 dualMicSpeechRatio 0 0 0 0 0 0 0 0 0 0
2 dualMicNoiseRatio 0 0 0 0 0 0 0 0 0 0
3 dualMicEchoRatio 0 0 0 0 0 0 0 0 0 0
4.1.2 Echo Cancellation (EC)
The Echo Canceller (EC) removes the major part of the acoustic echo generated during conversation in the near-end and heard on the far-end. The echo is a result of the acoustic coupling between the near-end loudspeaker and microphone. The EC algorithm cancels the acoustic echo by subtracting an estimated echo from the input (microphone) signal. The estimated echo is computed by passing the far-end RxRef signal (a delayed version of
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 12 of 39
RxAe) through a digital FIR filter that simulates the acoustic coupling between the loudspeaker and microphone. An adaptive normalized least mean square (NLMS) algorithm computes the digital filter.
The EC can operate in full-band or sub-band modes. Sub-band mode is often used with car audio devices. Full-band mode is suggested to be used with other audio devices. The EC operation is augmented by a residual echo suppression (RES) post processor that is embedded in the noise and residual echo suppression (NRES) module.
4.1.2.1 Syntax
Type Syntax Response Example
Modify parameters
Set AT+UAPT=8,<profile>,0,0,0,<rate>,<parameterOffset>,<numberOfParameters>,<sampleDelay>,<typicalEchoToNear>,<t
ypicalERLE>,<ntaps>,<ntaps2>,<nsubbands>,<mu>,<initialMu>,<initPeriod>,<qFir>,<RxThres>,<ecReserved1>,<ecRese
rved2>
4.1.2.2 Defined values
Parameter Type Description
<sampleDelay> Number
[16kHz
samples]
It controls the delay that is added to RxRef before filtering, so that the adaptive FIR only captures the dynamic acoustic channel and not the digital delay from the DSP to the speaker
Range: 0 to 32767
<typicalEchoToNear> Number
[dB]
It affects the EC initial convergence and handling of double-talk.
It is a rough estimate of the ratio between the echo and the near-end speech. It should be
determined for the highest Rx volume setting in an anechoic environment. It can be determined based on the TxAe (TX after enhancement recording point) signal recorded during far-end
speech followed by near-end speech with all modules disabled except the HPF.
Range: -90 to 90
<typicalERLE> Number
[dB]
It affects the EC initial convergence and handling of double-talk.
It is a rough estimate of the amount of echo attenuation achieved by the EC after convergence. It can be determined by comparing the above recorded signal with a similar signal where both
HPF and EC are enabled. Measure the residual echo at least 10 seconds after initialization.
The far-end and near-end signals for these experiments are the RLR and SLR signals generated
by the audio testing equipment. Range: 0 to 90
<ntaps> Number It sets the FIR length. Range: 1 to 512
<ntaps2> Number Reserved to expert users, do not modify.
<nsubbands> Number Reserved to expert users, do not modify.
<mu> Number Reserved to expert users, do not modify.
<initialMu> Number Reserved to expert users, do not modify.
<initPeriod> Number Reserved to expert users, do not modify.
<qFir> Number Reserved to expert users, do not modify.
<RxThres> Number Reserved to expert users, do not modify.
<ecReserved1> Reserved
<ecReserved2> Reserved
4.1.2.3 Default values
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 sampleDelay 36 36 36 36 36 36 36 36 36 36
1 typicalEchoToNear -10 -20 16 15 0 0 -10 -20 -10 -20
2 typicalERLE 8 20 8 10 8 20 8 20 8 20
3 Ntaps 64 128 64 25 64 128 64 128 64 128
4 ntaps2 0 0 0 0 0 0 0 0 0 0
5 Nsubbands 0 0 0 16 0 0 0 0 0 0
6 Mu 3276 8192 1638 3276 3276 3276 3276 8192 3276 8192
7 initialMu 8192 16384 3276 8192 8192 8192 8192 16384 8192 16384
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 13 of 39
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
8 initPeriod 10 10 20 20 10 10 10 10 10 10
9 qFir 20 20 16 16 20 16 20 20 20 20
10 RxThres -50 -50 -50 -50 -50 -50 -50 -50 -50 -50
11 ecReserved1 0 0 0 0 0 0 0 0 0 0
12 ecReserved2 0 0 0 0 0 0 0 0 0 0
4.1.3 Residual Echo Suppression (RES)
The residual echo suppressor (RES) suppresses very late echo reflections and non-linear echo components that were not cancelled by the EC. Similar to NS, RES attenuates the uplink (TX) signal in time/frequency regions where the ratio between near-end signal and residual-echo is low.
4.1.3.1 Syntax
Type Syntax Response Example
Modify parameters
Set AT+UAPT=8,<profile>,0,0,1,<rate>,<parameterOffset>,<nu
mberOfParameters>,<resEnabled>,0,<resEchoAtt>,20,<gammaDT>,<nonLinearityType>,<nonLinearityFactor>,<refRegres
sion1>,<vmThresDT>,<vmThresDT1>,<vmThresDT2>,<vmThresMus>,<hangDT>,<hangFE>,<numMutedChan>,<muRes>
,<initialMuRes>,<vmThreshAdaptSlowdown>,<initialVmThresAdaptSlowdown>,<initPeriod>,<cnGain>,<outputGain>,<
minChNoise>,<maxChNoise>,<dmVadHighThres>,<dmVadLowThres>,<dmProbabilityThres>,<dmProbabilityMode>,<pat
hChangeThres>,<maskingThresholdFactor>
4.1.3.2 Defined values
Parameter Type Description
<resEnabled> Number Enables/disables the RES function
Range: 0,1
<resEchoAtt> Number
[dB]
Maximal residual-echo attenuation
Range: 0 to 60
<gammaDT> Number An overestimation factor of the residual echo. Increasing this parameter increases echo suppression at the cost of more distortion of the near end during double-talk.
Range: 0 to 32767
<nonLinearityType> Number Reserved to expert users, do not modify.
<nonLinearityFactor> Number Reserved to expert users, do not modify.
<refRegression1> Number Reserved to expert users, do not modify.
<vmThresDT> Number Affects the operation of a DT detector. It sets the tradeoff between two undesired phenomena of DT false alarms and misdetection. A DT false alarm means that near-end speech was falsely detected, and misdetection means that near-end speech was
misdetected. Higher values would result in fewer false alarms and more misdetection.
Range: 0 to 1000
<vmThresDT1> Number Reserved to expert users, do not modify.
<vmThresDT2> Number Reserved to expert users, do not modify.
<vmThresMus> Number Reserved to expert users, do not modify.
<hangDT> Number Reserved to expert users, do not modify.
<hangFE> Number Reserved to expert users, do not modify.
<numMutedChan> Number Reserved to expert users, do not modify.
<muRes> Number Reserved to expert users, do not modify.
<initialMuRes> Number Reserved to expert users, do not modify.
<vmThreshAdaptSlowdown> Number Reserved to expert users, do not modify.
<initialVmThresAdaptSlowdown> Number Reserved to expert users, do not modify.
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 14 of 39
Parameter Type Description
<initPeriod> Number Reserved to expert users, do not modify.
<cnGain> Number Reserved to expert users, do not modify.
<outputGain> Number Reserved to expert users, do not modify.
<minChNoise> Number Reserved to expert users, do not modify.
<maxChNoise> Number Reserved to expert users, do not modify.
<dmVadHighThres> Number Reserved to expert users, do not modify.
<dmVadLowThres> Number Reserved to expert users, do not modify.
<dmProbabilityThres> Number Reserved to expert users, do not modify.
<dmProbabilityMode> Number Reserved to expert users, do not modify.
<pathChangeThres> Number Reserved to expert users, do not modify.
<maskingThresholdFactor> Number Reserved to expert users, do not modify.
4.1.3.3 Default values
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 resEnabled 1 1 1 1 1 1 1 1 1 1
1 dualMicEnabled 0 0 0 0 0 0 0 0 0 0
2 resEchoAtt 40 40 60 60 40 40 40 40 40 40
3 nonStatNoiseAtt 20 20 20 20 20 20 20 20 20 20
4 gammaDT 1024 1024 16384 32767 1024 1024 1024 1024 1024 1024
5 nonLinearityType 2 2 2 2 2 2 2 2 2 2
6 nonLinearityFactor 0 0 32767 32767 0 0 0 0 0 0
7 refRegression1 8192 8192 8192 8192 8192 8192 8192 8192 8192 8192
8 vmThresDT 100 250 50 50 100 100 100 100 100 100
9 vmThresDT1 482 482 482 964 482 482 482 482 482 482
10 vmThresDT2 0 0 50 0 0 0 0 0 0 0
11 vmThresMus 100 100 100 100 100 100 100 100 100 100
12 hangDT 20 20 20 20 20 20 20 20 20 20
13 hangFE 10 10 10 10 10 10 10 10 10 10
14 numMutedChan 0 0 0 0 0 0 0 0 0 0
15 muRes 672 672 168 672 672 672 672 672 672 672
16 initialMuRes 1680 1680 1680 1680 1680 1680 1680 1680 1680 1680
17 vmThreshAdaptSlowdown 50 50 100 100 50 50 50 50 50 50
18 initialVmThresAdaptSlowdown 200 200 500 200 200 200 200 200 200 200
19 initPeriod 40 40 80 40 40 40 40 40 40 40
20 cnGain 0 0 0 0 0 0 0 0 0 0
21 outputGain 0 0 1 1 0 0 0 0 0 0
22 minChNoise -90 -90 -90 -90 -90 -90 -90 -90 -90 -90
23 maxChNoise 0 0 0 0 0 0 0 0 0 0
24 dmVadHighThres 50 50 50 50 50 50 50 50 50 50
25 dmVadLowThres 30 30 30 30 30 30 30 30 30 30
26 dmProbabilityThres 0 0 0 0 0 0 0 0 0 0
27 dmProbabilityMode 0 0 0 0 0 0 0 0 0 0
28 pathChangeThres 0 0 0 0 0 0 0 0 0 0
29 maskingThresholdFactor 32767 32767 32767 32767 32767 32767 32767 32767 32767 32767
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 15 of 39
4.1.4 Noise Suppression (NS) and Comfort Noise (CN)
The Noise Suppressor is based on auditory-perception principles that favor attenuation of the noisy signal in time/frequency segments where the SNR is low. This attenuation comes at the price of distortion of the speech signal, and therefore has to be applied with care. The amount of desired suppression is controlled by the parameter <maxSuppress>. It is set as a compromise between some loss of intelligibility and naturalness versus gain in listening comfort due to the suppressed noise. The NS primarily suppresses quasi-stationary noise generated, for example, by wind, air-conditioning, a car engine, or a crowd.
The Comfort Noise generator generates CN to compensate for over suppression of noise by the RES. Optionally, it can generate a CN floor to prevent total silence in the channel or to mask irritating noise that cannot be removed in any other way. The CNG parameters are split between the Uplink NS (tunable) and NRES (expertly) parameter sets.
4.1.4.1 Syntax
Type Syntax Response Example
Modify parameters
Set AT+UAPT=8,<profile>,0,<direction>,2,<rate>,<parameterOf
fset>,<numberOfParameters>,<maxSuppress>,<cnFloor>,<cnHighFreqBoost>,<noiseInducedEqualizedFactor>,<lowTxNoi
se>,<HighTxNoise>,<equalizer[0]>,...,<equalizer[21]>,<varThId>,<nsReserved>
4.1.4.2 Defined values
Parameter Type Description
<maxSuppress> Number
[dB]
Amount of noise suppression
Range: 0 to 40
<cnFloor> Number
[dBFS]
The level (dBFS) of the inserted Confort Noise. The CN is pink, with a spectral tilt of
approximately -10 dB over the full bandwidth. The floor level corresponds to the level of the I2S_RxD signal after being amplified by NRES <outputGain>
Range: -100 to 0
<cnHighFreqBoost> Number
[dB]
A spectral-tilt boost (dB per the full bandwidth) of the generated CN. For example, setting this parameter to 10 generates an approximately white noise.
Range: -90 to 90
<noiseInducedEqualized
Factor>
Number Range: 0 to 32767
<lowTxNoise> Number
[dB]
Range: -90 to 90
<HighTxNoise> Number
[dB]
Range: -90 to 90
<equalizer[0]> … <equalizer[21]>
Number
[dB]
Range: -20 to 20
<varThId> Number Reserved to expert users, do not modify.
<nsReserved> Reserved
4.1.4.3 Default values
For <direction>=0 (uplink)
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 maxSuppress 15 15 15 15 20 20 15 15 15 15
1 cnFloor -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
2 cnHighFreqBoost 0 0 0 0 0 0 0 0 0 0
3 noiseInducedEqualizerFactor 0 0 0 0 0 0 0 0 0 0
4 lowTxNoise -20 -20 -20 -20 -20 -20 -20 -20 -20 -20
5 highTxNoise 0 0 0 0 0 0 0 0 0 0
6 equalizer[0] 0 0 0 0 0 0 0 0 0 0
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 16 of 39
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
7 equalizer[1] 0 0 0 0 0 0 0 0 0 0
8 equalizer[2] 0 0 0 0 0 0 0 0 0 0
9 equalizer[3] 0 0 0 0 0 0 0 0 0 0
10 equalizer[4] 0 0 0 0 0 0 0 0 0 0
11 equalizer[5] 0 0 0 0 0 0 0 0 0 0
12 equalizer[6] 0 0 0 0 0 0 0 0 0 0
13 equalizer[7] 0 0 0 0 0 0 0 0 0 0
14 equalizer[8] 0 0 0 0 0 0 0 0 0 0
15 equalizer[9] 0 0 0 0 0 0 0 0 0 0
16 equalizer[10] 0 0 0 0 0 0 0 0 0 0
17 equalizer[11] 0 0 0 0 0 0 0 0 0 0
18 equalizer[12] 0 0 0 0 0 0 0 0 0 0
19 equalizer[13] 0 0 0 0 0 0 0 0 0 0
20 equalizer[14] 0 0 0 0 0 0 0 0 0 0
21 equalizer[15] 0 0 0 0 0 0 0 0 0 0
22 equalizer[16] 0 0 0 0 0 0 0 0 0 0
23 equalizer[17] 0 0 0 0 0 0 0 0 0 0
24 equalizer[18] 0 0 0 0 0 0 0 0 0 0
25 equalizer[19] 0 0 0 0 0 0 0 0 0 0
26 equalizer[20] 0 0 0 0 0 0 0 0 0 0
27 equalizer[21] 0 0 0 0 0 0 0 0 0 0
28 varThld 200 200 200 200 200 200 200 200 200 200
29 nsReserved2 0 0 0 0 0 0 0 0 0 0
For <direction>=1 (downlink)
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 maxSuppress 10 10 10 10 10 10 10 10 10 10
1 cnFloor -100 -100 -100 -100 -100 -100 -100 -100 -100 -100
2 cnHighFreqBoost 0 0 0 0 0 0 0 0 0 0
3 noiseInducedEqualizerFactor 32767 32767 32767 32767 32767 32767 32767 32767 32767 32767
4 lowTxNoise -30 -30 -30 -30 -30 -30 -30 -30 -30 -30
5 highTxNoise 0 0 0 0 0 0 0 0 0 0
6 equalizer[0] 0 0 0 0 0 0 0 0 0 0
7 equalizer[1] 0 0 0 0 0 0 0 0 0 0
8 equalizer[2] 0 0 0 0 0 0 0 0 0 0
9 equalizer[3] 0 0 0 0 0 0 0 0 0 0
10 equalizer[4] 0 0 0 0 0 0 0 0 0 0
11 equalizer[5] 0 0 0 0 0 0 0 0 0 0
12 equalizer[6] 0 0 0 0 0 0 0 0 0 0
13 equalizer[7] 0 0 0 0 0 0 0 0 0 0
14 equalizer[8] 0 0 0 0 0 0 0 0 0 0
15 equalizer[9] 0 0 0 0 0 0 0 0 0 0
16 equalizer[10] 0 0 0 0 0 0 0 0 0 0
17 equalizer[11] 0 0 0 0 0 0 0 0 0 0
18 equalizer[12] 0 0 0 0 0 0 0 0 0 0
19 equalizer[13] 0 0 0 0 0 0 0 0 0 0
20 equalizer[14] 0 0 0 0 0 0 0 0 0 0
21 equalizer[15] 0 0 0 0 0 0 0 0 0 0
22 equalizer[16] 0 0 0 0 0 0 0 0 0 0
23 equalizer[17] 0 0 0 0 0 0 0 0 0 0
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 17 of 39
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
24 equalizer[18] 0 0 0 0 0 0 0 0 0 0
25 equalizer[19] 0 0 0 0 0 0 0 0 0 0
26 equalizer[20] 0 0 0 0 0 0 0 0 0 0
27 equalizer[21] 0 0 0 0 0 0 0 0 0 0
28 varThld 160 160 160 160 160 160 160 160 160 160
29 nsReserved2 0 0 0 0 0 0 0 0 0 0
4.1.5 Low Pass Filter (LPF)
Low Pass Filter in both uplink and downlink paths usually consist of single Bi-Quad filters. The coefficients are given by the parameters a[0], a[1], a[2], b[0], b[1], and b[2]. These parameters conform to the standard definition of IIR-filter coefficients and can be calculated by using the MVT Tool.
4.1.5.1 Syntax
Type Syntax Response Example
Modify parameters
Set AT+UAPT=8,<profile>,0,<direction>,3,<rate>,<parameterOf
fset>,<numberOfParameters>,<FilterType>,<TapA0>,<TapA1>,<TapA2>,<TapB0>,<TapB1>,<TapB2>
OK AT+UAPT=8,1,0,0,3,0,0,7,1,8192,10201,3772,
5541,11082,5541
HPF, FrequencyCutoff=3300Hz, Q-Filter=0.707
4.1.5.2 Defined values
Parameter Type Description
<FilterType> Number Range: 0,1
<TapA0>, <TapA1>, <TapA2>, <TapB0>, <TapB1>, <TapB2>
Number Bi-Quad filter coefficients.
Use the MVT tool to design the filter and calculate the coefficients.
Define the bi-quad filter’s cutoff frequencies (in Hz). To filter noise outside of speech
frequencies, use the following guidelines, depending on whether you are using a WB or NB filter:
Wideband (WB) LPF: 7500 to 8000 Hz
Narrow band (NB) LPF: 3400 to 4000 Hz
The Q-filter factor defines the sharpness of the slope. Define a Q-Filter floating point between 0
and 1; for a 3 dB attenuation at cutoff frequency, define Q as 2 (0.707).
Range TapA0: 4096, 8192, or 16384
Range others: -32768 to 32767
4.1.5.3 Default values
For <direction>=0 (uplink)
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 filterType 1 1 1 1 1 1 1 1 1 1
1 a[0] 8192 8192 8192 8192 8192 8192 8192 8192 8192 8192
2 a[1] 11913 10201 10201 10201 10201 10201 10201 10201 10201 10201
3 a[2] 4703 3772 3772 3772 3772 3772 3772 3772 3772 3772
4 b[0] 6202 5541 5541 5541 5541 5541 5541 5541 5541 5541
5 b[1] 12404 11082 11082 11082 11082 11082 11082 11082 11082 11082
6 b[2] 6202 5541 5541 5541 5541 5541 5541 5541 5541 5541
For <direction>=1 (downlink)
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 filterType 1 1 1 1 1 1 0 1 1 1
1 a[0] 4096 4096 4096 4096 4096 4096 4096 4096 4096 4096
2 a[1] 0 0 0 0 0 0 0 0 0 0
3 a[2] 0 0 0 0 0 0 0 0 0 0
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 18 of 39
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
4 b[0] 4096 4096 4096 4096 4096 4096 4096 4096 4096 4096
5 b[1] 0 0 0 0 0 0 0 0 0 0
6 b[2] 0 0 0 0 0 0 0 0 0 0
4.1.6 High Pass Filter (HPF)
High Pass Filter in both uplink and downlink paths usually consist of single Bi-Quad filters. The coefficients are given by the parameters a[0], a[1], a[2], b[0], b[1], and b[2]. These parameters conform to the standard definition of IIR-filter coefficients and can be calculated by using MVT Tool.
4.1.6.1 Syntax
Type Syntax Response Example
Modify parameters
Set AT+UAPT=8,<profile>,0,<direction>,4,<rate>,<parameterOf
fset>,<numberOfParameters>,<FilterType>,<TapA0>,<TapA1>,<TapA2>,<TapB0>,<TapB1>,<TapB2>
OK AT+UAPT=8,1,0,0,4,0,0,7,0,8192,-13675,587
2,6935,-13870,6935
HPF, FrequencyCutoff=330 Hz, Q-Filter=0.707
4.1.6.2 Defined values
Parameter Type Description
<FilterType> Number Range: 0,1
<TapA0>, <TapA1>, <TapA2>, <TapB0>,
<TapB1>, <TapB2>
Number Bi-Quad filter coefficients.
Use MVT tool to design the filter and calculate the coefficients:
Define the bi-quad filter’s cutoff frequencies (in Hz). To filter noise outside of speech
frequencies, use the following guidelines, depending on whether you are using a WB or NB filter:
Wideband (WB) HFP: 0 to 300 Hz
Narrow band (NB) HFP: 0 to 300 Hz
The Q-filter factor defines the sharpness of the slope. Define a Q-Filter floating point between 0
and 1; for a 3 dB attenuation at cutoff frequency, define Q as 2 (0.707).
Range TapA0: 4096, 8192, or 16384
Range others: -32768 to 32767
4.1.6.3 Default values
For <direction>=0 (uplink)
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 filterType 0 0 0 0 0 0 0 0 0 0
1 a[0] 8192 8192 8192 4096 8192 8192 8192 8192 8192 8192
2 a[1] -14121 -16020 -12788 -7737 -13446 -16020 -15022 -16020 -15022 -16020
3 a[2] 6206 7836 5254 3665 5518 7836 6935 7836 6935 7836
4 b[0] 7130 8012 6559 3875 6788 8012 7537 8012 7537 8012
5 b[1] -14259 -16024 -13117 -7749 -13578 -16024 -15074 -16024 -15074 -16024
6 b[2] 7130 8012 6559 3875 6788 8012 7537 8012 7537 8012
For <direction>=1 (downlink)
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 filterType 0 0 0 0 0 0 0 0 0 0
1 a[0] 4096 4096 4096 4096 4096 4096 4096 4096 4096 4096
2 a[1] 0 0 0 0 0 0 0 0 0 0
3 a[2] 0 0 0 0 0 0 0 0 0 0
4 b[0] 4096 4096 4096 4096 4096 4096 4096 4096 4096 4096
5 b[1] 0 0 0 0 0 0 0 0 0 0
6 b[2] 0 0 0 0 0 0 0 0 0 0
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 19 of 39
4.1.7 Equalizer (EQ)
The equalizers in both Uplink (Tx) and Downlink (Rx) paths consist of 31-tap FIR.
4.1.7.1 Syntax
Type Syntax Response Example
Modify parameters
Set AT+UAPT=8,<profile>,0,<direction>,5,<rate>,<parameter
Offset>,<numberOfParameters>,<numOfTaps>,<EqTap0>,<EqTap1>,…,<EqTap15>
4.1.7.2 Defined values
Parameter Type Description
<numOfTaps>, Number Range: 31
<EqTap0> , …,
<EqTap15>
Number Range: 0 to 32767
4.1.7.3 Default values
For <direction>=0 (uplink)
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 numOfTaps 31 31 31 31 31 31 31 31 31 31
1 taps[0] 0 0 0 0 10 -17 0 0 0 0
2 taps[1] 0 0 0 0 -1 37 0 0 0 0
3 taps[2] 0 0 0 0 0 5 0 0 0 0
4 taps[3] 0 0 0 0 -5 5 0 0 0 0
5 taps[4] 0 0 0 0 9 33 0 0 0 0
6 taps[5] 0 0 0 0 -9 3 0 0 0 0
7 taps[6] 0 0 0 0 16 -4 0 0 0 0
8 taps[7] 0 0 0 0 -24 47 0 0 0 0
9 taps[8] 0 0 0 0 24 -52 0 0 0 0
10 taps[9] 0 0 0 0 -6 35 0 0 0 0
11 taps[10] 0 0 0 0 34 9 0 0 0 0
12 taps[11] 0 0 0 0 23 -105 0 0 0 0
13 taps[12] 0 0 0 0 -18 246 0 0 0 0
14 taps[13] 0 0 0 0 -10 -306 0 0 0 0
15 taps[14] 0 0 0 0 -113 -194 0 0 0 0
16 taps[15] 1024 1024 1024 1024 1241 1823 1024 1024 1024 1024
17 taps[16] 0 0 0 0 -113 -194 0 0 0 0
18 taps[17] 0 0 0 0 -10 -306 0 0 0 0
19 taps[18] 0 0 0 0 -18 246 0 0 0 0
20 taps[19] 0 0 0 0 23 -105 0 0 0 0
21 taps[20] 0 0 0 0 34 9 0 0 0 0
22 taps[21] 0 0 0 0 -6 35 0 0 0 0
23 taps[22] 0 0 0 0 24 -52 0 0 0 0
24 taps[23] 0 0 0 0 -24 47 0 0 0 0
25 taps[24] 0 0 0 0 16 -4 0 0 0 0
26 taps[25] 0 0 0 0 -9 3 0 0 0 0
27 taps[26] 0 0 0 0 9 33 0 0 0 0
28 taps[27] 0 0 0 0 -5 5 0 0 0 0
29 taps[28] 0 0 0 0 0 5 0 0 0 0
30 taps[29] 0 0 0 0 -1 37 0 0 0 0
31 taps[30] 0 0 0 0 10 -17 0 0 0 0
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 20 of 39
For <direction>=1 (downlink)
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 numOfTaps 31 31 31 31 31 31 31 31 31 31
1 taps[0] 0 0 0 0 -4 -1 0 0 0 0
2 taps[1] 0 0 0 0 -16 -5 0 0 0 0
3 taps[2] 0 0 0 0 -4 11 0 0 0 0
4 taps[3] 0 0 0 0 -18 6 0 0 0 0
5 taps[4] 0 0 0 0 0 -8 0 0 0 0
6 taps[5] 0 0 0 0 -9 -11 0 0 0 0
7 taps[6] 0 0 0 0 -1 -8 0 0 0 0
8 taps[7] 0 0 0 0 -11 -11 0 0 0 0
9 taps[8] 0 0 0 0 -3 18 0 0 0 0
10 taps[9] 0 0 0 0 22 31 0 0 0 0
11 taps[10] 0 0 0 0 -63 1 0 0 0 0
12 taps[11] 0 0 0 0 14 72 0 0 0 0
13 taps[12] 0 0 0 0 23 55 0 0 0 0
14 taps[13] 0 0 0 0 80 28 0 0 0 0
15 taps[14] 0 0 0 0 108 131 0 0 0 0
16 taps[15] 1024 1024 1024 1024 709 522 1024 1024 1024 1024
17 taps[16] 0 0 0 0 108 131 0 0 0 0
18 taps[17] 0 0 0 0 80 28 0 0 0 0
19 taps[18] 0 0 0 0 23 55 0 0 0 0
20 taps[19] 0 0 0 0 14 72 0 0 0 0
21 taps[20] 0 0 0 0 -63 1 0 0 0 0
22 taps[21] 0 0 0 0 22 31 0 0 0 0
23 taps[22] 0 0 0 0 -3 18 0 0 0 0
24 taps[23] 0 0 0 0 -11 -11 0 0 0 0
25 taps[24] 0 0 0 0 -1 -8 0 0 0 0
26 taps[25] 0 0 0 0 -9 -11 0 0 0 0
27 taps[26] 0 0 0 0 0 -8 0 0 0 0
28 taps[27] 0 0 0 0 -18 6 0 0 0 0
29 taps[28] 0 0 0 0 -4 11 0 0 0 0
30 taps[29] 0 0 0 0 -16 -5 0 0 0 0
31 taps[30] 0 0 0 0 -4 -1 0 0 0 0
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 21 of 39
4.1.8 Additional Gain Control (AGC)
The AGC regulates the uplink (TX) or downlink (RX) signal level respectively, to compensate for variations in the voice level and the microphone-to-mouth distance.
The parameter <mode> selects whether AGC operates in loudness mode or peak mode.
In loudness mode, the target of the AGC is to bring the perceived loudness of the near-end signal to a given target, set by <loudnessTarget>.
In peak mode, the target of the AGC is to bring the peak power of the near-end signal to a given target, set by <envelopeTarget>. In this mode the gain is limited to <maxAgcGain>.
The loudness and peak-power of the input signal are continuously updated based on a few seconds of the signal history. Background noise and other interfering signals are rejected and have only a minor effect on the estimated loudness and peak-power.
While striving to reach the loudness or peak targets, the gain is limited so that the short-term output power does not exceed the limit set by <rmsLimit>.
At the beginning of a conversation, the gain is initially set assuming that the input speech is:
at the nominal level, as defined by ML <nominalLevel>, in Uplink AGC;
at a nominal level of -23 dBFS, in Downlink AGC.
Optionally, the initial gain can be decreased by the amount <initialGainReduction> to prevent excessive amplification if and when the incoming speech is unexpectedly high.
The loudness and envelope targets can be dynamically boosted in the presence of TX noise; this feature is slight different between AGC block in uplink and downlink path.
In uplink path, AGC compensates for potential over-estimation of the input speech level due to noise. Such an over-estimate of the input level may lead to a negative-bias in the applied AGC gain. Another motivation is to reflect the fact that near-end speakers typically raise their voices in the presence of noise; without a target-boost, the AGC would cancel the effect of raising one’s voice after a few seconds.
In downlink path, AGC acts as “auto-volume”.
4.1.8.1 Syntax
Type Syntax Response Example
Modify parameters
Set AT+UAPT=8,<profile>,0,<direction>,6,<rate>,<parameter
Offset>,<numberOfParameters>,<mode>,<loudnessTarget>,<envelopeTarget>,<maxAgcGain>,<rmsLimit>,<initialGainReduction>,<noiseInducedBoost>,<rmsToLoudnessOffset
>,<agcReserved1>
4.1.8.2 Defined values
Parameter Type Description
<mode> Number It selects whether Rx-AGC operates in loudness mode or peak mode
Range: 0,1
<loudnessTarget> Number
[dBFS]
In loudness mode, it is the target to which the AGC brings the perceived loudness of the near-end signal
Range: -90 to 0
<envelopeTarget> Number
[dBFS]
In peak mode, it is the target to which the AGC brings the peak power of the near-end signal
Range: -90 to 0
<maxAgcGain> Number
[dB]
In peak mode it limits the gain
Range: 0 to 90
<rmsLimit> Number
[dBFS]
Range: -90 to 0
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 22 of 39
Parameter Type Description
<initialGainReduction> Number
[dB]
Range: 0 to 20
<noiseInducedBoost> Number
[dB]
Range: 0 to 20
<rmsToLoudnessOffset> Number Reserved to expert users, do not modify.
<agcReserved1> Reserved
4.1.8.3 Default values
For <direction>=0 (uplink)
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 Mode 0 0 0 0 0 0 0 0 0 0
1 loudnessTarget -25 -25 -26 -26 -26 -26 -25 -25 -25 -25
2 envelopeTarget 0 0 0 0 -5 -5 0 0 0 0
3 maxAgcGain 90 90 90 90 90 90 90 90 90 90
4 rmsLimit 0 0 0 0 0 0 0 0 0 0
5 initialGainReduction 0 0 0 0 0 0 0 0 0 0
6 noiseInducedBoost 0 0 0 0 0 0 0 0 0 0
7 rmsToLoudnessOffset 0 -3 -3 0 -5 -3 0 -3 0 -3
8 agcReserved1 0 0 0 0 0 0 0 0 0 0
For <direction>=1 (downlink)
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 Mode 0 0 1 1 0 0 0 0 0 0
1 loudnessTarget -22 -24 -24 -24 -24 -24 -24 -24 -24 -24
2 envelopeTarget 0 0 -1 -1 -1 -1 0 0 0 0
3 maxAgcGain 20 20 20 20 20 20 20 20 20 20
4 rmsLimit -15 -15 -15 -15 -15 -15 -15 -15 -15 -15
5 initialGainReduction 0 0 0 0 0 0 0 0 0 0
6 noiseInducedBoost 0 0 0 0 0 0 0 0 0 0
7 rmsToLoudnessOffset -1 -1 -1 -1 -1 -1 -1 -1 -1 -1
8 agcReserved1 0 0 0 0 0 0 0 0 0 0
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 23 of 39
4.1.9 Dynamic Range Compression (DRC)
Dynamic range compression (DRC) compresses the dynamic range of the received speech signal by selectively amplifying low-level segments. Its purpose is to increase the perceived loudness without increasing the peak power).
The Uplink DRC is identical to the Downlink DRC, except RX-TXnoiseFactor is replaced by TX-TXnoiseFactor.
The DRC instantaneous gain is determined by a “gain function” that takes the following inputs:
a long-term peak-level that is passed from the Rx-AGC to the DRC;
a short-term level estimated by the DRC;
an estimate of the Rx noise level;
a dynamic DRC factor that is optionally dependent on the Tx noise.
The short-term level is estimated by an attack/release leaky integrator mechanism, where the attack time is instantaneous and the release time is configurable by the parameter <release>.
The noise level estimator continuously tracks the level of the stationary noise in the downlink signal. The final noise level that is used by the DRC is the maximum between the estimated stationary noise and the input parameter <minNoiseLevel>.
4.1.9.1 Syntax
Type Syntax Response Example
Modify parameters
Set AT+UAPT=8,<profile>,0,<direction>,7,<rate>,<parameter
Offset>,<numberOfParameters>,<gainFunctionType>,<drcGainFactor>,<release>,<minNoiseLevel>,<noiseLevelGain>,<noiseInducedGainFactor>,<g2Slope>,<progLevels[0]>,...,
<progLevels[9]>,<progGains[0]>,...,<progGains[9]>,
4.1.9.2 Defined values
Parameter Type Description
<gainFunctionType> Number 0: analitic
1: Prog
<drcGainFactor> Number Range: 0 to 32767
<release> Number Range: 0 to 32767
<minNoiseLevel> Number
[dBFS]
Range: -90 to 0
<noiseLevelGain> Number
[dB]
Range: -10 to 10
<noiseInducedGainFactor> Number Range: 0 to 32767
<g2Slope> Number Range: 0 to 32767
<progLevels[0]>, ..., <progLevels[9]>
Number
[dBFS]
Range: -90 to 0
<progGains[0]>, ..., <progGains[9]>
Number
[dB]
Range: -90 to 90
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 24 of 39
4.1.9.3 Default values
For <direction>=0 (uplink)
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 gainFunctionType 0 0 0 0 0 0 0 0 0 0
1 drcGainFactor 4096 4096 4096 4096 4096 4096 4096 4096 4096 4096
2 release 327 327 327 327 327 327 327 327 327 327
3 minNoiseLevel -50 -50 -50 -50 -50 -50 -50 -50 -50 -50
4 noiseLevelGain 0 0 0 0 0 0 0 0 0 0
5 noiseInducedGainFactor 0 0 0 0 0 0 0 0 0 0
6 g2Slope 32767 32767 32767 32767 32767 32767 32767 32767 32767 32767
7 progLevels[0] 0 0 0 0 0 0 0 0 0 0
8 progLevels[1] 0 0 0 0 0 0 0 0 0 0
9 progLevels[2] 0 0 0 0 0 0 0 0 0 0
10 progLevels[3] 0 0 0 0 0 0 0 0 0 0
11 progLevels[4] 0 0 0 0 0 0 0 0 0 0
12 progLevels[5] 0 0 0 0 0 0 0 0 0 0
13 progLevels[6] 0 0 0 0 0 0 0 0 0 0
14 progLevels[7] 0 0 0 0 0 0 0 0 0 0
15 progLevels[8] 0 0 0 0 0 0 0 0 0 0
16 progLevels[9] 0 0 0 0 0 0 0 0 0 0
17 progGains[0] 0 0 0 0 0 0 0 0 0 0
18 progGains[1] 0 0 0 0 0 0 0 0 0 0
19 progGains[2] 0 0 0 0 0 0 0 0 0 0
20 progGains[3] 0 0 0 0 0 0 0 0 0 0
21 progGains[4] 0 0 0 0 0 0 0 0 0 0
22 progGains[5] 0 0 0 0 0 0 0 0 0 0
23 progGains[6] 0 0 0 0 0 0 0 0 0 0
24 progGains[7] 0 0 0 0 0 0 0 0 0 0
25 progGains[8] 0 0 0 0 0 0 0 0 0 0
26 progGains[9] 0 0 0 0 0 0 0 0 0 0
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 25 of 39
For <direction>=1 (downlink)
profile 0(NB) 0(WB) 1(NB) 1(WB) 2(NB) 2(WB) 3(NB) 3(WB) 4(NB) 4(WB)
0 gainFunctionType 0 0 0 0 0 0 0 0 0 0
1 drcGainFactor 4096 4096 16384 4096 4096 4096 4096 4096 4096 4096
2 release 327 327 327 327 327 327 327 327 327 327
3 minNoiseLevel -50 -50 -50 -50 -50 -50 -50 -50 -50 -50
4 noiseLevelGain 0 0 0 0 0 0 0 0 0 0
5 noiseInducedGainFactor 0 0 0 0 0 0 0 0 0 0
6 g2Slope 0 0 0 0 0 0 0 0 0 0
7 progLevels[0] 0 0 0 0 0 0 0 0 0 0
8 progLevels[1] 0 0 0 0 0 0 0 0 0 0
9 progLevels[2] 0 0 0 0 0 0 0 0 0 0
10 progLevels[3] 0 0 0 0 0 0 0 0 0 0
11 progLevels[4] 0 0 0 0 0 0 0 0 0 0
12 progLevels[5] 0 0 0 0 0 0 0 0 0 0
13 progLevels[6] 0 0 0 0 0 0 0 0 0 0
14 progLevels[7] 0 0 0 0 0 0 0 0 0 0
15 progLevels[8] 0 0 0 0 0 0 0 0 0 0
16 progLevels[9] 0 0 0 0 0 0 0 0 0 0
17 progGains[0] 0 0 0 0 0 0 0 0 0 0
18 progGains[1] 0 0 0 0 0 0 0 0 0 0
19 progGains[2] 0 0 0 0 0 0 0 0 0 0
20 progGains[3] 0 0 0 0 0 0 0 0 0 0
21 progGains[4] 0 0 0 0 0 0 0 0 0 0
22 progGains[5] 0 0 0 0 0 0 0 0 0 0
23 progGains[6] 0 0 0 0 0 0 0 0 0 0
24 progGains[7] 0 0 0 0 0 0 0 0 0 0
25 progGains[8] 0 0 0 0 0 0 0 0 0 0
26 progGains[9] 0 0 0 0 0 0 0 0 0 0
4.1.10 Sidetone
TOBY-L2 has not a sidetone generator, thus if a sidetone is needed, it has to be generated by the external codec (connected via I
2C interface).
For sidetone control on Maxim MAX9860 audio codec see +UVGC (Volume Gain Control).
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EC algorithm and filters tuning
Page 26 of 39
4.2 No-duplex configuration
In case of hands-free systems with high echo coupling and high non-linearity on the loudspeaker (making the EC cancellation ineffective), a so called “no-duplex” configuration could be chosen. This setup accomplishes excellent results in terms of echo reduction, but has strong side effects that have to be understood and carefully evaluated.
No-duplex configuration consists of a setup having a strong AGC. Doing so, when the AGC measure a signal on downlink path (i.e. the far-end user is talking), a null gain is applied to uplink path and the microphone is muted. In this way, the echo will be suppressed, but also the near-end user.
Figure 9 Far and near end user speaking in the meanwhile
Figure 10: No-duplex vs duplex mode
No-duplex mode (strong AGC) Partial Duplex (weak AGC)
Pros: Pros:
Mic/Loudspeaker levels can be popped up at max
The echo at far-end is completely removed
Near-end speech not completely muted during double talk
Near-end more intelligible also
It allows the understanding of the near-end device even if there is some background noise at the far-end device.
Cons: Cons:
The near-end is muted by AGC when the far-end user is speaking but also if there is high background noise (e.g. call
center) at far-end, not filtered out by far-end device.
Some residual echo could still exist, but it does not disturb the conversation.
Loudspeaker at max level could produce clipping during double talk and an increased echo
DUT
Gain
FAR END
sDL
AGC
echo
uplinked
speechnear end
speech
Far-
end
speech
Gain
mute
unmute
ech
o
Near end
speech
UpLi
nked
speech
mute
unmute
Gain
When the far-end MIC capture a sound,
the near-end speech is muted.
The far-end user will not hear anything from the near-end side; no echo, but neither the near
end speech
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information Audio profiles management
Page 27 of 39
5 Audio profiles management
5.1 Personal profiles
The audio parameters configuration for the audio paths can be saved in two personal profiles. Each of them
consist of two different files (voice<X>.nvm and audio_gain_calibration<X>.xml, with <X>=0 or 1)
stored in the file system and having the “AUDIO” tag.
At the module boot, the module loads the audio parameters from the selected personal profile, depending on AT&Y setting (the default value is 0). Any change to the setting in the current profile is not stored in NVM and, if needed, it can be stored in one of the personal profiles by using AT&W<n> command.
An audio configuration can be loaded at any time from one of the personal profiles using ATZ<n> command.
Factory-programmed values can be recovered at any time issuing the AT&F command.
These audio files within the personal profiles can be managed (stored, retrieved and deleted) by using file system AT commands. See the u-blox AT Commands Manual [1] for further details about personal profiles management by means of the commands AT&W, AT&Y, ATZ and AT&F.
Personal profile 1
Personal profile 0• AUDIO tag files:
voice0.nvm
audio_gain_calibration0.xml
Factory-programmed values• not accessible by user
Current profile•volatile
AT&W<n>
ATZ <n>
AT&F
Figure 11: Profiles
Each Personal profile contains 5 acoustic profiles. An acoustic profile identifies the set of parameters loaded from volatile memory (current personal profile) in the speech processing blocks when an audio path is enabled. The acoustic profile in use can be selected by +USPM command (see <main_uplink>, <main_downlink> description for +USPM command in u-blox AT Commands Manual [1]). The default configuration is:
+USPM: 1,1,0,0,2
Thus <main_uplink>=1, <main_downlink>=1. Thus acoustic profile 1 is the default.
The <profile> parameter in the +UAPT command identifies the corresponding acoustic profile. Audio parameters stored for each acoustic profile are organized in blocks and distinct for NB and WB scenarios, as described in the section 4.1.
Default parameters have been optimized for generic devices:
Acoustic profile 0: generic earpiece
Acoustic profile 1: generic speaker (default)
Acoustic profile 2: generic headset 4 poles
Acoustic profile 3: generic headset 3 poles
Acoustic profile 4: spare
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information Audio profiles management
Page 28 of 39
5.1.1 Managing personal profiles using m-center
m-center tool (from release 01.06.00) allows users to easily manage audio files included in the personal profiles.
Switch to File System page, type AUDIO in the tag text box and click the "Dir" button to get the list of the audio files in the FS.
Figure 12: m-center File System AUDIO files
[Store File] Read a file from PC and download it to the module FS
[Retrieve File] Read the selected file from the module FS and store it to PC
[Delete File] Deletes the selected file from the module FS
5.2 Factory-programmed profile
A third profile, not accessible to the users, stores the factory-programmed settings. AT&F loads these settings in the current profile and then restores the audio configuration to the factory-programmed values. Since the current profile is volatile, these changes will be permanent only if they will be stored in a personal profile.
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information Mobile Voice Tuning tool
Page 29 of 39
6 Mobile Voice Tuning tool The Mobile Voice Tuning (MVT) is an audio tool helpful to compose the AT commands to calibrate any voice module in TOBY-L2. It also enables the user to design equalizer and bi-quad filters for uplink and downlink.
MVT allows editing audio parameters stored in TOBY-L2 module voice0.nvm and voice1.nvm files. These files can be downloaded from the module using m-center tool (ver. 01.07.00 or later):
Run n m-center as administrator. You can save the file in the MVT installation folder
Connect the module. Open the m-center File System Page
Define the tag AUDIO in the “Tag” box at the top right side of the panel.
Press the "Dir" button to get a listing of AUDIO tagged files present in the module's memory
Listed files are:
voice0.nvm, audio_gain_calibration0.xml (This is the audio part the personal profile 0).
voice1.nvm, audio_gain_calibration1.xml (This is the audio part the personal profile 1).
Select a voice*.nvm file in the file system you will edit for custom audio system tuning.
Press the "Retrieve File" button to copy voice0.nvm or voice1.nvm file from module's File System to user's PC.
Store the file as voice.nvm in the …\MobileVoiceTuning\Bin\DB folder (replace existing file)
Open MVT
In the MVT tool, use the file selector to choose voice.nvm file; Confirm selection by “Choose” button
MVT allows viewing and editing every parameter in the voice.nvm file. Selectors can be used to switch between profiles, TX/RX, NB/WB and voice modules:
0: Echo Cancellation ("EC") TX
1: Residual Echo Suppression ("RES") TX
2: Noise Suppression ("NS") TX/RX
3: Low Pass Filter ("LPF") TX/RX
4: High Pass Filter ("HPF") TX/RX
5: Equalizer ("EQU") TX/RX
6: Additional Gain Control ("AGC") TX/RX
7: Dynamic Range Compression ("DRC") TX/RX
8: Microphone Levels ("ML") TX
Once a parameter value is edited, the corresponding AT+UAPT command is prepared by pressing the refresh button (green arrow icon). Use the “copy” button to copy the command in a buffer for pasting in the m-center AT–terminal.
If done during a call, add command AT+UAPT=0 to reload voice parameters from the memory.
This is a quick way to test the effect of a parameter change.
Changed parameters can be saved in the voice.nvm file by button “Write Params to NVM file”. (Warning: switching voice module after editing without saving can cause the edited values to be lost).
Copy voice.nvm as voice0.nvm or voice1.nvm and use the “Store File” button in m-center File System Page to store this file in the module. Reload profile by command atz0 or atz1 respectively.
The effectiveness of parameters change can be checked by AT+UAPT=7 (Get parameters list) command; e.g.:
Command generated by MVT to modify parameters on path 2, Tx direction, NB, AGC module is:
AT+UAPT=8,2,0,0,6,0,0,8,0,-26,-5,90,0,0,0,-5
The corresponding command to get parameters can be obtained substituting <op_code> 8 with 7 and using the first 6 parameters only is:
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information Mobile Voice Tuning tool
Page 30 of 39
Command Response Description
AT+UAPT=7,2,0,0,6,0 +UAPT:
ParameterID,
Value:
0,0
1,-26
2,-5
3,90
4,0
5,0
6,0
7,-5
8,-24376
OK
To enable or disable a Voice Module:
Set the Property “Control” of the Voice Module to “Enable” or “Disable” and save to NVM.
Alternatively use the command
AT+UAPT=6,<profile>,<app>,<direction>,<blockID>,<enableState>
e.g.: to disable AGC on Tx path of profile 2, use:
AT+UAPT=6,2,0,0,6,0
AT+UAPT=0
The “Control” Property is common for both NB and WB.
To check status of all Voice Modules, use:
AT+UAPT=5,<profile>,<app>,<direction>
Command Response Description
AT+UAPT=5,2,0,0 +UAPT:
ModuleID,
State:
0,1
1,1
2,1
3,1
4,1
5,1
6,0
7,1
8,1
OK
Check status on Rx path of profile 2
A certain Voice Module parameter configuration can be exported as a file by "Export Parameters" button and then, e.g. imported in another profile; to do this just switch the profile by the “Profile” selector and use the "Import" button to select the previously saved file.
The voice.nvm file can be exported to text file by a dedicated button of MVT. Vice-versa a text file can be
imported in voice.nvm. This is a readable format with extended names and values of all parameters, ordered
by profiles and Voice Modules and it is useful e.g. to compare quickly different revisions of parameters in text format.
For a complete description see the MVT User Guide [3].
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information External codec management
Page 31 of 39
7 External codec management TOBY-L2 series modules provide an I
2S digital audio interface to connect an external audio device, e.g. a codec.
The Application Processor (AP) should manage the codec.
This section includes an example of architecture for the module / external codec / AP system. In the block diagrams the HW implementation is highly simplified; for more detailed examples of HW implementation, see the TOBY-L2 series System Integration Manual [2]
For more details about the AT commands used in the examples below, see the u-blox AT Commands Manual [1].
TOBY-L2 series modules support additional resources to manage the external codec:
Master Clock Control AT command +UMCLK: this command provides the codec with a 13/26 MHz clock generated from the module.
I2S control command +UI2S extension: new connection modes supported by <I2S_port> parameter.
I2C control commands (+UI2CO, +UI2CW, +UI2CR, +UI2CREGR, +UI2CC). These commands allow sending
commands from the module to the codec through a standard I2C interface. In the examples it is considered
an external codec that can be controlled writing in its registers by I2C interface. Addresses, meanings and
field structures and the registers depend on the specific codec and should be chosen used referring to the specific codec manual.
The AP can monitor the audio activity on the module enabling the +CIEV URCs. The +CIEV URCs on the AT terminal can be generated when the audio activities are running on the module, issuing the command AT+CMER=1,0,0,2,1.
Figure 13 shows a possible architecture for the TOBY-L2 series module / external codec / AP system.
TOBY-L2
series module
AP
VCC REG.
SPK_COD
MIC_COD
I2S
VCC_EN
I2C CODEC_CLK
AT +USPM AT+UI2S
AT+CMERAT+UMCLK
AT+UI2C*
+CIEV
EXT CODEC
Figure 13: External codec management for TOBY-L2 series module
Section 7.1 shows an example of the codec management scenario based on this architecture.
The examples proposed are for a Maxim MAX9860 audio voice codec connected to a TOBY-L2 series module through the I
2S interface as in the evaluation board.
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information External codec management
Page 32 of 39
7.1 Setting
At system start-up, the AP should enable the codec supply by VCC_EN
Configure the module and the codec with a sequence of AT commands
Command Response Description
AT+USPM=255,255,0,0,2 OK AT+USPM=<main_uplink>,<main_downlink>,<alert_sound>, <headset_indication>,<vmic_ctrl>
<main_uplink>=255: uplink path is NULL (I2S_RX line not enabled)
<main_downlink>=255: downlink path is NULL (I2S_TX not enabled)
Disable I2S. This allows setting of the I2S properties (I
2S properties cannot be
changed while I2S is in use, i.e. the paths are via I
2S).
AT+UI2S=22,1,0,3,0 OK AT+UI2S=<I2S_mode>,<I2S_port>,<I2S_clk_wa>,<I2S_sample_rate>, <I2S_Master_Slave>
<I2S_mode>=22: PCM mode, Rising CLK edge for RX
<I2S_port>=1: connect I2S to I2Sx connection point
<I2S_clk_wa>=0: dynamic mode (I2S_CLK and I2S_WA outputs are active and running only while audio path is active)
<I2S_sample_rate>=3: 16 kHz sampling rate
<I2S_Master_Slave>=0: master mode (default value if parameter is not specified). In master mode I2S_CLK, I2S_WA, I2S_TX are generated by the
module as output. I2S_RX is an input signal
AT+USPM=1,1,0,0,2 OK AT+USPM=<main_uplink>,<main_downlink>,<alert_sound>,
<headset_indication>,<vmic_ctrl>
<main_uplink>=1: uplink path 1 via I2S (1 for e.g.; any path via I2S is ok)
<main_downlink>=1: uplink path 1 via I2S (1 for e.g.; any path via I2S is ok)
Change audio path to I2S. This is the port connected to the external codec
on EVB
AT+UAPT=0 OK AT+UMCLK=<op_code>
<op_code>=0; reloads voice parameters and configurations from the memory
AT+UMCLK=2,0 OK AT+UMCLK=<mclk_mode>,<enabling_mode>
<mclk_mode>=2: codec master clock at 13 MHz
<enabling_mode>=0: “Audio dependent” mode (the clock is applied to the CODEC_CLK pin only when the audio path is active (audio samples are read on the I2S_RX line and written on the I2S_TX line. For this codec
it is not needed to maintain the clock while I2S is not running, since just
the voltage supply is needed to make I2C work. Be aware that other
codecs could need to maintain the clock running also for register programming. This can be achieved by <enabling_mode>=1:
“Continuous” mode
AT+UI2CO=1,0,0,0x10,0 OK AT+UI2CO=<I2C_controller_number>,<bus_mode>,<bit_rate>, <device_address>,<address_width>
Open logical channel for the Maxim external codec on I2C
<I2C_controller_number>=1: controller 1
<bus_mode>=0: Bus Mode Standard (0 – 100 kb)
<bit_rate>=0: I2C bit rate is 100 kb/s
<device_address>=0x10: Device Address in HEX format; this address can be found in the coded datasheet
<address_width>=0: 7 bit address
AT+UI2CW="00000000101E3F2400
000633004A0000008A",18
OK AT+UI2CW=<hex_data>,<nof_byte_to_write>
<hex_data>= first register address, value for 1st register, value for 2
nd
register, etc. (17 registers values)
<nof_byte_to_write>=18 (register address +17 registers values)
Writing in the register configure the codec (gains, I2S configuration, clock
configuration, etc. Adresses, meanings and field structures and the registers depends on the specific codec; This example is for Max9860;
Refer to Max9860 datasheet for details about this example)
AT+UI2CW="049E",2 OK As above; write byte 0x9E in register 0x04; See Max9860 datasheet for meanings of registers values
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information External codec management
Page 33 of 39
Command Response Description
AT+UI2CC OK Close logical channel on I2C
The codec is now initialized and ready to work when the module starts audio
activity; e.g. for audio test
AT+UPAR=0,0,0 OK A tone with infinite repetitions can be started by command. The module enables 13 MHz clock signal on CODEC_CLK pin. I
2S is enabled and starts to
transmit tone data. The tone is played on the loudspeaker by the codec.
AT+USAR=0 OK The command stops the tone. The module stops transmission of audio data on I2S and disable 13 MHz clock signal
The codec supply is maintained up also after the codec is not used anymore.
7.2 External device configuration +UEXTDCONF
This command can be used for an external device configuration, e.g. an audio codec, at boot time. The setting (on / off) for each supported device is saved in NVM and applied each time the module is powered on. The configuration for each supported device is hard-coded in the firmware.
Command Response Description
AT+UEXTDCONF=0,1 OK <device_id>=0: Maxim Max9860 audio codec, connected via I2C
<configuration_enable>=1: enabled
AT+CPWROFF OK
Once this procedure has been executed, it is no longer necessary to repeat the procedure in the section 7.1 after each system boot.
When enabled, at every startup the module sets the external codec master clock at audio dependent 13 MHz (corresponding to the command AT+UMCLK=2,0) and configures the external codec via I2C.
Initial setting correspond to command
AT+UI2CO=1,0,0,0x10,0
AT+UI2CW="00000000100F20240000103300500000008A ",18
AT+UI2CW="048F",2
AT+UI2CC
In this way external codec is Maxim MAX9860 programmed and reset after boot. Furthermore the external codec is programmed dynamically via I2C commands every time audio path is enabled, according to gains stored in file audio_gain_calibration0.xml or audio_gain_calibration1.xml (depending on profile set by AT&Y) Gains can be edited by Volume Gain Control command +UVGC; Editable gains for Maxim9860 are:
DVA (DAC Level Adjust)
DVST (Sidetone Level)
PAM (Microphone Preamplifier)
PGAM (Microphone amplifier)
(For details, see the u-blox AT Commands Manual [1], +UVGC command)
E.g.: Status after programming can be verified by these read commands:
Command Response Description
AT+UMCLK? +UMCLK: 2,0
OK
read master clk setting
codec master clock is set at 13 MHz, audio dependent mode
AT+UI2CO=1,0,0,0x10,0 OK Open logical channel for the Maxim external codec on I2C
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information External codec management
Page 34 of 39
Command Response Description
AT+UI2CREGR=0x00,17 +UI2CR: 0: 0x00
+UI2CR: 1: 0x00
+UI2CR: 2: 0x00
+UI2CR: 3: 0x10
+UI2CR: 4: 0x8F
+UI2CR: 5: 0x20
+UI2CR: 6: 0x24
+UI2CR: 7: 0x00
+UI2CR: 8: 0x00
+UI2CR: 9: 0x10
+UI2CR: 10: 0x33
+UI2CR: 11: 0x00
+UI2CR: 12: 0x50
+UI2CR: 13: 0x00
+UI2CR: 14: 0x00
+UI2CR: 15: 0x00
+UI2CR: 16: 0x8A
OK
Read 17 registers of codec, starting from register 0x00;
Refer to Max9860 datasheet for meanings and field structures and the
registers
In register 9 of Max9860, bits 7:0 are reserved for DVA gain (DAC attenuation)
In register 11 of Max9860, bits 4:0 are reserved for DVST gain
(sidetone)
In register 12 of Max9860, bits 6:5 are reserved for PAM gain (Left and right microphone preamp gain) ; bits 4:0 are reserved for PGAM gain
(Left and right microphone gain);
AT+UI2CC OK
The setting of Max9860 registers reserved to gains can be changed by Volume Gain Control command +UVGC, e.g:
AT+UVGC=0,0 +UVGC: -5 reads the DVA setting, in dB; see AT manual for details
AT+UVGC =0,0,-8 sets DVA to -8dB;
The driver will write the corresponding code in the codec register; just for didactic purposes, this can be verified e.g. reading value of register directly, by
AT+UI2CO=1,0,0,0x10,0
AT+UI2CREG=0x09,1 +UI2CR: 0: 0x16 Read 1 registers of codec, starting from register 0x09 (thus, the register itself).
Register 9 value is changed bits 7:0 are reserved for DVA gain
AT+UI2CC OK
The +UVGC settings can be stored in audio_gain_calibration0.xml or audio_gain_calibration1.xml by AT&W0 or AT&W1 command respectively. Once saved, they can be downloaded from the module using m-center tool (ver.1.07.00 or later) as explained for voice0.nvm, voice1.nvm files (“Retrieve file” button on the m-center/File System window). Thus they can be uploaded to others modules by “Store file” button on the m-center/File System window. This allows coping audio calibration parameters from a golden sample to all the produced modules.
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information EVK suggested parameters
Page 35 of 39
8 EVK suggested parameters
For use with EVK-L2 (Maxim8960 external codec mounted) and companion EVK headset (EAB-729_Rev1 -HDC5 compatible earphones) the following comand sequence is suggested (to be run just once after each FW flashing):
Command Description
AT+UEXTDCONF=0,1 Enable the external codec Maxim8960
AT+USPM=2,2,0,0 Set the headset 3 poles acoustic profile
AT+UVGC=0,3,8 Change the gain of microphone amplifier on Max9860
AT+UAPT=6,2,0,0,5,0 Disable the rqualizer on uplink headset profile
AT+UAPT=6,2,0,1,5,0 Disable the equalizer on downlik headset profile
AT+UAPT=8,2,0,1,6,0,1,1,-20 Set AGC, loudness Target, NB to -20 dB on downlik headset profile
AT+UAPT=8,2,0,1,6,1,1,1,-20 Set AGC, loudness Target, WB to -20 dB on downlik headset profile
AT&W0 Save parameters on the profile 0
AT&Y0 Set the profile 0 as default
AT+CFUN=16 Reboot the module
See the u-blox AT Commands Manual [1] for further details about these commands.
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information Supported speech codecs
Page 36 of 39
9 Supported speech codecs TOBY-L2 supports the following speech codecs on the air interface:
for GSM:
o Full Rate speech codec (8 kHz sampling rate)
o Enhanced Full Rate speech codec (8 kHz sampling rate)
o Half Rate speech codec (8 kHz sampling rate)
o NB-AMR speech codec (8 kHz sampling rate)
o WB-AMR speech codec (16 kHz sampling rate)
for UMTS:
o NB-AMR speech codec (8 kHz sampling rate)
o WB-AMR speech codec (16 kHz sampling rate)
The encoder is placed between the Tx After Enhancement (TxAE) audio signal and the Radio Tx signal. The decoder is placed between the Radio Rx signal and the Rx Before Enhancement (RxBE) audio signal (see block diagram in section 4.1).
The enabling of codecs during the call is managed internally by the audio driver. When changing 8 kHz /16kHz sampling rate, the audio driver automatically reload the NB/WB audio parameters stored in the acoustic profile in use.
Allowed speech codecs to be presented to the network during a voice call setup are configured by means of the AT+UDCONF=30 command (see the u-blox AT Commands Manual [1] for the command description).
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information Appendix
Page 37 of 39
Appendix
A List of acronyms Abbreviation / Term Explanation / Definition
AP Application Processor
AT AT Command Interpreter Software Subsystem, or attention
CN Comfort Noise
CNG Comfort Noise Generation / Comfort Noise Generator
dBFS dB Full Scale
DRC Dynamic Range Compression
DT Double Talk
EC Echo Cancellation
EP Earpiece
FIR Finite Impulse Response filter
HF Hands-free Algorithm
HPF High Pass Filter
LEM Loudspeaker-Enclosure-Microphone
LPF Low Pass Filter
ML Microphone Levels
NB Narrow Band
NLMS Normalized Least Mean Square
NR Noise Reduction algorithm
NRES Noise and Residual Echo Suppression
RES Residual Echo Suppression
RLR Receiving Loudness Rating
Rx-NS Rx Noise Suppressor
RxAe Rx After Enhancement
RxBe Rx Before Enhancement
SLR Sending Loudness Rating
SNR Signal to Noise Ratio
SP Loudspeaker
Tx-NS Tx Noise Suppressor
TxAe Tx After Enhancement
TxBe Tx Before Enhancement
WB Wide Band
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information Related documents
Page 38 of 39
Related documents [1] u-blox AT Commands Manual, Docu No UBX-13002752
[2] TOBY-L2 series System Integration Manual Docu No UBX-13004618
[3] MVT User Guide Docu No UBX-15032323
Revision history
Revision Date Name Status / Comments
R01 03-May-2016 mrod Initial release release
TOBY-L2 series - Application Note
UBX-15015834 - R01 Early Production Information Contact
Page 39 of 39
Contact For complete contact information visit us at www.u-blox.com
u-blox Offices
North, Central and South America
u-blox America, Inc.
Phone: +1 703 483 3180 E-mail: [email protected]
Regional Office West Coast:
Phone: +1 408 573 3640 E-mail: [email protected]
Technical Support:
Phone: +1 703 483 3185 E-mail: [email protected]
Headquarters
Europe, Middle East, Africa
u-blox AG
Phone: +41 44 722 74 44 E-mail: [email protected] Support: [email protected]
Asia, Australia, Pacific
u-blox Singapore Pte. Ltd.
Phone: +65 6734 3811 E-mail: [email protected] Support: [email protected]
Regional Office Australia:
Phone: +61 2 8448 2016 E-mail: [email protected] Support: [email protected]
Regional Office China (Beijing):
Phone: +86 10 68 133 545 E-mail: [email protected] Support: [email protected]
Regional Office China (Chongqing):
Phone: +86 23 6815 1588 E-mail: [email protected] Support: [email protected]
Regional Office China (Shanghai):
Phone: +86 21 6090 4832 E-mail: [email protected] Support: [email protected]
Regional Office China (Shenzhen):
Phone: +86 755 8627 1083 E-mail: [email protected] Support: [email protected]
Regional Office India:
Phone: +91 80 4050 9200 E-mail: [email protected] Support: [email protected]
Regional Office Japan (Osaka):
Phone: +81 6 6941 3660 E-mail: [email protected] Support: [email protected]
Regional Office Japan (Tokyo):
Phone: +81 3 5775 3850 E-mail: [email protected] Support: [email protected]
Regional Office Korea:
Phone: +82 2 542 0861 E-mail: [email protected] Support: [email protected]
Regional Office Taiwan:
Phone: +886 2 2657 1090 E-mail: [email protected] Support: [email protected]