⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 convenc.c

📁 TI的DSP C55X的应用程序
💻 C
字号:
/***********************************************************************************/
/*                      IS54 Baseband Simulation Software                          */
/*                                                                                 */
/*  File Description : IS54 DQPSK Convolutional Encoder                            */
/*  File Name        : convenc.c                                                   */
/*  Date             : 12/30/93                                                    */
/*                   : July, 20001 - Modified for TMS320C55x project               */
/*                                                                                 */
/*   This routine convolutionally encodes the class 1 bits (cl1[])                 */
/*   into cc0[] and cc1[] bit streams.                                             */
/*                                                                                 */
/*   Inputs:                                                                       */
/*            cl1 : Pointer to an 89-element array on input class-1                */
/*                  bits. Each element of the input array represents               */
/*                  a single bit (i.e. 0 or 1 only)                                */
/*                                                                                 */
/*   Outputs:                                                                      */
/*            cc0 : Pointer to an 89-element array where the cc0[] bit             */
/*                  stream shall be stored. Each element will represent            */
/*                  a single bit (i.e. 0 or 1 only)                                */
/*                                                                                 */
/*            cc1 : Pointer to an 89-element array where the cc1[] bit             */
/*                  stream shall be stored. Each element will represent            */
/*                  a single bit (i.e. 0 or 1 only)                                */
/*                                                                                 */
/***********************************************************************************/

/* Include Files */

/* Defines */

/* Function Prototypes */

void convenc( unsigned*, unsigned*, unsigned* );

/* External Function Prototypes */

/* Data */

unsigned wOutDibit, convenc_lookup_table[32] = { 0, 2, 1, 3, 3, 1, 2, 0,
                                                 1, 3, 0, 2, 2, 0, 3, 1,
                                                 3, 1, 2, 0, 0, 2, 1, 3,
                                                 2, 0, 3, 1, 1, 3, 0, 2  };

/* External Data */

/* Code */


void convenc( unsigned *cc0, unsigned *cc1, unsigned *cl1 )
{
    int i;
    unsigned   wDlyState = 0;
 
/* do convolutional encoding */

    for( i = 0; i < 89; i++ )
    {
        wOutDibit = convenc_lookup_table[ wDlyState & 0x001f ];
        wDlyState = ( ( wDlyState << 1 ) & 0x001f ) | (*cl1);

        /* binary coded word of the IS-54 Convolutional coder - yong*/
        if( *(cl1++) != 0 )     
            wOutDibit = ~wOutDibit & 0x0003;     /* Invert 2 LSB's */
       
        *(cc1++) = wOutDibit & 0x0001;     /* Get LSB */
        wOutDibit >>= 1;
        *(cc0++) = wOutDibit & 0x0001;     /* Get 2nd LSB */
    }                  
    
    return;
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -