| 175 | } |
| 176 | |
| 177 | bool |
| 178 | WaveSampler::sampleGardner(void) |
| 179 | { |
| 180 | long amount = static_cast<long>(this->properties.length) - this->p; |
| 181 | long p = this->p; |
| 182 | SUCOMPLEX x = 0, prev = this->prevSample; |
| 183 | SUSDIFF count; |
| 184 | |
| 185 | if (amount > SIGDIGGER_WAVESAMPLER_FEEDER_BLOCK_LENGTH) |
| 186 | amount = SIGDIGGER_WAVESAMPLER_FEEDER_BLOCK_LENGTH; |
| 187 | |
| 188 | if (this->properties.space == FREQUENCY) { |
| 189 | // Perform quadrature demodulation directly in here. |
| 190 | while (amount--) { |
| 191 | x = this->properties.data[p++]; |
| 192 | su_clock_detector_feed(&this->cd, x * SU_C_CONJ(prev)); |
| 193 | prev = x; |
| 194 | } |
| 195 | |
| 196 | this->prevSample = prev; |
| 197 | } else { |
| 198 | while (amount--) |
| 199 | su_clock_detector_feed(&this->cd, this->properties.data[p++]); |
| 200 | } |
| 201 | |
| 202 | count = su_clock_detector_read( |
| 203 | &this->cd, |
| 204 | this->set.block, |
| 205 | SIGDIGGER_WAVESAMPLER_FEEDER_BLOCK_LENGTH); |
| 206 | |
| 207 | this->p = p; |
| 208 | this->set.len = static_cast<size_t>(count); |
| 209 | |
| 210 | this->progress = this->p / static_cast<qreal>(this->properties.length); |
| 211 | |
| 212 | return this->p < static_cast<long>(this->properties.length); |
| 213 | } |
| 214 | |
| 215 | bool |
| 216 | WaveSampler::sampleZeroCrossing(void) |