SinePattern是NI Labwindows/CVI裡面的生成正弦波波形函式,通過該函式可以快速生成一個正弦波波形,該函式產生一個正弦波形的數組供使用。
基本介紹
- 中文名:正弦波形
- 外文名:SinePattern
SinePattern函式產生一個正弦波型數組,該函式輸出一個double型數組供使用。
SinePattern的原型:
AnalysisLibErrType SinePattern (ssize_t numberOfElements, double amplitude, double phaseDegrees, double numberOfCycles, double sinePattern[]);
示例代碼如下:
/* The following code generates a cosinusoidal pattern. */double x[8], amp, phase, cycles;int n;n = 8;amp =1.0;phase = 90.0;cycles = 1.5;SinePattern (n, amp, phase, cycles, x);
參數解釋:
輸入參數
Name/名字 | Type/類型 | Description/描述 |
numberOfElements/元素數量 | ssize_t | Number of elements to generate in the sinusoidal pattern. |
amplitude/幅值 | double | The peak amplitude of the sinusoidal pattern. Default Value: 1.0. |
phase_Degrees/相位 | double | The initial phase value, in degrees, used in generating the sinusoidal pattern. To generate a cosine pattern, set phase to 90.0. Default Value: 0.0. |
numberOfCycles/周期 | double | Number of cycles in the sinusoidal pattern. Default Value: 1.0. |
函式返回參數
Name | Type | Description |
status | AnalysisLibErrType | A value that specifies the type of error that occurred. Refer to analysis.h for definitions of these constants. |