SinePattern函式
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. |
转载请注明出处海之美文 » SinePattern函式