Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1145887
  • 博文数量: 139
  • 博客积分: 2510
  • 博客等级: 少校
  • 技术积分: 1712
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-13 23:10
个人简介

每天进步一点点。

文章分类

全部博文(139)

文章存档

2015年(3)

2014年(11)

2013年(25)

2011年(1)

2009年(3)

2008年(29)

2007年(45)

2006年(22)

分类: Windows平台

2014-07-10 22:49:04

公式如下:


一般方法的效果:


本方法的效果:


简单的实现方法:

点击(此处)折叠或打开

  1. nline SInt16 TPMixSamples(SInt16 a, SInt16 b) {
  2.     return
  3.             // If both samples are negative, mixed signal must have an amplitude between the lesser of A and B, and the minimum permissible negative amplitude
  4.             a < 0 && b < 0 ?
  5.                 ((int)a + (int)b) - (((int)a * (int)b)/INT16_MIN) :
  6.  
  7.             // If both samples are positive, mixed signal must have an amplitude between the greater of A and B, and the maximum permissible positive amplitude
  8.             ( a > 0 && b > 0 ?
  9.                 ((int)a + (int)b) - (((int)a * (int)b)/INT16_MAX)
  10.  
  11.             // If samples are on opposite sides of the 0-crossing, mixed signal should reflect that samples cancel each other out somewhat
  12.             :
  13.                 a + b);
  14. }

阅读(1770) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~