| 56 | } |
| 57 | |
| 58 | bool |
| 59 | DelayedConjTask::work(void) |
| 60 | { |
| 61 | size_t amount = this->length - this->p; |
| 62 | size_t p = this->p; |
| 63 | SUCOMPLEX x, prev; |
| 64 | SUSCOUNT delay = this->delay; |
| 65 | SUFLOAT kinv; |
| 66 | |
| 67 | if (amount > SIGDIGGER_DELAYEDCONJ_BLOCK_LENGTH) |
| 68 | amount = SIGDIGGER_DELAYEDCONJ_BLOCK_LENGTH; |
| 69 | |
| 70 | while (amount--) { |
| 71 | x = this->origin[p]; |
| 72 | if (p < delay) { |
| 73 | this->destination[p] = 0; |
| 74 | } else { |
| 75 | prev = this->delayLine[q]; |
| 76 | kinv = 1. / (SU_C_ABS(prev) + 1e-3); |
| 77 | this->destination[p] = kinv * x * SU_C_CONJ(prev); |
| 78 | } |
| 79 | |
| 80 | this->delayLine[q++] = x; |
| 81 | if (q == delay) |
| 82 | q = 0; |
| 83 | ++p; |
| 84 | } |
| 85 | |
| 86 | this->p = p; |
| 87 | this->setStatus("Processing (" |
| 88 | + QString::number(p) |
| 89 | + "/" |
| 90 | + QString::number(this->length) |
| 91 | + ")..."); |
| 92 | |
| 93 | this->setProgress(static_cast<qreal>(p) / static_cast<qreal>(this->length)); |
| 94 | |
| 95 | if (this->p < this->length) |
| 96 | return true; |
| 97 | |
| 98 | emit done(); |
| 99 | return false; |
| 100 | } |
| 101 | |
| 102 | void |
| 103 | DelayedConjTask::cancel(void) |
nothing calls this directly
no test coverage detected