MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / work

Method work

Tasks/DelayedConjTask.cpp:58–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

56}
57
58bool
59DelayedConjTask::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
102void
103DelayedConjTask::cancel(void)

Callers

nothing calls this directly

Calls 2

setStatusMethod · 0.80
setProgressMethod · 0.45

Tested by

no test coverage detected