Make const

This commit is contained in:
Jonas Kvinge
2021-06-22 13:45:29 +02:00
parent 8c2b907ff5
commit 58a5367015
33 changed files with 78 additions and 78 deletions

View File

@@ -58,11 +58,11 @@ void FHT::makeCasTable(void) {
}
}
void FHT::scale(float *p, float d) {
void FHT::scale(float *p, float d) const {
for (int i = 0; i < (num_ / 2); i++) *p++ *= d;
}
void FHT::ewma(float *d, float *s, float w) {
void FHT::ewma(float *d, float *s, float w) const {
for (int i = 0; i < (num_ / 2); i++, d++, s++) *d = *d * w + *s * (1 - w);
}

View File

@@ -68,7 +68,7 @@ class FHT {
~FHT();
int sizeExp() const;
int size() const;
void scale(float*, float);
void scale(float*, float) const;
/**
* Exponentially Weighted Moving Average (EWMA) filter.
@@ -76,7 +76,7 @@ class FHT {
* @param s is fresh input.
* @param w is the weighting factor.
*/
void ewma(float *d, float *s, float w);
void ewma(float *d, float *s, float w) const;
/**
* Logarithmic audio spectrum. Maps semi-logarithmic spectrum