特定の時間間隔で周波数を f1 から f2 にゆっくりと上昇させる正弦波を生成する ac プログラムを作成しています。
周波数を 0 から 10 Hz にランプするこの C プログラムを作成しましたが、問題は、360 度の完了後に周波数が変化することです。周波数を 0 ~ 360 度の間で変更しようとすると、トランジションがスムーズではなく、急激になります。
これは、私が使用した罪の方程式です y = Amplitude*sin(freq*phase)
int main(int argc, char *argv[]) {
double y, freq,phase;
int count; // for convenience of plotting in matlab so all the waves are spread on x axis.
for (freq = 0; freq < 10; freq+=1) {
for (phase = 0; phase < 360; phase++) { // phase is 360 degrees
y = 3 * sin((count*6.283185)+(freq*(phase*(3.14159/180))));
printf("%f %f %f \n", freq, phase, y);
}
count++;
}
return EXIT_SUCCESS;
}
- 特定の期間の頻度をスムーズに変更するにはどうすればよいですか?
- フーリエ変換を調べる必要がありますか?