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

📄 tx_src.c

📁 TI的DSP C55X的应用程序
💻 C
字号:
/***********************************************************************************/
/*                      IS54 Baseband Simulation Software                          */
/*                                                                                 */
/*  File Description : IS54 Transmit Filtering and Interpolation                   */
/*  File Name        : tx_src.c                                                    */
/*  Date             : 12/30/93                                                    */
/*                   : July, 20001 - Modified for TMS320C55x project               */
/*                                                                                 */
/*  This file contains the function "tx_src()" which takes PI/4 DQPSK encoded I,Q  */
/*  data streams at 1X symbol rate in addition to an SRC filter pointer (4 banks   */
/*  of 12 taps), and generates PI/4 DQPSK SRC filtered I,Q data streams at 4X      */
/*  symbol rate.                                                                   */
/*                                                                                 */
/*  The 48 tap filter that is passed to the subroutine is broken into 4 banks of   */
/*  12 taps.  The taps are spaced at symbol intervals, and the output of each      */
/*  filter bank produces an interpolated data point.  So for a given set of 12     */
/*  data points of an input vector four filtered output points are produced.       */
/*                                                                                 */
/*  Inputs:                                                                        */
/*      I           : Pointer to vector of in-phase components of PI/4 DQPSK       */
/*                    encoded data at 1X symbol rate (basically the output         */
/*                    of a differential encoder). Note that this buffer must       */
/*                    contain at least (num_of_syms+10) samples.                   */
/*                                                                                 */                      
/*      Q           : Pointer to vector of quadrature components of PI/4 DQPSK     */
/*                    encoded data at 1X symbol rate (again the output of          */
/*                    a differential encoder).  Note that this buffer must         */
/*                    contain at least (num_of_syms+10) samples.                   */
/*                                                                                 */                      
/*      num_of_syms : The number of symbols to be filtered. Note that the input    */
/*                    data buffers must contain at least (num_of_syms+10) elements */
/*                    and that the output buffers can handle (num_of_syms*4)       */
/*                    elements.                                                    */
/*                                                                                 */
/*      src_filt    : Pointer to a vector containing a 48 tap square-root raised   */
/*                    cosine filter (12 symbols * 4 samples/symbol)                */
/*                                                                                 */
/*  Outputs:                                                                       */
/*      I_SRC       : Pointer to a vector where in-phase components of square-root */
/*                    raised cosine filtered PI/4 DQPSK data at 4X symbol rate     */
/*                    will be written. (Note that (num_of_syms*4) elements will    */
/*                    be written to this buffer).                                  */
/*                                                                                 */
/*      Q_SRC       : Pointer to a vector where quadrature components of           */
/*                    square-root raised cosine filtered PI/4 DQPSK data at        */
/*                    4X symbol rate will be written. (Note that (num_of_syms*4)   */
/*                    elements will be written to this buffer).                    */
/*                                                                                 */
/*  Return Value :                                                                 */
/*      NONE                                                                       */
/*                                                                                 */
/***********************************************************************************/

/* Include Files */

#include <intrindefs.h>

/* Defines */

/* Function Prototypes */

void tx_src( int*, int*, int, int*, int*, int* );
                                
/* External Function Prototypes */

/* Data */

/* External Data */

/* Code */

void tx_src( int *I, int *Q, int num_of_syms, int *filt, int *I_SRC, int *Q_SRC )
{
    int    i,j,k, *iptr, *qptr; 
    long   i_ltemp, q_ltemp;
    
  /* Set up Pointers to input data */
    iptr = I;
    qptr = Q;
  
  /* Main Filter Loop */  
    for (i = 0 ; i < num_of_syms ; i++)
    {
        for (j = 4 ; j > 0 ; j--)  /* 4-bank filtering, 12 taps a piece */
        {
          /* Filter Input Data */   
            i_ltemp = _lsmpy( (*(iptr++)), (*filt) );
            q_ltemp = _lsmpy( (*(qptr++)), (*(filt++)) );
            for (k = 10 ; k > 0 ; k--)
            {
                i_ltemp = _smac(i_ltemp, (*(iptr++)), (*filt) );
                q_ltemp = _smac(q_ltemp, (*(qptr++)), (*(filt++)) );
            } 
            i_ltemp = _smacr(i_ltemp, (*(iptr++)), (*filt) );
            q_ltemp = _smacr(q_ltemp, (*(qptr++)), (*(filt++)) );
          
          /* Store Filter Output */
            *(I_SRC++) = (i_ltemp>>16);
            *(Q_SRC++) = (q_ltemp>>16);
            
          /* Use Same Input Data Next Time, but different filter bank */     
            iptr -= 12;
            qptr -= 12; 
        }
            
        iptr++;
        qptr++;         /* Proceed to next symbol */
        
        filt -= 48;     /* Set Filter Pointer back to Start */    
    }
    return;
}

⌨️ 快捷键说明

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