AP_HAL_ChibiOS: remove redundant harmonics from DSP
This commit is contained in:
parent
d4024d9216
commit
2fab99d647
@ -49,9 +49,9 @@ extern const AP_HAL::HAL& hal;
|
||||
// important as frequency resolution. Referred to as [Heinz] throughout the code.
|
||||
|
||||
// initialize the FFT state machine
|
||||
AP_HAL::DSP::FFTWindowState* DSP::fft_init(uint16_t window_size, uint16_t sample_rate, uint8_t harmonics)
|
||||
AP_HAL::DSP::FFTWindowState* DSP::fft_init(uint16_t window_size, uint16_t sample_rate)
|
||||
{
|
||||
DSP::FFTWindowStateARM* fft = new DSP::FFTWindowStateARM(window_size, sample_rate, harmonics);
|
||||
DSP::FFTWindowStateARM* fft = new DSP::FFTWindowStateARM(window_size, sample_rate);
|
||||
if (fft == nullptr || fft->_hanning_window == nullptr || fft->_rfft_data == nullptr || fft->_freq_bins == nullptr || fft->_derivative_freq_bins == nullptr) {
|
||||
delete fft;
|
||||
return nullptr;
|
||||
@ -77,8 +77,8 @@ uint16_t DSP::fft_analyse(AP_HAL::DSP::FFTWindowState* state, uint16_t start_bin
|
||||
}
|
||||
|
||||
// create an instance of the FFT state machine
|
||||
DSP::FFTWindowStateARM::FFTWindowStateARM(uint16_t window_size, uint16_t sample_rate, uint8_t harmonics)
|
||||
: AP_HAL::DSP::FFTWindowState::FFTWindowState(window_size, sample_rate, harmonics)
|
||||
DSP::FFTWindowStateARM::FFTWindowStateARM(uint16_t window_size, uint16_t sample_rate)
|
||||
: AP_HAL::DSP::FFTWindowState::FFTWindowState(window_size, sample_rate)
|
||||
{
|
||||
if (_freq_bins == nullptr || _hanning_window == nullptr || _rfft_data == nullptr || _derivative_freq_bins == nullptr) {
|
||||
GCS_SEND_TEXT(MAV_SEVERITY_WARNING, "Failed to allocate %u bytes for window %u for DSP",
|
||||
|
@ -29,7 +29,7 @@
|
||||
class ChibiOS::DSP : public AP_HAL::DSP {
|
||||
public:
|
||||
// initialise an FFT instance
|
||||
virtual FFTWindowState* fft_init(uint16_t window_size, uint16_t sample_rate, uint8_t harmonics) override;
|
||||
virtual FFTWindowState* fft_init(uint16_t window_size, uint16_t sample_rate) override;
|
||||
// start an FFT analysis with an ObjectBuffer
|
||||
virtual void fft_start(FFTWindowState* state, FloatBuffer& samples, uint16_t advance) override;
|
||||
// perform remaining steps of an FFT analysis
|
||||
@ -39,7 +39,7 @@ public:
|
||||
class FFTWindowStateARM : public AP_HAL::DSP::FFTWindowState {
|
||||
friend class ChibiOS::DSP;
|
||||
public:
|
||||
FFTWindowStateARM(uint16_t window_size, uint16_t sample_rate, uint8_t harmonics);
|
||||
FFTWindowStateARM(uint16_t window_size, uint16_t sample_rate);
|
||||
virtual ~FFTWindowStateARM();
|
||||
|
||||
private:
|
||||
|
Loading…
Reference in New Issue
Block a user