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

Method feed

Misc/SNREstimator.cpp:145–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145void
146SNREstimator::feed(std::vector<unsigned int> const &history)
147{
148 unsigned int max = 0;
149
150 if (this->length != history.size()) {
151 this->length = static_cast<unsigned int>(history.size());
152 this->gaussian.resize(this->length);
153 this->Hi.resize(this->length);
154 this->Htilde.resize(this->length);
155 this->hx = 1.f / this->length;
156 }
157
158 for (unsigned int i = 0; i < history.size(); ++i)
159 if (max < history[i])
160 max = history[i];
161
162 if (max == 0)
163 max = 1;
164
165 for (unsigned int i = 0; i < history.size(); ++i)
166 this->Htilde[i] = static_cast<float>(history[i]) / max;
167
168 this->iterate();
169}
170
171void
172SNREstimator::setAlpha(float alpha)

Callers

nothing calls this directly

Calls 2

iterateMethod · 0.95
sizeMethod · 0.45

Tested by

no test coverage detected