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 <phaselock.h>
Classes | |
struct | PpsEvent |
Public Member Functions | |
PhaseLock (Real freq, Real bandwidth, Real minsignal) | |
virtual | ~PhaseLock () |
void | configure (Real freq, Real bandwidth, Real minsignal) |
void | process (const std::vector< Real > &samples_in, std::vector< Real > &samples_out) |
void | process (const Real &sample_in, Real *samples_out) |
void | process (const Real &real_in, const Real &imag_in, Real *samples_out) |
bool | locked () const |
Real | get_pilot_level () const |
Static Public Attributes | |
static const int | pilot_frequency = 19000 |
Protected Member Functions | |
virtual void | processPhase (Real *samples_out) const |
Protected Attributes | |
Real | m_phase |
Real | m_psin |
Real | m_pcos |
Private Member Functions | |
void | process_phasor (Real &phasor_i, Real &phasor_q) |
Private Attributes | |
Real | m_minfreq |
Real | m_maxfreq |
Real | m_phasor_b0 |
Real | m_phasor_a1 |
Real | m_phasor_a2 |
Real | m_phasor_i1 |
Real | m_phasor_i2 |
Real | m_phasor_q1 |
Real | m_phasor_q2 |
Real | m_loopfilter_b0 |
Real | m_loopfilter_b1 |
Real | m_loopfilter_x1 |
Real | m_freq |
Real | m_minsignal |
Real | m_pilot_level |
int | m_lock_delay |
int | m_lock_cnt |
int | m_pilot_periods |
quint64 | m_pps_cnt |
quint64 | m_sample_cnt |
std::vector< PpsEvent > | m_pps_events |
Phase-locked loop mainly for broadcadt FM stereo pilot.
Definition at line 24 of file phaselock.h.
Construct phase-locked loop.
freq :: 19 kHz center frequency relative to sample freq (0.5 is Nyquist) bandwidth :: bandwidth relative to sample frequency minsignal :: minimum pilot amplitude
Definition at line 26 of file phaselock.cpp.
References exp(), m_freq, m_lock_cnt, m_lock_delay, m_loopfilter_b0, m_loopfilter_b1, m_loopfilter_x1, m_maxfreq, m_minfreq, m_minsignal, m_pcos, m_phase, m_phasor_a1, m_phasor_a2, m_phasor_b0, m_phasor_i1, m_phasor_i2, m_phasor_q1, m_phasor_q2, M_PI, m_pilot_level, m_pilot_periods, m_pps_cnt, m_psin, and m_sample_cnt.
|
inlinevirtual |
Definition at line 49 of file phaselock.h.
Change phase locked loop parameters
freq :: 19 kHz center frequency relative to sample freq (0.5 is Nyquist) bandwidth :: bandwidth relative to sample frequency minsignal :: minimum pilot amplitude
Definition at line 87 of file phaselock.cpp.
References exp(), m_freq, m_lock_cnt, m_lock_delay, m_loopfilter_b0, m_loopfilter_b1, m_loopfilter_x1, m_maxfreq, m_minfreq, m_minsignal, m_phase, m_phasor_a1, m_phasor_a2, m_phasor_b0, m_phasor_i1, m_phasor_i2, m_phasor_q1, m_phasor_q2, M_PI, m_pilot_level, m_pilot_periods, m_pps_cnt, and m_sample_cnt.
Referenced by BFMDemod::applyChannelSettings(), BFMDemod::applySettings(), and ATVDemod::applySettings().
|
inline |
|
inline |
Return true if the phase-locked loop is locked.
Definition at line 80 of file phaselock.h.
Referenced by ATVDemod::getBFOLocked().
void PhaseLock::process | ( | const std::vector< Real > & | samples_in, |
std::vector< Real > & | samples_out | ||
) |
Process samples and extract 19 kHz pilot tone. Generate phase-locked 38 kHz tone with unit amplitude. Bufferized version with input and output vectors
Definition at line 148 of file phaselock.cpp.
References abs(), PhaseLock::PpsEvent::block_position, cos(), i, m_freq, m_lock_cnt, m_lock_delay, m_loopfilter_b0, m_loopfilter_b1, m_loopfilter_x1, m_maxfreq, m_minfreq, m_minsignal, m_phase, m_phasor_a1, m_phasor_a2, m_phasor_b0, m_phasor_i1, m_phasor_i2, m_phasor_q1, m_phasor_q2, M_PI, m_pilot_level, m_pilot_periods, m_pps_cnt, m_pps_events, m_sample_cnt, leansdr::max(), leansdr::min(), pilot_frequency, PhaseLock::PpsEvent::pps_index, PhaseLock::PpsEvent::sample_index, and sin().
Referenced by ATVDemod::demod(), and BFMDemod::feed().
Process samples and track a pilot tone. Generate samples for single or multiple phase-locked signals. Implement the processPhase virtual method to produce the output samples. In flow version. Ex: Use 19 kHz stereo pilot tone to generate 38 kHz (stereo) and 57 kHz pilots (see RDSPhaseLock class below). This is the in flow version
Definition at line 254 of file phaselock.cpp.
References cos(), m_pcos, m_phase, m_pps_events, m_psin, process_phasor(), processPhase(), and sin().
Definition at line 273 of file phaselock.cpp.
References cos(), m_pcos, m_phase, m_pps_events, m_psin, process_phasor(), processPhase(), and sin().
Definition at line 292 of file phaselock.cpp.
References abs(), m_freq, m_lock_cnt, m_lock_delay, m_loopfilter_b0, m_loopfilter_b1, m_loopfilter_x1, m_maxfreq, m_minfreq, m_minsignal, m_phase, m_phasor_a1, m_phasor_a2, m_phasor_b0, m_phasor_i1, m_phasor_i2, m_phasor_q1, m_phasor_q2, M_PI, m_pilot_level, m_pilot_periods, m_pps_cnt, m_pps_events, m_sample_cnt, leansdr::max(), leansdr::min(), and pilot_frequency.
Referenced by process().
|
inlineprotectedvirtual |
Callback method to produce multiple outputs from the current phase value in m_phase and/or the sin and cos values in m_psin and m_pcos
Reimplemented in RDSPhaseLock, StereoPhaseLock, and SimplePhaseLock.
Definition at line 99 of file phaselock.h.
Referenced by process().
|
private |
Definition at line 107 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 111 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 110 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 105 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 105 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 106 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 102 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 102 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 108 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
protected |
Definition at line 94 of file phaselock.h.
Referenced by PhaseLock(), and process().
|
protected |
Definition at line 92 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 103 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 103 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 103 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 104 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 104 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 104 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 104 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 109 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 112 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 113 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
private |
Definition at line 115 of file phaselock.h.
Referenced by process(), and process_phasor().
|
protected |
Definition at line 93 of file phaselock.h.
Referenced by PhaseLock(), and process().
|
private |
Definition at line 114 of file phaselock.h.
Referenced by configure(), PhaseLock(), process(), and process_phasor().
|
static |
Expected pilot frequency (used for PPS events).
Definition at line 29 of file phaselock.h.
Referenced by process(), and process_phasor().