comparison base/ColumnOp.cpp @ 1837:1b688ab5f1b3

Unify various vectors to our base floatvec_t type; store columns in fft model cache at their desired height so we can return a reference (speeding up the peak-frequency spectrogram in particular)
author Chris Cannam
date Thu, 09 Apr 2020 11:22:55 +0100
parents 9ef1cc26024c
children
comparison
equal deleted inserted replaced
1835:804dd0c06f0e 1837:1b688ab5f1b3
30 } 30 }
31 31
32 ColumnOp::Column 32 ColumnOp::Column
33 ColumnOp::peakPick(const Column &in) 33 ColumnOp::peakPick(const Column &in)
34 { 34 {
35 vector<float> out(in.size(), 0.f); 35 Column out(in.size(), 0.f);
36 36
37 for (int i = 0; in_range_for(in, i); ++i) { 37 for (int i = 0; in_range_for(in, i); ++i) {
38 if (isPeak(in, i)) { 38 if (isPeak(in, i)) {
39 out[i] = in[i]; 39 out[i] = in[i];
40 } 40 }
117 int h, 117 int h,
118 const vector<double> &binfory, 118 const vector<double> &binfory,
119 int minbin, 119 int minbin,
120 bool interpolate) 120 bool interpolate)
121 { 121 {
122 vector<float> out(h, 0.f); 122 Column out(h, 0.f);
123 int bins = int(in.size()); 123 int bins = int(in.size());
124 124
125 if (interpolate) { 125 if (interpolate) {
126 // If the bins are all closer together than the target y 126 // If the bins are all closer together than the target y
127 // coordinate increments, then we don't want to interpolate 127 // coordinate increments, then we don't want to interpolate