24 m_sampleSourceFifo(1<<19),
48 quint64 centerFrequency,
49 qint64 transverterDeltaFrequency,
52 quint32 devSampleRate,
55 qint64 deviceCenterFrequency = centerFrequency;
56 deviceCenterFrequency -= transverterMode ? transverterDeltaFrequency : 0;
57 deviceCenterFrequency = deviceCenterFrequency < 0 ? 0 : deviceCenterFrequency;
58 qint64 f_img = deviceCenterFrequency;
63 qDebug() <<
"DeviceSampleSink::calculateDeviceCenterFrequency:" 64 <<
" desired center freq: " << centerFrequency <<
" Hz" 65 <<
" device center freq: " << deviceCenterFrequency <<
" Hz" 66 <<
" device sample rate: " << devSampleRate <<
"S/s" 67 <<
" Actual sample rate: " << devSampleRate/(1<<log2Interp) <<
"S/s" 68 <<
" center freq position code: " << fcPos
69 <<
" image frequency: " << f_img <<
"Hz";
71 return deviceCenterFrequency;
75 quint64 deviceCenterFrequency,
76 qint64 transverterDeltaFrequency,
79 quint32 devSampleRate,
82 qint64 centerFrequency = deviceCenterFrequency;
84 centerFrequency += transverterMode ? transverterDeltaFrequency : 0;
85 centerFrequency = centerFrequency < 0 ? 0 : centerFrequency;
87 qDebug() <<
"DeviceSampleSink::calculateCenterFrequency:" 88 <<
" desired center freq: " << centerFrequency <<
" Hz" 89 <<
" device center freq: " << deviceCenterFrequency <<
" Hz" 90 <<
" device sample rate: " << devSampleRate <<
"S/s" 91 <<
" Actual sample rate: " << devSampleRate/(1<<log2Interp) <<
"S/s" 92 <<
" center freq position code: " << fcPos;
94 return centerFrequency;
117 quint32 devSampleRate)
124 int halfSampleRate = devSampleRate / 2;
126 if (log2Interp == 0) {
128 }
else if (log2Interp == 1) {
129 return sign * (halfSampleRate / 2);
130 }
else if (log2Interp == 2) {
131 return sign * ((halfSampleRate * 3) / 4);
132 }
else if (log2Interp == 3) {
133 return sign * ((halfSampleRate * 5) / 8);
134 }
else if (log2Interp == 4) {
135 return sign * ((halfSampleRate * 11) / 16);
136 }
else if (log2Interp == 5) {
137 return sign * ((halfSampleRate * 21) / 32);
138 }
else if (log2Interp == 6) {
139 return sign * ((halfSampleRate * 21) / 64);
void handleInputMessages()
Message * pop()
Pop message from queue.
MessageQueue m_inputMessageQueue
Input queue to the sink.
virtual ~DeviceSampleSink()
static qint64 calculateCenterFrequency(quint64 deviceCenterFrequency, qint64 transverterDeltaFrequency, int log2Interp, fcPos_t fcPos, quint32 devSampleRate, bool transverterMode=false)
static qint32 calculateFrequencyShift(int log2Interp, fcPos_t fcPos, quint32 devSampleRate)
static qint64 calculateDeviceCenterFrequency(quint64 centerFrequency, qint64 transverterDeltaFrequency, int log2Interp, fcPos_t fcPos, quint32 devSampleRate, bool transverterMode=false)
virtual bool handleMessage(const Message &message)=0