comparison dsp/segmentation/ClusterMeltSegmenter.cpp @ 495:1bea13b8f951

Style fixes in constant-Q: avoid unsigned, reuse our Window class, fix comments
author Chris Cannam <cannam@all-day-breakfast.com>
date Fri, 31 May 2019 18:25:31 +0100
parents bb78ca3fe7de
children
comparison
equal deleted inserted replaced
494:3f649fbb1172 495:1bea13b8f951
80 constq = new ConstantQ(config); 80 constq = new ConstantQ(config);
81 constq->sparsekernel(); 81 constq->sparsekernel();
82 82
83 ncoeff = constq->getK(); 83 ncoeff = constq->getK();
84 84
85 fft = new FFTReal(constq->getfftlength()); 85 fft = new FFTReal(constq->getFFTLength());
86 86
87 } else if (featureType == FEATURE_TYPE_MFCC) { 87 } else if (featureType == FEATURE_TYPE_MFCC) {
88 88
89 // run internal processing at 22050 or thereabouts 89 // run internal processing at 22050 or thereabouts
90 int internalRate = 22050; 90 int internalRate = 22050;
154 if (nsamples < getWindowsize()) { 154 if (nsamples < getWindowsize()) {
155 std::cerr << "ERROR: ClusterMeltSegmenter::extractFeatures: nsamples < windowsize (" << nsamples << " < " << getWindowsize() << ")" << std::endl; 155 std::cerr << "ERROR: ClusterMeltSegmenter::extractFeatures: nsamples < windowsize (" << nsamples << " < " << getWindowsize() << ")" << std::endl;
156 return; 156 return;
157 } 157 }
158 158
159 int fftsize = constq->getfftlength(); 159 int fftsize = constq->getFFTLength();
160 160
161 if (!window || window->getSize() != fftsize) { 161 if (!window || window->getSize() != fftsize) {
162 delete window; 162 delete window;
163 window = new Window<double>(HammingWindow, fftsize); 163 window = new Window<double>(HammingWindow, fftsize);
164 } 164 }