且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Matlab中生成简单的正弦波

更新时间:2022-04-10 15:30:05

添加常量并调整频率:

x = 5 + 15*sin(2*pi*t/24);

在您的代码中,频率不正确,并且采样周期对于该频率而言太大:您有混叠.这就是为什么看不到正弦波的原因.

In your code the frequency is incorrect, and the sampling period is too large for that frequency: you have aliasing. That's why you don't see a sine wave.