comparison layer/SpectrumLayer.h @ 1403:10e768adaee5

Retain consistent min freq (rather than min bin no) when changing fft parameters in spectrum; scale ffts by window size rather than fft size in case of oversampling, to avoid fading out because of scale factor including zero padding
author Chris Cannam
date Thu, 15 Nov 2018 15:08:08 +0000
parents 900bed394f5a
children a18e78b9c78b
comparison
equal deleted inserted replaced
1402:b0eeec95ab5b 1403:10e768adaee5
66 int value) const override; 66 int value) const override;
67 virtual RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const override; 67 virtual RangeMapper *getNewPropertyRangeMapper(const PropertyName &) const override;
68 virtual void setProperty(const PropertyName &, int value) override; 68 virtual void setProperty(const PropertyName &, int value) override;
69 virtual void setProperties(const QXmlAttributes &) override; 69 virtual void setProperties(const QXmlAttributes &) override;
70 70
71 virtual bool setDisplayExtents(double min, double max) override;
72
71 virtual bool getXScaleValue(const LayerGeometryProvider *v, int x, 73 virtual bool getXScaleValue(const LayerGeometryProvider *v, int x,
72 double &value, QString &unit) const override; 74 double &value, QString &unit) const override;
73 75
74 virtual bool getYScaleValue(const LayerGeometryProvider *, int y, 76 virtual bool getYScaleValue(const LayerGeometryProvider *, int y,
75 double &value, QString &unit) const override; 77 double &value, QString &unit) const override;
121 int m_windowHopLevel; 123 int m_windowHopLevel;
122 int m_oversampling; 124 int m_oversampling;
123 bool m_showPeaks; 125 bool m_showPeaks;
124 mutable bool m_newFFTNeeded; 126 mutable bool m_newFFTNeeded;
125 127
128 double m_freqOfMinBin; // used to ensure accurate
129 // alignment when changing
130 // fft size
131
126 mutable QMutex m_fftMutex; 132 mutable QMutex m_fftMutex;
127 133
128 void setupFFT(); 134 void setupFFT();
129 135
130 virtual double getBinForFrequency(double freq) const; 136 virtual double getBinForFrequency(double freq) const;