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