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.
|
#include <phaselockcomplex.h>
Classes | |
class | ExpAvg |
Public Member Functions | |
PhaseLockComplex () | |
void | computeCoefficients (Real wn, Real zeta, Real K) |
void | setPskOrder (unsigned int order) |
void | setSampleRate (unsigned int sampleRate) |
void | reset () |
void | feed (float re, float im) |
const std::complex< float > & | getComplex () const |
float | getReal () const |
float | getImag () const |
bool | locked () const |
float | getFreq () const |
float | getDeltaPhi () const |
float | getPhiHat () const |
Static Private Member Functions | |
static float | normalizeAngle (float angle) |
Private Attributes | |
float | m_a1 |
float | m_a2 |
float | m_b0 |
float | m_b1 |
float | m_b2 |
float | m_v0 |
float | m_v1 |
float | m_v2 |
float | m_deltaPhi |
float | m_phiHat |
float | m_phiHatPrev |
std::complex< float > | m_y |
std::complex< float > | m_p |
float | m_yRe |
float | m_yIm |
float | m_freq |
float | m_freqPrev |
float | m_freqTest |
int | m_lockCount |
float | m_lockFreq |
unsigned int | m_pskOrder |
int | m_lockTime |
int | m_lockTimeCount |
ExpAvg | m_expAvg |
General purpose Phase-locked loop using complex analytic signal input.
Definition at line 31 of file phaselockcomplex.h.
PhaseLockComplex::PhaseLockComplex | ( | ) |
Definition at line 29 of file phaselockcomplex.cpp.
Compute loop filter parameters (active PI design)
wn | PLL bandwidth relative to Nyquist frequency |
zeta | PLL damping factor |
K | PLL loop gain |
Definition at line 56 of file phaselockcomplex.cpp.
References b0, b1, b2, m_a1, m_a2, m_b0, m_b1, m_b2, and reset().
Referenced by AMDemod::AMDemod(), ChannelAnalyzer::ChannelAnalyzer(), and FreqTracker::FreqTracker().
void PhaseLockComplex::feed | ( | float | re, |
float | im | ||
) |
Feed PLL with a new signa sample
Definition at line 121 of file phaselockcomplex.cpp.
References arg(), cos(), PhaseLockComplex::ExpAvg::feed(), m_a1, m_a2, m_b0, m_b1, m_b2, m_deltaPhi, m_expAvg, m_freq, m_freqPrev, m_freqTest, m_lockCount, m_lockFreq, m_lockTime, m_lockTimeCount, m_phiHat, m_phiHatPrev, M_PI, m_pskOrder, m_v0, m_v1, m_v2, m_y, m_yIm, m_yRe, normalizeAngle(), and sin().
Referenced by ChannelAnalyzer::processOneSample(), AMDemod::processOneSample(), and FreqTracker::processOneSample().
|
inline |
Definition at line 50 of file phaselockcomplex.h.
Referenced by ChannelAnalyzer::processOneSample().
|
inline |
Definition at line 55 of file phaselockcomplex.h.
Referenced by ChannelAnalyzer::getPllDeltaPhase().
|
inline |
Definition at line 54 of file phaselockcomplex.h.
Referenced by FreqTracker::getFrequency(), ChannelAnalyzer::getPllFrequency(), and AMDemod::getPllFrequency().
|
inline |
Definition at line 52 of file phaselockcomplex.h.
Referenced by AMDemod::processOneSample().
|
inline |
Definition at line 56 of file phaselockcomplex.h.
Referenced by ChannelAnalyzer::getPllPhase().
|
inline |
Definition at line 51 of file phaselockcomplex.h.
Referenced by AMDemod::processOneSample().
|
inline |
Definition at line 53 of file phaselockcomplex.h.
Referenced by AMDemod::getPllLocked(), FreqTracker::getPllLocked(), and ChannelAnalyzer::isPllLocked().
|
staticprivate |
Normalize angle in radians into the [-pi,+pi] region
Definition at line 218 of file phaselockcomplex.cpp.
References M_PI.
Referenced by feed().
void PhaseLockComplex::reset | ( | ) |
Definition at line 99 of file phaselockcomplex.cpp.
References m_deltaPhi, m_freq, m_freqPrev, m_freqTest, m_lockCount, m_lockTimeCount, m_p, m_phiHat, m_phiHatPrev, m_v0, m_v1, m_v2, m_y, m_yIm, and m_yRe.
Referenced by ChannelAnalyzer::applySettings(), FreqTracker::applySettings(), computeCoefficients(), setPskOrder(), and setSampleRate().
void PhaseLockComplex::setPskOrder | ( | unsigned int | order | ) |
Set the PSK order for the phase comparator
order | 0,1: no PSK (CW), 2: BPSK, 4: QPSK, 8: 8-PSK, ... use powers of two for real cases |
Definition at line 86 of file phaselockcomplex.cpp.
References m_pskOrder, and reset().
Referenced by ChannelAnalyzer::applySettings(), and FreqTracker::applySettings().
void PhaseLockComplex::setSampleRate | ( | unsigned int | sampleRate | ) |
Set sample rate information only for frequency and lock condition calculation
Definition at line 92 of file phaselockcomplex.cpp.
References m_lockFreq, m_lockTime, M_PI, m_pskOrder, and reset().
Referenced by AMDemod::applyAudioSampleRate(), ChannelAnalyzer::applyChannelSettings(), ChannelAnalyzer::applySettings(), and FreqTracker::configureChannelizer().
|
private |
Definition at line 85 of file phaselockcomplex.h.
Referenced by computeCoefficients(), and feed().
|
private |
Definition at line 86 of file phaselockcomplex.h.
Referenced by computeCoefficients(), and feed().
|
private |
Definition at line 87 of file phaselockcomplex.h.
Referenced by computeCoefficients(), and feed().
|
private |
Definition at line 88 of file phaselockcomplex.h.
Referenced by computeCoefficients(), and feed().
|
private |
Definition at line 89 of file phaselockcomplex.h.
Referenced by computeCoefficients(), and feed().
|
private |
Definition at line 93 of file phaselockcomplex.h.
|
private |
Definition at line 108 of file phaselockcomplex.h.
Referenced by feed().
|
private |
Definition at line 100 of file phaselockcomplex.h.
|
private |
Definition at line 101 of file phaselockcomplex.h.
|
private |
Definition at line 102 of file phaselockcomplex.h.
|
private |
Definition at line 103 of file phaselockcomplex.h.
|
private |
Definition at line 104 of file phaselockcomplex.h.
Referenced by feed(), and setSampleRate().
|
private |
Definition at line 106 of file phaselockcomplex.h.
Referenced by feed(), and setSampleRate().
|
private |
Definition at line 107 of file phaselockcomplex.h.
|
private |
Definition at line 97 of file phaselockcomplex.h.
Referenced by reset().
|
private |
Definition at line 94 of file phaselockcomplex.h.
|
private |
Definition at line 95 of file phaselockcomplex.h.
|
private |
Definition at line 105 of file phaselockcomplex.h.
Referenced by feed(), setPskOrder(), and setSampleRate().
|
private |
Definition at line 90 of file phaselockcomplex.h.
|
private |
Definition at line 91 of file phaselockcomplex.h.
|
private |
Definition at line 92 of file phaselockcomplex.h.
|
private |
Definition at line 96 of file phaselockcomplex.h.
|
private |
Definition at line 99 of file phaselockcomplex.h.
|
private |
Definition at line 98 of file phaselockcomplex.h.