📄 tab_cpt.c
字号:
int SIN_TAB[4] = { 0x22BE8F87, //350Hz
0x2B5BC3A0, //440Hz
0x2F1EB491, //480Hz
0x3BE51FC8}; //620Hz
/******************************************************
* The table holds the coefficients for *
* the CPT generator, computed as follows *
* *
* sin(2pi*f/fs)*2^31 *
* *
* with fs = 8000Hz (sampling frequency) *
* f = 350, 440, 480, 620Hz *
* *
******************************************************/
int TONES_TAB[24] = { 0x7B31BBB2, 0, 0, //350Hz
0x786EC7F2, 0, 0, //440Hz
0x7702EA77, 0, 0, //480Hz
0x711F3B6F, 0, 0}; //620Hz
/******************************************************
* The table assembles the coefficients and *
* initial conditions for the difference equations of *
* the digital sinusoidal oscillators. *
* *
* In general: *
* DEQ: y(n) = 2*cos(2pi*f/fs)*y(n-1) - y(n-2) *
* I.C.: y(-1) = 0 *
* y(-2) = -A*sin(2pi*f/fs) *
* where A = desired amplitude of sine wave *
* f = desired frequency of sine wave *
* fs = sampling frequency *
* In this table, y(-2) is always 0. After invoking *
* power_level.s, it is modified to -A*sin(2pi*f/fs) *
* Example: *
* .word cos(2pi*f/fs)*2^31 ;coefficient *
* .word 0 ; y(-1) *
* .word 0 ; y(-2) *
* *
******************************************************/
short offset_dial[7]={
0, //dial tone offset in amplitude
0, //350Hz offset in SIN_TAB
4, //440Hz offset in SIN_TAB
8, //350Hz offset(y(-2)) in TONES_TAB
20, //440Hz offset(y(-2)) in TONES_TAB
0,
12};
short offset_ringback[7]={
4, //ringback tone offset in amplitude
4, //440Hz offset in SIN_TAB
8, //480Hz offset in SIN_TAB
20, //440Hz offset(y(-2)) in TONES_TAB
32, //480Hz offset(y(-2)) in TONES_TAB
12,
24};
short offset_busy_reorder[7]={
8, //busy and reorder tone offset in amplitude
8, //480Hz offset in SIN_TAB
12, //620Hz offset in SIN_TAB
32, //480Hz offset(y(-2)) in TONES_TAB
44, //620Hz offset(y(-2)) in TONES_TAB
24,
36};
int amplitude[3] =
{
0xF5895457, //-13dBm
0xFAC17C0A, //-19dBm
0xFD0D0C4E //-24dBm
};
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -