用于生成符合CSMPTE 2006-001的千周测试信号
在C-Free 4.0 mingw 2.95上编译通过
/* 这是一个简单的信号发生器,用于产生符合CSMPTE标准的千周信号 */
/* 左声道:1kHz,每间隔3秒间断约0.4秒,即出现2.6秒,静音0.4秒 */
/* 右声道:1kHz,连续 */
/* 输出格式:PCM_S16LE,16比特,低位在前,高位在后 */
/* C-Free 4.0 mingw 2.95 */
#include <math.h>
#include <stdio.h>
#define SAMPLE_RATE 48000
#define LEN 60.0
#define GATE_OFF (0.4 * SAMPLE_RATE)
#define GATE_LOOP_LEN (3 * SAMPLE_RATE)
#define GATE_ON (GATE_LOOP_LEN - GATE_OFF)
#define FALSE 0
#define TRUE 1
#define INT16 1
#define GAIN_L_DB -20
#define GAIN_R_DB -20
short sp_to_short_word(double sp);
double dB_to_decimal(double x);
int cnt_max = (double)LEN * SAMPLE_RATE;
const char *Path = "D:\\csmpte.raw";
const double Pi = 3.1415926535897932384626433832795;
const double Left_freq = 1000;
const double Right_freq = 1000;
const double Left_gain = 0.1;