comparison data/model/FFTModel.h @ 1045:1a73618b0b67 cxx11

More type fixes, primarily in the spectrogram
author Chris Cannam
date Tue, 10 Mar 2015 10:31:27 +0000
parents a1cd5abcb38b
children 0fd3661bcfff
comparison
equal deleted inserted replaced
1044:31f01931b781 1045:1a73618b0b67
61 int windowSize, 61 int windowSize,
62 int windowIncrement, 62 int windowIncrement,
63 int fftSize, 63 int fftSize,
64 bool polar, 64 bool polar,
65 StorageAdviser::Criteria criteria = StorageAdviser::NoCriteria, 65 StorageAdviser::Criteria criteria = StorageAdviser::NoCriteria,
66 int fillFromColumn = 0); 66 sv_frame_t fillFromFrame = 0);
67 ~FFTModel(); 67 ~FFTModel();
68 68
69 inline float getMagnitudeAt(int x, int y) { 69 inline float getMagnitudeAt(int x, int y) {
70 return m_server->getMagnitudeAt(x << m_xshift, y << m_yshift); 70 return m_server->getMagnitudeAt(x << m_xshift, y << m_yshift);
71 } 71 }
149 /** 149 /**
150 * Calculate an estimated frequency for a stable signal in this 150 * Calculate an estimated frequency for a stable signal in this
151 * bin, using phase unwrapping. This will be completely wrong if 151 * bin, using phase unwrapping. This will be completely wrong if
152 * the signal is not stable here. 152 * the signal is not stable here.
153 */ 153 */
154 virtual bool estimateStableFrequency(int x, int y, float &frequency); 154 virtual bool estimateStableFrequency(int x, int y, double &frequency);
155 155
156 enum PeakPickType 156 enum PeakPickType
157 { 157 {
158 AllPeaks, /// Any bin exceeding its immediate neighbours 158 AllPeaks, /// Any bin exceeding its immediate neighbours
159 MajorPeaks, /// Peaks picked using sliding median window 159 MajorPeaks, /// Peaks picked using sliding median window
160 MajorPitchAdaptivePeaks /// Bigger window for higher frequencies 160 MajorPitchAdaptivePeaks /// Bigger window for higher frequencies
161 }; 161 };
162 162
163 typedef std::set<int> PeakLocationSet; // bin 163 typedef std::set<int> PeakLocationSet; // bin
164 typedef std::map<int, float> PeakSet; // bin -> freq 164 typedef std::map<int, double> PeakSet; // bin -> freq
165 165
166 /** 166 /**
167 * Return locations of peak bins in the range [ymin,ymax]. If 167 * Return locations of peak bins in the range [ymin,ymax]. If
168 * ymax is zero, getHeight()-1 will be used. 168 * ymax is zero, getHeight()-1 will be used.
169 */ 169 */
198 int m_xshift; 198 int m_xshift;
199 int m_yshift; 199 int m_yshift;
200 200
201 FFTDataServer *getServer(const DenseTimeValueModel *, 201 FFTDataServer *getServer(const DenseTimeValueModel *,
202 int, WindowType, int, int, int, 202 int, WindowType, int, int, int,
203 bool, StorageAdviser::Criteria, int); 203 bool, StorageAdviser::Criteria, sv_frame_t);
204 204
205 int getPeakPickWindowSize(PeakPickType type, sv_samplerate_t sampleRate, 205 int getPeakPickWindowSize(PeakPickType type, sv_samplerate_t sampleRate,
206 int bin, float &percentile) const; 206 int bin, float &percentile) const;
207 207
208 int getYRatio() { 208 int getYRatio() {