?? sync_cor.c
字號:
/***********************************************************************************/
/* IS54 Baseband Simulation Software */
/* */
/* File Description : IS54 Sync Correlation Module */
/* File Name : sync_cor.c */
/* Date : 12/30/93 */
/* : July, 20001 - Modified for TMS320C55x project */
/* */
/* Function : sync_corr() */
/* */
/* Procedure : This subroutine is responsible for taking PI/4 DQPSK encoded */
/* SRC I,Q data steams at 4X symbol rate in addition to a SRC */
/* filter table pointer, and obtaining an offset index to the */
/* synchronization point of the input data. The data is initially */
/* filtered to RC I,Q data streams at 4X symbol rate, and then a */
/* complex cartesian correlation is performed at sequential offsets */
/* spanning 4 symbols (16 total offsets) in order to determine */
/* the correlation peak. The offset index to the synchronization */
/* point is returned. */
/* */
/* */
/* Inputs : */
/* [PARAMETERS] */
/* I_SRC : Pointer to a vector of square-root raised cosine */
/* filtered in-phase components of IS-54 downlink slot */
/* at 4X symbol rate. */
/* */
/* Q_SRC : Pointer to a vector of square-root raised cosine */
/* filtered quadrature components of IS-54 downlink slot */
/* at 4X symbol rate. */
/* */
/* filt : Pointer to a vector of 48 square-root raised cosine */
/* filter taps (12 symbols * 4 samples/symbol) */
/* */
/* [GLOBALS/TABLES] */
/* cor_sync[] : Array containing the 15 maximum effect points for the */
/* 28 symbol sync word for slot #0. (initial I,Q = 1,0) */
/* */
/* temp_rc[] : Temporary storage array for post-filtered RC data. */
/* */
/* Outputs : */
/* NONE */
/* */
/* Return Value : */
/* Integer representing the offset into the input data */
/* to the synchronization point. */
/* */
/***********************************************************************************/
/* Include Files */
#include <intrindefs.h>
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
/* Defines */
#define Z 0x16a0 /* Q13 format ((float)0.707106781) */
/* Function Prototypes */
int sync_corr( int*, int*, int* );
/* External Function Prototypes */
/* Data */
/* 15 Maximum Effect Points for Sync Word #0 */
/* Data is stored as 15 pairs of 2 elements, */
/* where each pair represents the I,Q components */
/* of that maximum effect point. */
int cor_sync[30] = { /* Q13 format */
0x2000, 0x0000, Z, -Z,
0x0000, -0x2000, -Z, -Z,
0x2000, 0x0000, Z, Z,
-0x2000, 0x0000, Z, Z,
-0x2000, 0x0000, Z, Z,
0x2000, 0x0000, -Z, Z,
-0x2000, 0x0000, -Z, Z,
0x0000, 0x2000
};
int temp_rc[2*76];
/* Table for sqrt(x), where x = [0, 1] */
int sqrt_tab[1024]={
0x0, 0x3ff, 0x5a8, 0x6ed, 0x7ff, 0x8f1, 0x9cc, 0xa95, 0xb50,
0xbff, 0xca6, 0xd44, 0xddb, 0xe6b, 0xef7, 0xf7d, 0xfff, 0x107d,
0x10f8, 0x116f, 0x11e3, 0x1254, 0x12c2, 0x132e, 0x1398, 0x13ff, 0x1465,
0x14c8, 0x152a, 0x158a, 0x15e8, 0x1645, 0x16a0, 0x16fa, 0x1752, 0x17a9,
0x17ff, 0x1854, 0x18a8, 0x18fa, 0x194c, 0x199c, 0x19ec, 0x1a3a, 0x1a88,
0x1ad4, 0x1b20, 0x1b6b, 0x1bb6, 0x1bff, 0x1c48, 0x1c90, 0x1cd7, 0x1d1e,
0x1d64, 0x1da9, 0x1dee, 0x1e32, 0x1e76, 0x1eb9, 0x1efb, 0x1f3d, 0x1f7e,
0x1fbf, 0x1fff, 0x203f, 0x207e, 0x20bd, 0x20fb, 0x2139, 0x2177, 0x21b4,
0x21f0, 0x222c, 0x2268, 0x22a3, 0x22de, 0x2319, 0x2353, 0x238d, 0x23c6,
0x23ff, 0x2438, 0x2470, 0x24a8, 0x24e0, 0x2517, 0x254e, 0x2585, 0x25bc,
0x25f2, 0x2628, 0x265d, 0x2692, 0x26c7, 0x26fc, 0x2730, 0x2764, 0x2798,
0x27cc, 0x27ff, 0x2832, 0x2865, 0x2898, 0x28ca, 0x28fc, 0x292e, 0x2960,
0x2991, 0x29c2, 0x29f3, 0x2a24, 0x2a54, 0x2a84, 0x2ab4, 0x2ae4, 0x2b14,
0x2b43, 0x2b73, 0x2ba2, 0x2bd1, 0x2bff, 0x2c2e, 0x2c5c, 0x2c8a, 0x2cb8,
0x2ce6, 0x2d13, 0x2d40, 0x2d6e, 0x2d9b, 0x2dc7, 0x2df4, 0x2e20, 0x2e4d,
0x2e79, 0x2ea5, 0x2ed1, 0x2efc, 0x2f28, 0x2f53, 0x2f7e, 0x2fa9, 0x2fd4,
0x2fff, 0x302a, 0x3054, 0x307e, 0x30a9, 0x30d3, 0x30fd, 0x3126, 0x3150,
0x3179, 0x31a3, 0x31cc, 0x31f5, 0x321e, 0x3247, 0x326f, 0x3298, 0x32c0,
0x32e8, 0x3311, 0x3339, 0x3361, 0x3388, 0x33b0, 0x33d8, 0x33ff, 0x3426,
0x344e, 0x3475, 0x349c, 0x34c3, 0x34e9, 0x3510, 0x3537, 0x355d, 0x3583,
0x35a9, 0x35d0, 0x35f6, 0x361b, 0x3641, 0x3667, 0x368d, 0x36b2, 0x36d7,
0x36fd, 0x3722, 0x3747, 0x376c, 0x3791, 0x37b6, 0x37da, 0x37ff, 0x3824,
0x3848, 0x386c, 0x3891, 0x38b5, 0x38d9, 0x38fd, 0x3921, 0x3945, 0x3968,
0x398c, 0x39af, 0x39d3, 0x39f6, 0x3a1a, 0x3a3d, 0x3a60, 0x3a83, 0x3aa6,
0x3ac9, 0x3aec, 0x3b0e, 0x3b31, 0x3b53, 0x3b76, 0x3b98, 0x3bbb, 0x3bdd,
0x3bff, 0x3c21, 0x3c43, 0x3c65, 0x3c87, 0x3ca9, 0x3cca, 0x3cec, 0x3d0e,
0x3d2f, 0x3d51, 0x3d72, 0x3d93, 0x3db5, 0x3dd6, 0x3df7, 0x3e18, 0x3e39,
0x3e5a, 0x3e7a, 0x3e9b, 0x3ebc, 0x3edc, 0x3efd, 0x3f1d, 0x3f3e, 0x3f5e,
0x3f7f, 0x3f9f, 0x3fbf, 0x3fdf, 0x3fff, 0x401f, 0x403f, 0x405f, 0x407f,
0x409e, 0x40be, 0x40dd, 0x40fd, 0x411d, 0x413c, 0x415b, 0x417b, 0x419a,
0x41b9, 0x41d8, 0x41f7, 0x4216, 0x4235, 0x4254, 0x4273, 0x4292, 0x42b0,
0x42cf, 0x42ee, 0x430c, 0x432b, 0x4349, 0x4368, 0x4386, 0x43a4, 0x43c3,
0x43e1, 0x43ff, 0x441d, 0x443b, 0x4459, 0x4477, 0x4495, 0x44b3, 0x44d1,
0x44ee, 0x450c, 0x452a, 0x4547, 0x4565, 0x4582, 0x45a0, 0x45bd, 0x45da,
0x45f8, 0x4615, 0x4632, 0x464f, 0x466c, 0x4689, 0x46a6, 0x46c3, 0x46e0,
0x46fd, 0x471a, 0x4737, 0x4753, 0x4770, 0x478d, 0x47a9, 0x47c6, 0x47e2,
0x47ff, 0x481b, 0x4838, 0x4854, 0x4870, 0x488d, 0x48a9, 0x48c5, 0x48e1,
0x48fd, 0x4919, 0x4935, 0x4951, 0x496d, 0x4989, 0x49a5, 0x49c1, 0x49dc,
0x49f8, 0x4a14, 0x4a2f, 0x4a4b, 0x4a66, 0x4a82, 0x4a9d, 0x4ab9, 0x4ad4,
0x4af0, 0x4b0b, 0x4b26, 0x4b41, 0x4b5d, 0x4b78, 0x4b93, 0x4bae, 0x4bc9,
0x4be4, 0x4bff, 0x4c1a, 0x4c35, 0x4c50, 0x4c6a, 0x4c85, 0x4ca0, 0x4cbb,
0x4cd5, 0x4cf0, 0x4d0b, 0x4d25, 0x4d40, 0x4d5a, 0x4d75, 0x4d8f, 0x4da9,
0x4dc4, 0x4dde, 0x4df8, 0x4e13, 0x4e2d, 0x4e47, 0x4e61, 0x4e7b, 0x4e95,
0x4eaf, 0x4ec9, 0x4ee3, 0x4efd, 0x4f17, 0x4f31, 0x4f4b, 0x4f65, 0x4f7e,
0x4f98, 0x4fb2, 0x4fcc, 0x4fe5, 0x4fff, 0x5018, 0x5032, 0x504c, 0x5065,
0x507e, 0x5098, 0x50b1, 0x50cb, 0x50e4, 0x50fd, 0x5117, 0x5130, 0x5149,
0x5162, 0x517b, 0x5194, 0x51ae, 0x51c7, 0x51e0, 0x51f9, 0x5212, 0x522b,
0x5243, 0x525c, 0x5275, 0x528e, 0x52a7, 0x52c0, 0x52d8, 0x52f1, 0x530a,
0x5322, 0x533b, 0x5353, 0x536c, 0x5385, 0x539d, 0x53b6, 0x53ce, 0x53e6,
0x53ff, 0x5417, 0x5430, 0x5448, 0x5460, 0x5478, 0x5491, 0x54a9, 0x54c1,
0x54d9, 0x54f1, 0x5509, 0x5521, 0x5539, 0x5551, 0x5569, 0x5581, 0x5599,
0x55b1, 0x55c9, 0x55e1, 0x55f9, 0x5611, 0x5628, 0x5640, 0x5658, 0x5670,
0x5687, 0x569f, 0x56b7, 0x56ce, 0x56e6, 0x56fd, 0x5715, 0x572c, 0x5744,
0x575b, 0x5773, 0x578a, 0x57a2, 0x57b9, 0x57d0, 0x57e8, 0x57ff, 0x5816,
0x582d, 0x5845, 0x585c, 0x5873, 0x588a, 0x58a1, 0x58b8, 0x58cf, 0x58e6,
0x58fd, 0x5914, 0x592b, 0x5942, 0x5959, 0x5970, 0x5987, 0x599e, 0x59b5,
0x59cc, 0x59e2, 0x59f9, 0x5a10, 0x5a27, 0x5a3d, 0x5a54, 0x5a6b, 0x5a81,
0x5a98, 0x5aae, 0x5ac5, 0x5adc, 0x5af2, 0x5b09, 0x5b1f, 0x5b36, 0x5b4c,
0x5b62, 0x5b79, 0x5b8f, 0x5ba6, 0x5bbc, 0x5bd2, 0x5be9, 0x5bff, 0x5c15,
0x5c2b, 0x5c41, 0x5c58, 0x5c6e, 0x5c84, 0x5c9a, 0x5cb0, 0x5cc6, 0x5cdc,
0x5cf2, 0x5d08, 0x5d1e, 0x5d34, 0x5d4a, 0x5d60, 0x5d76, 0x5d8c, 0x5da2,
0x5db8, 0x5dce, 0x5de4, 0x5df9, 0x5e0f, 0x5e25, 0x5e3b, 0x5e50, 0x5e66,
0x5e7c, 0x5e91, 0x5ea7, 0x5ebd, 0x5ed2, 0x5ee8, 0x5efd, 0x5f13, 0x5f28,
0x5f3e, 0x5f53, 0x5f69, 0x5f7e, 0x5f94, 0x5fa9, 0x5fbf, 0x5fd4, 0x5fe9,
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -