Mercurial > hg > qm-dsp
diff maths/MathUtilities.h @ 280:9c403afdd9e9
* Various fixes related to the bar estimator code
author | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Tue, 10 Feb 2009 16:37:11 +0000 |
parents | c8908cdc8c32 |
children | 702ff8c08137 |
line wrap: on
line diff
--- a/maths/MathUtilities.h Tue Feb 10 12:52:43 2009 +0000 +++ b/maths/MathUtilities.h Tue Feb 10 16:37:11 2009 +0000 @@ -52,6 +52,11 @@ // moving mean threshholding: static void adaptiveThreshold(std::vector<double> &data); + + static bool isPowerOfTwo(int x); + static int nextPowerOfTwo(int x); // e.g. 1300 -> 2048, 2048 -> 2048 + static int previousPowerOfTwo(int x); // e.g. 1300 -> 1024, 2048 -> 2048 + static int nearestPowerOfTwo(int x); // e.g. 1300 -> 1024, 1700 -> 2048 }; #endif