欢迎您 登录 |  注册 | 找回密码

产品
产品资讯

技术
设计与应用

工业应用
汽车电子
电源
更多参考设计

总评分:简直是完美

9.8

760人评分    2404关注    3548639次浏览

我的评分

  

专题名称:德州仪器社区
官方网址:进入官方网站

返回本专题首页

加快 TPA2028D1对突发音信号(短暂提示音)的响应

作者:TI德州仪器   2013-07-16   来源:   评论:0条    浏览:962

摘要d0bbd37【中国自动化网社区】1e6c08【http://sns.ca800.com】1392
1b42af【中国自动化网社区】172d9c【http://sns.ca800.com】f387e
TPA2028D1 是 TI 针对便携设备推出的具有 AGC/DRC 功能的低功耗 D 类放大器。由于性能突出,在业界得到了广泛的应用。而其本身可以通过 I2C 进行配置,从而使得设计者能够根据不同的应用,优化芯片设置,获得更好的效果。1b42af【中国自动化网社区】172d9c【http://sns.ca800.com】f387e
6ff8cd9【中国自动化网社区】48a20d【http://sns.ca800.com】971e
本文讨论了怎样优化 TPA2028D1 设置,使其能够更好的快速响应智能手机等设备中的突发音,例如键盘音,提示音等信号。6ff8cd9【中国自动化网社区】48a20d【http://sns.ca800.com】971e
6ff8cd9【中国自动化网社区】48a20d【http://sns.ca800.com】971e
1.介绍6d90【中国自动化网社区】66e8a3【http://sns.ca800.com】61fd
6d90【中国自动化网社区】66e8a3【http://sns.ca800.com】61fd
TPA2028D1 是 TI 针对移动设备推出的高效率 D 类放大器。所集成的 DRC 和 AGC 功能能够根据输入信号的大小自动调整放大器的增益,以达到防止功放削波失真的目的,并且有效的提升输出平均功率,从而改善音乐的回放效果。6d90【中国自动化网社区】66e8a3【http://sns.ca800.com】61fd
6d90【中国自动化网社区】66e8a3【http://sns.ca800.com】61fd
TPA2028D1 具有灵活的可配置性。设计者能够通过 I2C 访问其寄存器,对放大器使能,增益,响应速度等多个参数进行配置,使其能够针对不同的应用场景进行优化。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
由于 DRC 和 AGC 会根据信号大小调节增益,针对连续的音乐信号需要设置一定的 Attack Time 和Release Time 来保证优良的回放效果。但是对于突发音信号维持时间过短,并且由于省电的需要,需要在播放前使能 TPA2028D1,并在播放结束后将其关闭。因此一些设计中,在播放例如键盘音或拍照音的时候存在声音过小,或声音渐变等现象。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
本文通过对此现象的成因进行分析,讨论了如何通过优化芯片参数的设置,解决类似问题的方法。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
2.TPA2028的两种关闭/使能方式927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
TPA2028可以通过硬件和软件两种方式进行关闭和使能。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
通过芯片 EN管脚,硬件的使能关闭方式;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
通过芯片寄存器 0x01 bit6 EN和 bit5 SWS,软件的使能关闭方式927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
2.1 硬件关闭/使能927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
关闭:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
EN管脚置低,芯片进入关闭状态,所有寄存器被清除927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
使能:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
EN管脚置高,芯片进入使能状态,所有寄存器进入初始状态,如 Table 1。由于在初始状态寄存器 0x01 EN=1 SWS=0 ,功放部分使能,可以直接进行播放;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
Table 1. TPA2028D1寄存器初始值927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
TPA2028D1的设计为,芯片使能后放大器初始增益由 Fixed Gain决定。而 TPA2028D1 Fixed Gain寄存器 Reg5/bit5:0 初始值为 00110,即 6dB,因此在此状态下放大器的增益初始值固定为 6dB。由于Max Gain寄存器 Reg7/bit7:4初始值为 30dB,因此此时播放的信号以 Release time寄存器 Reg3/bit5:0的初始值 1.81秒/6dB的速度,从 6dB慢慢向 30dB增加。如 Figure 1所示。因此会造成明显的淡入效果,对于存在时间过于短暂的信号,则造成过小的现象。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
Figure 1. 硬件使能 TPA2028D1增益递增927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
2.2软件关闭/使能927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
关闭:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
EN=0 (Reg1/bit6)或者 SWS=1 (Reg1/bit5)927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
使能:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
EN=1 (Reg1/bit6)或者 SWS=0 (Reg1/bit5)927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
EN 和 SWS 不会清除寄存器的设定状态,所有寄存器值维持原先的设置,因此 TPA2028D1 在软件使能之后可以按照设定的 Fixed Gain和 Max Gain以及 Release Time进行变化。如 Figure 2所示。因此只需要设置合适的 Fixed Gain, Max Gain 和 Release Time,就可以控制这种变化,从而消除 AGC和DRC带来的淡入淡出问题。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
Figure 2. 硬件使能 TPA2028D1增益递增927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
值得注意的是,由于芯片内部状态的建立需要时间,因此会产生一定的输出延迟。TPA2028 的延迟在 6ms 左右,由于这个时间相对 Ramp up 的时间相对短暂,而且处理器播放突发音时普遍存在一定的延迟,所以在一般的设计中输出延迟可以忽略。但如果在实际的应用中有处理器播放未加延迟的情况,则可以通过在处理器播放突发音文件前加入 6ms延迟来解决。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
Figure 3. 输出延迟927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
3. 利用不同的应用模式选择合适的参数设置927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
根据上面对突发音淡入现象原因的分析,为了解决 TPA2028D1 对突发音信号的响应问题,解决问题的方式为:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
用软件使能 TPA2028D1代替硬件使能;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
缩小设置的 Fixed Gain和 Max Gain之间的差别。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
但由于音乐播放等应用中,Fixed Gain和 Max Gain仍需要存在一定的差别。因此我们可以通过:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
找到一组中间参数能够平衡连续的音乐播放和突发音播放效果;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
根据不同的应用判断是否存在突发音的播放,分别针对连续音乐的播放和突发音的播放设置两套不同的参数。由于在实际应用中,使能 TPA2028D1,播放突发音,再关闭,的应用都是在一些特定的应用下进行。例如播放拍照音时,设备一般处于拍照状态;键盘音,设备处于键盘输入状态。因此我们可以根据不用的应用决定 TPA2028 参数的设置,使得在消除突发音淡入淡出效果时,不影响到音乐的播放效果。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
由于现存的智能便携设备操作系统应用程序处于 UI层,而控制 TPA2028D1的驱动处于驱动层,因此需要通过驱动读取操作系统的相关 log文件对于应用程序进行判断。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
3.1适合突发音的设置927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
由于快速信号和音乐动态范围和播放幅度不一样,因此可以选择独立于音乐播放之外的另一套更适合快速信号播放的 TPA2028的参数。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
选择提示音播放增益。因为 TPA2028在芯片输出使能后,增益会从 Fixed Gain向 Max Gain变化,因此缩小 Fixed Gain 与 Max Gain 的区别(3dB 以内的增益变化一般不会引起听觉响度明显的变化),能够限制 Gain的大幅变化。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
选择这个增益时还需要注意信号幅度和最大音量之间的关系,防止提示音过小或过大引起的问题。对于峰峰值在 500mV左右的输出信号,建议的增益设置在 18dB~22dB之间。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
由于快速信号动态范围相对固定,因此一般不需要 DRC的介入,因此建议设置压缩比为 1:1。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
当增益的变化被控制在较小的变化范围以内,Attack Time, Hold Time和 Release Time等参数对于渐变的影响就变得相对较小,但仍建议尽量减小将这几个参数的值。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
此外,因为软件关闭芯片后,芯片的 I2C 部分仍然使能,因此相比硬件关闭芯片功耗要高。在 3.6V至 4.2V 范围内,硬件关闭芯片,静态电流在 0.2uA 至 0.3uA 之间。而使用软件关闭芯片后,芯片的静态电流在 50uA至 65uA之间。因此在设备进入待机后可以硬件关闭 TPA2028。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
3.2突发音设置的时序控制927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
因为在开机或者退出待机状态等情况下,仍然存在 EN 从拉低状态到拉高状态的变化,此时TPA2028D1 所有寄存器值均为初始状态。因此在一次进入突发音播放的情况下,我们需要设置芯片寄存器参数,使其适合突发音信号的播放。而使用软件使能和关闭芯片,不会清除寄存器的状态,因此之后使用软件关闭芯片后,再次使能前则不需要重新设置寄存器参数。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
首次使能时序的控制:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
将 EN管脚拉高,使能芯片;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
在 6ms内使用 I2C将 SWS设置为 1,软件关闭 TPA2028;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
设置 Fixed Gain和 Max Gain,以及 Attack/Release Time;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
使用 I2C将 SWS设置为 0,软件使能 TPA2028;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
延迟 6ms后开始进行突发音的播放。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
关闭时序的控制:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
保持 EN管脚拉高,芯片一直处于使能状态;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
使用 I2C将 SWS设置为 1,软件关闭 TPA2028;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
再次使能时序的控制927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
使用 I2C将 SWS设置为 0,软件使能 TPA2028;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
延迟 6ms后开始进行突发音的播放。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
3.3实际案例927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
Android 智能手机,TPA2028D1 的应用中,出现了电话拨号的应用中,连续按拨号键,按键提示音逐渐变大的现象。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
检查按键音播放的流程为:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
进入电话拨号应用程序后,TPA2028D1的 EN管脚被拉低;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
处理器得到按键键值后,读取按键音音频文件,并同时拉高 EN脚进行播放;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
延时 1秒,如果没有其他键按下,则拉低 EN脚关闭 TPA2028D1。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
用 1kHz连续信号代替按键音,实测 TPA2028D1输出波形如 Figure 4,信号缓慢增加,音量由小到大渐变。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
Figure 4. 实际案例更改前 TPA2028D1输出递增波形927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
更改播放时序如下:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
进入电话拨号应用程序后,拉高 TPA2028D1的 EN管脚;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
通过 I2C设置芯片:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
I2CWrite(0xb0, 0x01, 0xe3); //SWS=1, disable TPA2028D1927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
I2CWrite(0xb0, 0x05, 0x1e); //Fixed Gain=30dB927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
I2CWrite(0xb0, 0x07, 0xc0); //Max Gain=30dB927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
处理器得到按键键值后,读取按键音音频文件,同时通过 I2C设置芯片:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
I2CWrite(0xb0, 0x01, 0xc3); //SWS=1, enable TPA2028D1927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
使能 TPA2028,进行按键音播放;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
延时 1秒,如果没有其他键按下,则同时通过 I2C设置芯片:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
I2CWrite(0xb0, 0x01, 0xe3); //SWS=1, disable TPA2028D1927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
关闭 TPA2028。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
手机推出电话拨号应用程序后,或者手机进入待机状态后拉低 TPA2028D1的 EN管脚。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
实测波形如 Figure 5。实际使用中,连续按按键,按键提示音正常。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
Figure 5. 实际案例更改后输出波形927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
4 小结927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
TPA2028D1由于加入了有效改善音乐重放效果的 AGC/DRC,其中包含的延迟设置,无法对于突发音等短暂信号起到快速响应的效果。在我们的实际应用中,如果能够从以下两个方面完善设计:927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
判断播放模式,区分音乐和突发音的应用场景,分别优化参数设置;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
以软件方式使能或者关闭芯片;927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
即可达到更优的播放效果。927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
参考资料927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
927【中国自动化网社区】f709f1【http://sns.ca800.com】22df8
1. datasheet (TPA2028D1.pdf)

评论

内容加载中,请稍候...
内  容:

中国自动化网 版权所有  © 2010 - 2016     经营许可证编号: 粤ICP备09051729