comparison data/fft/FFTDataServer.cpp @ 246:d7eeffbb8aaf

* Add fuzzy interpolation option as an alternative to zero padding in spectrogram (looks terrible though) * Make spectrogram appear more quickly by having the FFT server notify of updates more often near the start of its run
author Chris Cannam
date Mon, 05 Mar 2007 15:32:55 +0000
parents 85bf384db35f
children dc46851837d6
comparison
equal deleted inserted replaced
245:4cd620bd4c61 246:d7eeffbb8aaf
1133 size_t start = m_server.m_model->getStartFrame(); 1133 size_t start = m_server.m_model->getStartFrame();
1134 size_t end = m_server.m_model->getEndFrame(); 1134 size_t end = m_server.m_model->getEndFrame();
1135 size_t remainingEnd = end; 1135 size_t remainingEnd = end;
1136 1136
1137 int counter = 0; 1137 int counter = 0;
1138 int updateAt = (end / m_server.m_windowIncrement) / 20; 1138 int updateAt = 1;
1139 if (updateAt < 100) updateAt = 100; 1139 int maxUpdateAt = (end / m_server.m_windowIncrement) / 20;
1140 if (maxUpdateAt < 100) maxUpdateAt = 100;
1140 1141
1141 if (m_fillFrom > start) { 1142 if (m_fillFrom > start) {
1142 1143
1143 for (size_t f = m_fillFrom; f < end; f += m_server.m_windowIncrement) { 1144 for (size_t f = m_fillFrom; f < end; f += m_server.m_windowIncrement) {
1144 1145
1164 if (++counter == updateAt) { 1165 if (++counter == updateAt) {
1165 m_extent = f; 1166 m_extent = f;
1166 m_completion = size_t(100 * fabsf(float(f - m_fillFrom) / 1167 m_completion = size_t(100 * fabsf(float(f - m_fillFrom) /
1167 float(end - start))); 1168 float(end - start)));
1168 counter = 0; 1169 counter = 0;
1170 if (updateAt < maxUpdateAt) {
1171 updateAt *= 2;
1172 if (updateAt > maxUpdateAt) updateAt = maxUpdateAt;
1173 }
1169 } 1174 }
1170 } 1175 }
1171 1176
1172 remainingEnd = m_fillFrom; 1177 remainingEnd = m_fillFrom;
1173 if (remainingEnd > start) --remainingEnd; 1178 if (remainingEnd > start) --remainingEnd;
1198 m_extent = f; 1203 m_extent = f;
1199 m_completion = baseCompletion + 1204 m_completion = baseCompletion +
1200 size_t(100 * fabsf(float(f - start) / 1205 size_t(100 * fabsf(float(f - start) /
1201 float(end - start))); 1206 float(end - start)));
1202 counter = 0; 1207 counter = 0;
1208 if (updateAt < maxUpdateAt) {
1209 updateAt *= 2;
1210 if (updateAt > maxUpdateAt) updateAt = maxUpdateAt;
1211 }
1203 } 1212 }
1204 } 1213 }
1205 1214
1206 m_completion = 100; 1215 m_completion = 100;
1207 m_extent = end; 1216 m_extent = end;