?? 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<datain.size;ii++) { //each sample tmp1.realp = cos(accumulator) ; tmp1.image = sin(accumulator) ; top[ ii ] = multiply_complex(datain.data[ii], tmp1 ) ; accumulator += *amount ; } //each sample cset.size = datain.size ; cset.data = top ; }//allocated *phase = accumulator ; free ( datain.data ) ; return ( cset ) ;} //phase_drift
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -