www.pudn.com > wimax_ofdm_implementation_code.rar > phase_drift.c


/*****************************************************************************/
/*   FIle Name : phase_drift.c                                               */
/*   Description : Wi-Max OFDM correct phase_drift error in time domain      */
/*                 phase & amount : radian                                   */
/*   author : miffie                                                         */
/*   Date   : Nov/04/05                                                      */
/*   Copyright (c) 2005 miffie   All rights reserved.                        */
/*****************************************************************************/
struct complexset phase_drift (struct complexset datain, 
                          double *phase, double *amount ) {
int 	ii ;
char 	shifter ;
double 	accumulator ;
struct 	complexset cset ;
struct  complex  *top ;
struct	complex tmp1 ;
double  angle ;

  //Main 
    if ((top = (struct complex *)malloc(datain.size*sizeof(struct complex)) ) == NULL) {
        PRINTF( " malloc failed in phase_drift.c\n") ;
    } //fail
    else { //allocated
     PRINTF("phase_drift size=%d phase=%6.3f amount=%8.5f\n", datain.size, 
                                 *phase, *amount ) ;
     accumulator = *phase ;

     for(ii=0;ii