comparison data/model/FFTModel.h @ 1790:dd51797e528e time-frequency-boxes

Some tidying
author Chris Cannam
date Wed, 25 Sep 2019 09:43:34 +0100
parents 4eac4bf35b45
children c546429d4c2f
comparison
equal deleted inserted replaced
1789:baafe1bb7e51 1790:dd51797e528e
58 int fftSize); 58 int fftSize);
59 ~FFTModel(); 59 ~FFTModel();
60 60
61 // DenseThreeDimensionalModel and Model methods: 61 // DenseThreeDimensionalModel and Model methods:
62 // 62 //
63 bool isOK() const override;
64 int getCompletion() const override;
65
63 int getWidth() const override; 66 int getWidth() const override;
64 int getHeight() const override; 67 int getHeight() const override;
65 float getValueAt(int x, int y) const override { return getMagnitudeAt(x, y); } 68
66 bool isOK() const override; 69 float getValueAt(int x, int y) const override {
67 sv_frame_t getStartFrame() const override { return 0; } 70 return getMagnitudeAt(x, y);
71 }
72 sv_frame_t getStartFrame() const override {
73 return 0;
74 }
68 sv_frame_t getTrueEndFrame() const override { 75 sv_frame_t getTrueEndFrame() const override {
69 return sv_frame_t(getWidth()) * getResolution() + getResolution(); 76 return sv_frame_t(getWidth()) * getResolution() + getResolution();
70 } 77 }
71 sv_samplerate_t getSampleRate() const override; 78 sv_samplerate_t getSampleRate() const override {
72 int getResolution() const override { return m_windowIncrement; } 79 return m_sampleRate;
73 virtual int getYBinCount() const { return getHeight(); } 80 }
81 int getResolution() const override {
82 return m_windowIncrement;
83 }
84
74 float getMinimumLevel() const override { return 0.f; } // Can't provide 85 float getMinimumLevel() const override { return 0.f; } // Can't provide
75 float getMaximumLevel() const override { return 1.f; } // Can't provide 86 float getMaximumLevel() const override { return 1.f; } // Can't provide
87
76 Column getColumn(int x) const override; // magnitudes 88 Column getColumn(int x) const override; // magnitudes
77 virtual Column getPhases(int x) const; 89
90 bool hasBinValues() const override {
91 return true;
92 }
93 QString getBinValueUnit() const override {
94 return "Hz";
95 }
96 bool shouldUseLogValueScale() const override {
97 return true;
98 }
99 float getBinValue(int n) const override;
78 QString getBinName(int n) const override; 100 QString getBinName(int n) const override;
79 bool shouldUseLogValueScale() const override { return true; } 101
80 int getCompletion() const override;
81 virtual QString getError() const { return m_error; }
82 virtual sv_frame_t getFillExtent() const { return getEndFrame(); }
83 QString toDelimitedDataString(QString, DataExportOptions, 102 QString toDelimitedDataString(QString, DataExportOptions,
84 sv_frame_t, sv_frame_t) const override { 103 sv_frame_t, sv_frame_t) const override {
85 return ""; 104 return "";
86 } 105 }
87 106
88 // FFTModel methods: 107 // FFTModel methods:
89 // 108 //
109 QString getError() const { return m_error; }
110
90 int getChannel() const { return m_channel; } 111 int getChannel() const { return m_channel; }
91 WindowType getWindowType() const { return m_windowType; } 112 WindowType getWindowType() const { return m_windowType; }
92 int getWindowSize() const { return m_windowSize; } 113 int getWindowSize() const { return m_windowSize; }
93 int getWindowIncrement() const { return m_windowIncrement; } 114 int getWindowIncrement() const { return m_windowIncrement; }
94 int getFFTSize() const { return m_fftSize; } 115 int getFFTSize() const { return m_fftSize; }
98 119
99 //!!! review which of these are ever actually called 120 //!!! review which of these are ever actually called
100 121
101 float getMagnitudeAt(int x, int y) const; 122 float getMagnitudeAt(int x, int y) const;
102 float getMaximumMagnitudeAt(int x) const; 123 float getMaximumMagnitudeAt(int x) const;
124 Column getPhases(int x) const;
103 float getPhaseAt(int x, int y) const; 125 float getPhaseAt(int x, int y) const;
104 void getValuesAt(int x, int y, float &real, float &imaginary) const; 126 void getValuesAt(int x, int y, float &real, float &imaginary) const;
105 bool getMagnitudesAt(int x, float *values, int minbin = 0, int count = 0) const; 127 bool getMagnitudesAt(int x, float *values, int minbin = 0, int count = 0) const;
106 bool getPhasesAt(int x, float *values, int minbin = 0, int count = 0) const; 128 bool getPhasesAt(int x, float *values, int minbin = 0, int count = 0) const;
107 bool getValuesAt(int x, float *reals, float *imaginaries, int minbin = 0, int count = 0) const; 129 bool getValuesAt(int x, float *reals, float *imaginaries, int minbin = 0, int count = 0) const;