1.在做项目的过程中,对于volume 我们有一个volume curve,就是 0~63 step,每个step对应一个dB值,例如0step对应-90dB, 63 step对应0dB。关于这个0dB,是由客户规定的,最大的输出是9V,20W,阻抗4Ω。dB一般是负值,dBa是由分贝仪测出来的,dBa有一套专门的标准来测

2.Balance(左右) 和 Fader(前后)是用来调节左右前后音量的, 调节Balance,对左边或者邮编的dB进行减少,Fader调前后,可以见下图

3.Loudness,对于当前音量,有一个低频/高频的音量补偿,直接上代码,

 ;
 /*take care of this value, volume table boost 18db for each step,
 so when calculate the volume table + LoudnessOffset, need
 attentuate 18db, so define the init value to -18*/
 ;
 static float OffsetPoints[CalNofPoints] = {0.0F, -10.0F, -20.0F, -30.0F, -40.0F, -50.0F, -60.0F, -70.0F,-80.0F, -90.0F, -90.0F};
 static float BassBoostValues[CalNofPoints] = {0.0F, 0.0F, 0.0F, 2.0F, 5.0F, 6.0F, 7.0F, 12.0F, 13.5F, 15.0F, 15.0F};
 static float BassFilterFrequence[CalNofPoints] = {80.0F, 80.0F, 80.0F, 80.0F, 100.0F, 200.0F, 250.0F, 350.0F, 400.0F, 400.0F, 400.0F};
 static float TrebleBoostValues[CalNofPoints] = {0.0F, 0.0F, 0.0F, 1.0F, 1.5F, 2.5F, 3.5F, 4.0F, 4.5F, 5.0F, 5.0F};
 static float TrebleFilterFrequence[CalNofPoints] = {12000.0F, 12000.0F, 12000.0F, 12000.0F, 12000.0F, 11000.0F, 10000.0F, 9000.0F, 8000.0F, 7000.0F, 7000.0F};

 float interpolate(float const x, uint_t const nof, float const xValues[], float const yValues[])//return y
 {
     float yRetval = 0.0F;
     //yValues are expected to be constant rising or falling
     //nof at least 2 otherwise there is nothing to interpolate
     <=nof)
     {
         uint_t ;
         ] < xValues[last];
         //check lower limit
         ]))
             || ((!rising) && (x > xValues[]))
             )
         {
             yRetval = yValues[];
         }
         //check upper limit
         else if (   ( (rising) && (x > xValues[last]))
             || ((!rising) && (x < xValues[last]))
             )
         {
             yRetval = yValues[last];
         }
         else//interpolate
         {
             //find index for x value
             uint_t index = ;
             ;i<last;i++)
             {
                 ]) )
                     ||( (!rising) && (xValues[i] >= x) &&(x >= xValues[i+]) )
                     )
                 {
                     index = i;
                     break;
                 }
             }
             //interpolate
             ];
             ];
             //check xDiff not 0
             if (fabs(xDiff) <= FLT_EPSILON)
             {
                 yRetval = yValues[index];
             }
             else//xDiff not 0 -> calculate y
             {
                 const float gradient = yDiff / xDiff;
                 const float yOffset = (x-xValues[index]) * gradient;
                 yRetval = yValues[index] + yOffset;
             }
         }
     }//check nof
     return yRetval;
 }

 bool_t CavDiranaRoutingCfg::getLoudnessCurveBoost(uint16_t filterID, uint16_t cfgID, float volume, float& loudnessBoost) const
 {
     bool_t retval = true;
     if(m_isLoudnessEnable == true)
     {
         ;
         EFilterID filtertype = static_cast<EFilterID>(filterID);
         loudnessBoost = ;

         //volume -> loudnessBoost
         OverallOffset = LoudnessOffset + volume;
         if (filtertype == FILTER_LOUDNESS_BASS)
         {
             loudnessBoost = interpolate(OverallOffset, CalNofPoints, OffsetPoints, BassBoostValues);
         }
         else if (filtertype == FILTER_LOUDNESS_TREBLE)
         {
             loudnessBoost = interpolate(OverallOffset, CalNofPoints, OffsetPoints, TrebleBoostValues);
         }
     }
     else
     {
         retval = false;
     }

     return retval;
 }

 bool_t CavDiranaRoutingCfg::getLoudnessCurveFilterPrm(uint16_t filterID, uint16_t cfgID, float volume, float& frequency, float& quality) const
 {
     bool_t retval = true;
     if(m_isLoudnessEnable == true)
     {
         ;
         EFilterID filtertype = static_cast<EFilterID>(filterID);
         quality = ;
         frequency = ;

         //volume -> bass filterprm
         OverallOffset = LoudnessOffset + volume;
         if (filtertype == FILTER_LOUDNESS_BASS)
         {
             frequency = interpolate(OverallOffset, CalNofPoints, OffsetPoints, BassFilterFrequence);
         }
         else if (filtertype == FILTER_LOUDNESS_TREBLE)
         {
             frequency = interpolate(OverallOffset, CalNofPoints, OffsetPoints, TrebleFilterFrequence);
         }
     }
     else
     {
         retval = false;
     }

     return retval;
 }

4.Adjustable Bass, Midrange, and Treble tone controls. 是对低频中频高频的一个调节

The bass tone control shall have the following characteristics: 
fcenter = 80Hz
Filter: Shelving type, 1st order

The midrange tone control shall have the following characteristics: 
fcenter = 775Hz
Filter: Peaking type, 2nd order, Q value calibratable with initial value of 1.1

The treble tone control shall have the following characteristics:
fcenter = 8kHz
Filter: Shelving type, 1st order

5.Source Offset
按照需求,对于不同的source,有不同的音量输出要求,在原来的音量上面进行一个dB值的调整

Audio 的一些小笔记的更多相关文章

  1. 转:【iOS开发每日小笔记(十一)】iOS8更新留下的“坑” NSAttributedString设置下划线 NSUnderlineStyleAttributeName 属性必须为NSNumber

    http://www.bubuko.com/infodetail-382485.html 标签:des   class   style   代码   html   使用   问题   文件   数据 ...

  2. 小笔记:Timer定时间隔时间操作

    小笔记:Timer定时间隔时间操作,后面有时间再补充和完善: public class TimingSvc { /// <summary> /// 定时器,执行定时任务 /// </ ...

  3. 关于 linux中TCP数据包(SKB)序列号的小笔记

    关于  SKB序列号的小笔记 为了修改TCP协议,现在遇到了要改动tcp分组的序列号,但是只是在tcp_sendmsg函数中找到了SKB的end_seq  一直没有找到seq 不清楚在那里初始化了,就 ...

  4. Linux下postgres9.4 版本的单机版安装小笔记

    1.添加RPMyum install https://download.postgresql.org/pub/repos/yum/9.4/redhat/rhel-7-x86_64/pgdg-redha ...

  5. 深入剖析Nginx一点小笔记

    前几天在图书馆看书,恰好看到这本<深入剖析nginx>,花了快一周的时间看完了这本书,写点笔记心得便于以后复习. 以前对nginx的认识就只是停留在一个反向代理服务器上.百度了一下ngin ...

  6. HTML、CSS(小笔记)

    这是我自己在学习html.css时觉得要记的东西太多总结一些较为常用的标签. HTML <p></p>段落标签 <hn></hn>标题标签n数值为1~6 ...

  7. Angular开发小笔记

    一.父组件怎么覆盖子组件的样式呢 1./deep/(不建议这么做,以后angular会取消,因为这样写不利于组件的独立性) 在父组件的scss里面写: :host{ 子组件名 /deep/ label ...

  8. Git-rebase 小笔记

    转自: https://blog.yorkxin.org/posts/2011/07/29/git-rebase/ 最近刚好有个机会整理很乱的Git commit tree,终于搞懂了rebase 的 ...

  9. css通用小笔记03——浏览器窗口变小 div错位的问题

    我最近写网页的时候,经常碰到一个普遍的问题,经过我的查阅和尝试,终于解决了这一问题,这里有两种方法提供给大家,如果博友还有更好的方法,欢迎补充. 一.使用min-width属性: 我们先看看下面这段代 ...

随机推荐

  1. C# 处理应用程序减少内存占用

    SetProcessWorkingSetSize减少内存占用 系统启动起来以后,内存占用越来越大,使用析构函数.GC.Collect什么的也不见效果,后来查了好久,找到了个办法,就是使用 SetPro ...

  2. 第三个Sprint冲刺事后诸葛亮报告

    用户反馈:还好吧. 用户数量:4 团队改进建议:思维局限太大,技术需要革新. 1.每个成员第一个sprint阶段有何需要改进? 成员 需要改进 邵家文 需要提高自己的工作效率,与创新能力,解决问题的能 ...

  3. win7右键在目录当前打开命令cmd窗口

    一般打开方式Windows+R 打开运行窗口输入CMD 在当前目录下打开CMD 按住Shift键+点击鼠标右键,会出现一个选项“在此处打开命令窗口”在右键快捷方式里.

  4. Day21_IO第三天

    1.IO体系总图 2.字符流体系图 记忆路线:输入输出流前面加File和Buffered,这就记住6个了,还剩两个转换流名字比较特殊,需要着重记一下(转换流:字节和字符的组合,所以起名字叫InputS ...

  5. C++ STL泛型编程——在ACM中的运用

    学习过C++的朋友们应该对STL和泛型编程这两个名词不会陌生.两者之间的关系不言而喻,泛型编程的思想促使了STL的诞生,而STL则很好地体现了泛型编程这种思想.这次想简单说一下STL在ACM中的一些应 ...

  6. JVM初学笔记

    JVM概念 JVM是Java Virtual Machine(Java虚拟机)的缩写,JVM是一种用于计算设备的规范,它是一个虚构出来的计算机,是通过在实际的计算机上仿真模拟各种计算机功能来实现的. ...

  7. gruntjs

    先输入命令: npm install -g grunt-clinpm install grunt --save-devgrunt –version 新建json文件:package.json { &q ...

  8. springMVC 返回json 忽略类中属性的注解

    该注解使用在 类名,接口头上 @JsonIgnoreProperties(value={"comid"}) //希望动态过滤掉的属性 该注解使用在get方法头上 @JsonIgno ...

  9. NOIP2016报零记

    其实,NOIP2016已经于10天之前就结束了,但是由于种种原因,没有写总结. 现在就来填上这个坑吧. DAY1: T1:一道简(kun)单(nan)的模拟,虽然ac,但是考试的时候总觉得怪怪的.并且 ...

  10. final发布评价

    1.飞天小女警: 礼物挑选这个项目相比之前的发布功能更完善了些,但是整体界面还是不太美观,界面上呈现出的选项字不够清晰,最为最终产品其功能还是少了点儿.在发布过程中整体表达比较清晰.流畅,比较不错. ...