我是C++的新手,我正在尝试理解SineWave class from the Synthesis Toolkit。description说:
This class computes and saves a static sine "table" that can be shared by multiple instances. It has an interface similar to the WaveLoop class but inherits from the Generator class. Output values are computed using linear interpolation.
所以我猜它根本不计算正弦?如果它在正弦波的最高点和最低点之间使用线性插值,那不就是一个三角波吗?有人能解释一下这个计算是做什么的吗?
发布于 2013-03-22 23:34:30
如果您查看一下the implementation,您将看到构造函数在0.0到1.0的范围内以1.0 / TABLE_SIZE的步长计算sin,其中TABLE_SIZE缺省为2048。然后在这些值之间进行线性插值。这与正弦函数非常接近。
https://stackoverflow.com/questions/15573941
复制相似问题