1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-09-12 08:06:34 -04:00
sdrangel/plugins/channel/bfm/rdsdemod.h

69 lines
2.2 KiB
C
Raw Normal View History

2015-12-10 02:54:57 -05:00
///////////////////////////////////////////////////////////////////////////////////
// Copyright (C) 2015 F4EXB //
// written by Edouard Griffiths //
// //
// This program is free software; you can redistribute it and/or modify //
// it under the terms of the GNU General Public License as published by //
// the Free Software Foundation as version 3 of the License, or //
// //
// This program is distributed in the hope that it will be useful, //
// but WITHOUT ANY WARRANTY; without even the implied warranty of //
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
// GNU General Public License V3 for more details. //
// //
// You should have received a copy of the GNU General Public License //
// along with this program. If not, see <http://www.gnu.org/licenses/>. //
///////////////////////////////////////////////////////////////////////////////////
#ifndef PLUGINS_CHANNEL_BFM_RDSDEMOD_H_
#define PLUGINS_CHANNEL_BFM_RDSDEMOD_H_
2015-12-10 07:39:15 -05:00
#include "dsp/dsptypes.h"
2015-12-10 02:54:57 -05:00
class RDSDemod
{
public:
RDSDemod();
~RDSDemod();
2015-12-10 21:57:17 -05:00
void setSampleRate(int srate);
void process(Real rdsSample, Real pilotPhaseSample);
2015-12-10 07:39:15 -05:00
protected:
2015-12-10 02:54:57 -05:00
Real filter_lp_2400_iq(Real in, int iqIndex);
2015-12-10 21:57:17 -05:00
Real filter_lp_pll(Real input);
2015-12-10 07:39:15 -05:00
int sign(Real a);
2015-12-11 13:33:10 -05:00
void biphase(Real acc, Real dPhiClock);
2015-12-10 07:39:15 -05:00
void print_delta(char b);
void output_bit(char b);
2015-12-10 02:54:57 -05:00
private:
2015-12-10 21:57:17 -05:00
int m_srate;
Real m_fsc;
2015-12-10 02:54:57 -05:00
Real m_xv[2][2+1];
Real m_yv[2][2+1];
2015-12-10 21:57:17 -05:00
Real m_xw[2];
Real m_yw[2];
2015-12-11 13:33:10 -05:00
Real m_subcarrPhi_1;
2015-12-10 21:57:17 -05:00
Real m_subcarrBB[2];
Real m_dPhiSc;
Real m_subcarrBB_1;
2015-12-10 02:54:57 -05:00
Real m_rdsClockPhase;
2015-12-11 13:33:10 -05:00
Real m_rdsClockPhase_1;
2015-12-10 02:54:57 -05:00
Real m_rdsClockOffset;
Real m_rdsClockLO;
2015-12-10 07:39:15 -05:00
Real m_rdsClockLO_1;
int m_numSamples;
Real m_acc;
Real m_acc_1;
int m_counter;
int m_readingFrame;
int m_totErrors[2];
int m_dbit;
2015-12-10 21:57:17 -05:00
static const Real m_pllBeta;
2015-12-10 02:54:57 -05:00
};
#endif /* PLUGINS_CHANNEL_BFM_RDSDEMOD_H_ */