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

📄 unwrap.cpp

📁 《无线通信系统仿真——c++使用模型》这本书的源代码
💻 CPP
字号:
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
//  File = unwrap.cpp
//
//

#include <math.h>
//#include <stdlib.h>
//#include <fstream>
#include "unwrap.h"
//using namespace std;

//extern ofstream *DebugFile;

//========================================
//
void UnwrapPhase( int samp_num, double *phase)
{
  static double half_circle_offset;
  static double old_phase;

  if(samp_num==0){
    half_circle_offset = 0.0;
    old_phase = *phase;
    }
  else{
    *phase = *phase + half_circle_offset;
    if( fabs(old_phase - *phase) > double(90.0)){
      if(old_phase < *phase){
        *phase = *phase - 360.0;
        half_circle_offset -= 360.0;
        }
      else{
        *phase = *phase + 360.0;
        half_circle_offset += 360.0;
        }
      }
    old_phase = *phase;
    }
  return;
}

⌨️ 快捷键说明

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