Mercurial > hg > tipic
view src/OctaveFold.h @ 30:00df792783e3
Faster filter implementation (less copying)
author | Chris Cannam |
---|---|
date | Wed, 30 Sep 2015 13:45:08 +0100 |
parents | 2c913b88b808 |
children | 00b6ae41efbe |
line wrap: on
line source
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ #ifndef OCTAVEFOLD_H #define OCTAVEFOLD_H #include <vector> class OctaveFold { public: static std::vector<double> process(std::vector<double> in) { std::vector<double> out(12, 0.0); for (int i = 0; i < int(in.size()); ++i) { out[(i+1) % 12] += in[i]; } return std::move(out); } }; #endif