SDRAngel  4.11.5
Developer docs for <a href="https://github.com/f4exb/sdrangel">SDRangel<\a>, an Open Source Qt5 / OpenGL 3.0+ SDR and signal analyzer frontend to various hardware.
Functions
nfmdemod.cpp File Reference
#include <stdio.h>
#include <complex.h>
#include <QTime>
#include <QDebug>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QBuffer>
#include "SWGChannelSettings.h"
#include "SWGNFMDemodSettings.h"
#include "SWGChannelReport.h"
#include "SWGNFMDemodReport.h"
#include "dsp/downchannelizer.h"
#include "util/stepfunctions.h"
#include "util/db.h"
#include "audio/audiooutput.h"
#include "dsp/dspengine.h"
#include "dsp/threadedbasebandsamplesink.h"
#include "dsp/dspcommands.h"
#include "device/deviceapi.h"
#include "nfmdemod.h"
+ Include dependency graph for nfmdemod.cpp:

Go to the source code of this file.

Functions

float arctan2 (Real y, Real x)
 
Real angleDist (Real a, Real b)
 

Function Documentation

◆ angleDist()

Real angleDist ( Real  a,
Real  b 
)

Definition at line 138 of file nfmdemod.cpp.

References M_PI.

139 {
140  Real dist = b - a;
141 
142  while(dist <= M_PI)
143  dist += 2 * M_PI;
144  while(dist >= M_PI)
145  dist -= 2 * M_PI;
146 
147  return dist;
148 }
#define M_PI
Definition: rdsdemod.cpp:27
float Real
Definition: dsptypes.h:42

◆ arctan2()

float arctan2 ( Real  y,
Real  x 
)

Definition at line 118 of file nfmdemod.cpp.

References M_PI.

119 {
120  Real coeff_1 = M_PI / 4;
121  Real coeff_2 = 3 * coeff_1;
122  Real abs_y = fabs(y) + 1e-10; // kludge to prevent 0/0 condition
123  Real angle;
124  if( x>= 0) {
125  Real r = (x - abs_y) / (x + abs_y);
126  angle = coeff_1 - coeff_1 * r;
127  } else {
128  Real r = (x + abs_y) / (abs_y - x);
129  angle = coeff_2 - coeff_1 * r;
130  }
131  if(y < 0) {
132  return(-angle);
133  } else {
134  return(angle);
135  }
136 }
#define M_PI
Definition: rdsdemod.cpp:27
float Real
Definition: dsptypes.h:42