Chris@24: /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ Chris@24: Chris@42: /* Chris@42: Tipic Chris@42: Chris@42: Centre for Digital Music, Queen Mary, University of London. Chris@42: Chris@42: This program is free software; you can redistribute it and/or Chris@42: modify it under the terms of the GNU General Public License as Chris@42: published by the Free Software Foundation; either version 2 of the Chris@42: License, or (at your option) any later version. See the file Chris@42: COPYING included with this distribution for more information. Chris@42: */ Chris@42: Chris@24: #ifndef LOGCOMPRESS_H Chris@24: #define LOGCOMPRESS_H Chris@24: Chris@24: #include Chris@24: #include Chris@24: Chris@24: class LogCompress Chris@24: { Chris@24: public: Chris@24: static std::vector process(std::vector in, Chris@24: double factor, Chris@24: double addTerm) { Chris@24: std::vector out; Chris@24: out.reserve(in.size()); Chris@24: for (auto x: in) { Chris@24: out.push_back(log10(addTerm + factor * x)); Chris@24: } Chris@49: return out; Chris@24: } Chris@24: }; Chris@24: Chris@24: #endif Chris@24: