comparison data/model/FFTModel.h @ 1202:3b84f9bd0048 3.0-integration

Merge work on unified spectrogram and colour 3d plot caching renderer
author Chris Cannam
date Fri, 05 Aug 2016 15:05:02 +0100
parents 825d0d7641ba
children bac86d3fc6c9
comparison
equal deleted inserted replaced
1185:69c84a66727b 1202:3b84f9bd0048
74 virtual int getResolution() const { return m_windowIncrement; } 74 virtual int getResolution() const { return m_windowIncrement; }
75 virtual int getYBinCount() const { return getHeight(); } 75 virtual int getYBinCount() const { return getHeight(); }
76 virtual float getMinimumLevel() const { return 0.f; } // Can't provide 76 virtual float getMinimumLevel() const { return 0.f; } // Can't provide
77 virtual float getMaximumLevel() const { return 1.f; } // Can't provide 77 virtual float getMaximumLevel() const { return 1.f; } // Can't provide
78 virtual Column getColumn(int x) const; // magnitudes 78 virtual Column getColumn(int x) const; // magnitudes
79 virtual Column getPhases(int x) const;
79 virtual QString getBinName(int n) const; 80 virtual QString getBinName(int n) const;
80 virtual bool shouldUseLogValueScale() const { return true; } 81 virtual bool shouldUseLogValueScale() const { return true; }
81 virtual int getCompletion() const { 82 virtual int getCompletion() const {
82 int c = 100; 83 int c = 100;
83 if (m_model) { 84 if (m_model) {
93 int getChannel() const { return m_channel; } 94 int getChannel() const { return m_channel; }
94 WindowType getWindowType() const { return m_windowType; } 95 WindowType getWindowType() const { return m_windowType; }
95 int getWindowSize() const { return m_windowSize; } 96 int getWindowSize() const { return m_windowSize; }
96 int getWindowIncrement() const { return m_windowIncrement; } 97 int getWindowIncrement() const { return m_windowIncrement; }
97 int getFFTSize() const { return m_fftSize; } 98 int getFFTSize() const { return m_fftSize; }
99
100 //!!! review which of these are ever actually called
98 101
99 float getMagnitudeAt(int x, int y) const; 102 float getMagnitudeAt(int x, int y) const;
100 float getMaximumMagnitudeAt(int x) const; 103 float getMaximumMagnitudeAt(int x) const;
101 float getPhaseAt(int x, int y) const; 104 float getPhaseAt(int x, int y) const;
102 void getValuesAt(int x, int y, float &real, float &imaginary) const; 105 void getValuesAt(int x, int y, float &real, float &imaginary) const;
103 bool getMagnitudesAt(int x, float *values, int minbin = 0, int count = 0) const; 106 bool getMagnitudesAt(int x, float *values, int minbin = 0, int count = 0) const;
104 float getNormalizedMagnitudesAt(int x, float *values, int minbin = 0, int count = 0) const; // returns maximum of unnormalized magnitudes
105 bool getPhasesAt(int x, float *values, int minbin = 0, int count = 0) const; 107 bool getPhasesAt(int x, float *values, int minbin = 0, int count = 0) const;
106 bool getValuesAt(int x, float *reals, float *imaginaries, int minbin = 0, int count = 0) const; 108 bool getValuesAt(int x, float *reals, float *imaginaries, int minbin = 0, int count = 0) const;
107 109
108 /** 110 /**
109 * Calculate an estimated frequency for a stable signal in this 111 * Calculate an estimated frequency for a stable signal in this
125 /** 127 /**
126 * Return locations of peak bins in the range [ymin,ymax]. If 128 * Return locations of peak bins in the range [ymin,ymax]. If
127 * ymax is zero, getHeight()-1 will be used. 129 * ymax is zero, getHeight()-1 will be used.
128 */ 130 */
129 virtual PeakLocationSet getPeaks(PeakPickType type, int x, 131 virtual PeakLocationSet getPeaks(PeakPickType type, int x,
130 int ymin = 0, int ymax = 0); 132 int ymin = 0, int ymax = 0) const;
131 133
132 /** 134 /**
133 * Return locations and estimated stable frequencies of peak bins. 135 * Return locations and estimated stable frequencies of peak bins.
134 */ 136 */
135 virtual PeakSet getPeakFrequencies(PeakPickType type, int x, 137 virtual PeakSet getPeakFrequencies(PeakPickType type, int x,
136 int ymin = 0, int ymax = 0); 138 int ymin = 0, int ymax = 0) const;
137 139
138 QString getTypeName() const { return tr("FFT"); } 140 QString getTypeName() const { return tr("FFT"); }
139 141
140 public slots: 142 public slots:
141 void sourceModelAboutToBeDeleted(); 143 void sourceModelAboutToBeDeleted();