From 8f6890641e85d8ac5e59415e0f5d1cebbe49a7e3 Mon Sep 17 00:00:00 2001 From: f4exb Date: Sat, 7 Mar 2020 11:06:41 +0100 Subject: [PATCH] ChirpChat modulator: removed unused constant ramps --- .../modchirpchat/chirpchatmodsource.cpp | 22 ------------------- .../modchirpchat/chirpchatmodsource.h | 2 -- 2 files changed, 24 deletions(-) diff --git a/plugins/channeltx/modchirpchat/chirpchatmodsource.cpp b/plugins/channeltx/modchirpchat/chirpchatmodsource.cpp index 3cbb5bb77..0a03496a3 100644 --- a/plugins/channeltx/modchirpchat/chirpchatmodsource.cpp +++ b/plugins/channeltx/modchirpchat/chirpchatmodsource.cpp @@ -24,8 +24,6 @@ const int ChirpChatModSource::m_levelNbSamples = 480; // every 10ms ChirpChatModSource::ChirpChatModSource() : m_channelSampleRate(48000), m_channelFrequencyOffset(0), - m_downChirps(nullptr), - m_upChirps(nullptr), m_phaseIncrements(nullptr), m_modPhasor(0.0f), m_levelCalcCount(0), @@ -45,39 +43,19 @@ ChirpChatModSource::ChirpChatModSource() : ChirpChatModSource::~ChirpChatModSource() { - delete[] m_downChirps; - delete[] m_upChirps; delete[] m_phaseIncrements; } void ChirpChatModSource::initSF(unsigned int sf) { - if (m_downChirps) { - delete[] m_downChirps; - } - if (m_upChirps) { - delete[] m_upChirps; - } - m_fftLength = 1 << sf; m_state = ChirpChatStateIdle; m_quarterSamples = (m_fftLength/4)*ChirpChatModSettings::oversampling; - m_downChirps = new Complex[2*m_fftLength*ChirpChatModSettings::oversampling]; // Each table is 2 chirps long to allow use from arbitrary offsets. - m_upChirps = new Complex[2*m_fftLength*ChirpChatModSettings::oversampling]; float halfAngle = M_PI/ChirpChatModSettings::oversampling; float phase = -halfAngle; double accumulator = 0; - for (int i = 0; i < 2*m_fftLength*ChirpChatModSettings::oversampling; i++) - { - accumulator = fmod(accumulator + phase, 2*M_PI); - m_downChirps[i] = Complex(std::conj(std::polar(0.891235351562 * SDR_TX_SCALED, accumulator))); // -1 dB - m_upChirps[i] = Complex(std::polar(0.891235351562 * SDR_TX_SCALED, accumulator)); - phase += (2*halfAngle) / (m_fftLength*ChirpChatModSettings::oversampling); - phase = phase > halfAngle ? phase - 2.0*halfAngle : phase; - } - if (m_phaseIncrements) { delete[] m_phaseIncrements; } diff --git a/plugins/channeltx/modchirpchat/chirpchatmodsource.h b/plugins/channeltx/modchirpchat/chirpchatmodsource.h index 0ab0f0460..de54b3421 100644 --- a/plugins/channeltx/modchirpchat/chirpchatmodsource.h +++ b/plugins/channeltx/modchirpchat/chirpchatmodsource.h @@ -66,8 +66,6 @@ private: ChirpChatModSettings m_settings; ChirpChatState m_state; - Complex *m_downChirps; - Complex *m_upChirps; double *m_phaseIncrements; std::vector m_symbols; unsigned int m_fftLength; //!< chirp length in samples