unwrap.cpp
来自「Digital filter designer s handbook C++ c」· C++ 代码 · 共 47 行
CPP
47 行
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
// File = unwrap.cpp
//
//
#include <math.h>
#include <stdlib.h>
#include "unwrap.h"
#include "d_cmplx.h"
#include "cmpxpoly.h"
extern ofstream DebugFile;
//========================================
//
void UnwrapPhase( int ix, double *phase)
{
static double half_circle_offset;
static double old_phase;
if(ix ==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 + =
减小字号Ctrl + -
显示快捷键?