comparison data/model/AggregateWaveModel.cpp @ 1100:5cbf71022679 simple-fft-model

Smooth signal flow through from file to fft model
author Chris Cannam
date Mon, 15 Jun 2015 16:02:58 +0100
parents 4d9816ba0ebe
children 54af1e21705c
comparison
equal deleted inserted replaced
1099:0c351e061945 1100:5cbf71022679
109 109
110 for (int c = ch0; c <= ch1; ++c) { 110 for (int c = ch0; c <= ch1; ++c) {
111 111
112 auto here = m_components[c].model->getData(m_components[c].channel, 112 auto here = m_components[c].model->getData(m_components[c].channel,
113 start, count); 113 start, count);
114 if (here.size() > longest) { 114 if (sv_frame_t(here.size()) > longest) {
115 longest = here.size(); 115 longest = sv_frame_t(here.size());
116 } 116 }
117 for (sv_frame_t i = 0; in_range_for(here, i); ++i) { 117 for (sv_frame_t i = 0; in_range_for(here, i); ++i) {
118 result[i] += here[i]; 118 result[i] += here[i];
119 } 119 }
120 } 120 }
131 131
132 vector<vector<float>> result; 132 vector<vector<float>> result;
133 133
134 for (int c = fromchannel; c <= tochannel; ++c) { 134 for (int c = fromchannel; c <= tochannel; ++c) {
135 auto here = getData(c, start, count); 135 auto here = getData(c, start, count);
136 if (here.size() < min) min = here.size(); 136 if (sv_frame_t(here.size()) < min) {
137 min = sv_frame_t(here.size());
138 }
137 result.push_back(here); 139 result.push_back(here);
138 } 140 }
139 141
140 if (min < count) { 142 if (min < count) {
141 for (auto &v : result) v.resize(min); 143 for (auto &v : result) v.resize(min);