46 quint64 centerFrequency,
47 qint64 transverterDeltaFrequency,
50 quint32 devSampleRate,
54 qint64 deviceCenterFrequency = centerFrequency;
55 deviceCenterFrequency -= transverterMode ? transverterDeltaFrequency : 0;
56 deviceCenterFrequency = deviceCenterFrequency < 0 ? 0 : deviceCenterFrequency;
57 qint64 f_img = deviceCenterFrequency;
62 qDebug() <<
"DeviceSampleSource::calculateDeviceCenterFrequency:" 63 <<
" frequencyShiftScheme: " << frequencyShiftScheme
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<<log2Decim) <<
"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,
83 qint64 centerFrequency = deviceCenterFrequency;
85 centerFrequency += transverterMode ? transverterDeltaFrequency : 0;
86 centerFrequency = centerFrequency < 0 ? 0 : centerFrequency;
88 qDebug() <<
"DeviceSampleSource::calculateCenterFrequency:" 89 <<
" frequencyShiftScheme: " << frequencyShiftScheme
90 <<
" desired center freq: " << centerFrequency <<
" Hz" 91 <<
" device center freq: " << deviceCenterFrequency <<
" Hz" 92 <<
" device sample rate: " << devSampleRate <<
"S/s" 93 <<
" Actual sample rate: " << devSampleRate/(1<<log2Decim) <<
"S/s" 94 <<
" center freq position code: " << fcPos;
96 return centerFrequency;
117 quint32 devSampleRate,
122 if (log2Decim == 0) {
124 }
else if (log2Decim < 3) {
126 return -(devSampleRate / (1<<(log2Decim+1)));
128 return devSampleRate / (1<<(log2Decim+1));
134 return -(devSampleRate / (1<<(log2Decim)));
136 return devSampleRate / (1<<(log2Decim));
149 int halfSampleRate = devSampleRate / 2;
151 if (log2Decim == 0) {
153 }
else if (log2Decim == 1) {
154 return sign * (halfSampleRate / 2);
155 }
else if (log2Decim == 2) {
156 return sign * ((halfSampleRate * 3) / 4);
157 }
else if (log2Decim == 3) {
158 return sign * ((halfSampleRate * 5) / 8);
159 }
else if (log2Decim == 4) {
160 return sign * ((halfSampleRate * 11) / 16);
161 }
else if (log2Decim == 5) {
162 return sign * ((halfSampleRate * 21) / 32);
163 }
else if (log2Decim == 6) {
164 return sign * ((halfSampleRate * 21) / 64);
Message * pop()
Pop message from queue.
static qint32 calculateFrequencyShift(int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme)
static qint64 calculateDeviceCenterFrequency(quint64 centerFrequency, qint64 transverterDeltaFrequency, int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme, bool transverterMode=false)
virtual ~DeviceSampleSource()
MessageQueue m_inputMessageQueue
Input queue to the source.
void handleInputMessages()
virtual bool handleMessage(const Message &message)=0
static qint64 calculateCenterFrequency(quint64 deviceCenterFrequency, qint64 transverterDeltaFrequency, int log2Decim, fcPos_t fcPos, quint32 devSampleRate, FrequencyShiftScheme frequencyShiftScheme, bool transverterMode=false)