【发布时间】:2013-03-22 15:21:47
【问题描述】:
我是 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.
所以我猜它根本不计算正弦?如果它在正弦波的高点和低点之间使用线性插值,那不就是三角波吗?有人能解释一下这个计算是做什么的吗?
【问题讨论】:
-
是什么让您认为它们在最大值和最小值之间线性插值?
-
我认为这取决于他们在表格中填充了多少点。如果他们使用了足够多的点,这应该是一个合理的近似值。
-
@sftrabbit 我根本不知道他们在做什么。我不明白计算,因为我看不到它们使用任何三角函数或多项式展开。我想知道是否有人可以解释一下。
-
@JohnPeterThompsonGarcés 那是因为您只查看头文件。 The implementation 使用
sin。 -
哦,谢谢。我是个菜鸟。
标签: c++ sound-synthesis