Mercurial > hg > tipic
annotate src/Resize.h @ 60:1ea2aed23d4a tip
Fix version
author | Chris Cannam |
---|---|
date | Thu, 13 Feb 2020 13:37:36 +0000 |
parents | 00b6ae41efbe |
children |
rev | line source |
---|---|
Chris@26 | 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */ |
Chris@26 | 2 |
Chris@42 | 3 /* |
Chris@42 | 4 Tipic |
Chris@42 | 5 |
Chris@42 | 6 Centre for Digital Music, Queen Mary, University of London. |
Chris@42 | 7 |
Chris@42 | 8 This program is free software; you can redistribute it and/or |
Chris@42 | 9 modify it under the terms of the GNU General Public License as |
Chris@42 | 10 published by the Free Software Foundation; either version 2 of the |
Chris@42 | 11 License, or (at your option) any later version. See the file |
Chris@42 | 12 COPYING included with this distribution for more information. |
Chris@42 | 13 */ |
Chris@42 | 14 |
Chris@26 | 15 #ifndef RESIZE_H |
Chris@26 | 16 #define RESIZE_H |
Chris@26 | 17 |
Chris@26 | 18 #include <vector> |
Chris@26 | 19 |
Chris@26 | 20 class Resize |
Chris@26 | 21 { |
Chris@26 | 22 public: |
Chris@26 | 23 // The chroma processing chain requires a 120-bin pitch filterbank |
Chris@26 | 24 // output, even though ours only actually contains 88 bins. Zero |
Chris@26 | 25 // pad at both ends here. |
Chris@26 | 26 static std::vector<double> process(std::vector<double> in) { |
Chris@26 | 27 std::vector<double> resized(20, 0.0); |
Chris@26 | 28 resized.insert(resized.end(), in.begin(), in.end()); |
Chris@26 | 29 resized.resize(120); |
Chris@26 | 30 return resized; |
Chris@26 | 31 } |
Chris@26 | 32 }; |
Chris@26 | 33 |
Chris@26 | 34 #endif |