From c7437b4b8481b49e38bf9c8286378381310a4faa Mon Sep 17 00:00:00 2001 From: cff-gite Date: Mon, 26 Feb 2024 16:53:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E8=A7=84=E8=8C=83=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: cff-gite Change-Id: Ifcd81fa8d84e065816341daa998603d76d2e8d3d --- .../core/algorithm/conversion/include/conversion_fft.h | 4 ++-- .../core/algorithm/conversion/include/conversion_filter.h | 6 +++--- .../core/algorithm/conversion/include/conversion_mfcc.h | 4 ++-- vibration_convert/core/algorithm/conversion/include/fft.h | 4 ++-- .../core/algorithm/conversion/src/conversion_fft.cpp | 6 +++--- .../core/algorithm/conversion/src/conversion_filter.cpp | 6 +++--- .../core/algorithm/conversion/src/conversion_mfcc.cpp | 6 +++--- vibration_convert/core/algorithm/conversion/src/fft.cpp | 6 +++--- .../frequency_estimation/include/frequency_estimation.h | 4 ++-- .../frequency_estimation/src/frequency_estimation.cpp | 6 +++--- 10 files changed, 26 insertions(+), 26 deletions(-) diff --git a/vibration_convert/core/algorithm/conversion/include/conversion_fft.h b/vibration_convert/core/algorithm/conversion/include/conversion_fft.h index 49f3ee2f..7165d241 100644 --- a/vibration_convert/core/algorithm/conversion/include/conversion_fft.h +++ b/vibration_convert/core/algorithm/conversion/include/conversion_fft.h @@ -314,6 +314,6 @@ private: // so.. note that clever use of it can also provide a "gain" control of sorts // (fe: set intercept to 2f and slope to 0f to double gain) }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // CONVERSION_FFT_H diff --git a/vibration_convert/core/algorithm/conversion/include/conversion_filter.h b/vibration_convert/core/algorithm/conversion/include/conversion_filter.h index 925af0f9..5e141ca0 100644 --- a/vibration_convert/core/algorithm/conversion/include/conversion_filter.h +++ b/vibration_convert/core/algorithm/conversion/include/conversion_filter.h @@ -27,7 +27,7 @@ namespace OHOS { namespace Sensors { namespace { constexpr size_t ARRAY_SIZE { 10 }; -} // namespace +} // namespace /** * @brief selection of filters @@ -128,6 +128,6 @@ private: double filterCoefficient_ { 0.0 }; int32_t sampleRate_ { 0 }; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // CONVERSION_FILTER_H \ No newline at end of file diff --git a/vibration_convert/core/algorithm/conversion/include/conversion_mfcc.h b/vibration_convert/core/algorithm/conversion/include/conversion_mfcc.h index 51598242..6fe28fe2 100644 --- a/vibration_convert/core/algorithm/conversion/include/conversion_mfcc.h +++ b/vibration_convert/core/algorithm/conversion/include/conversion_mfcc.h @@ -106,6 +106,6 @@ private: std::vector dctMatrix_; std::vector coeffs_; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // CONVERSION_MFCC_H \ No newline at end of file diff --git a/vibration_convert/core/algorithm/conversion/include/fft.h b/vibration_convert/core/algorithm/conversion/include/fft.h index 958392d3..d4c03403 100644 --- a/vibration_convert/core/algorithm/conversion/include/fft.h +++ b/vibration_convert/core/algorithm/conversion/include/fft.h @@ -120,6 +120,6 @@ private: FftParaAndResult para_; uint32_t** fftBitTable_ { nullptr }; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // FFT_H \ No newline at end of file diff --git a/vibration_convert/core/algorithm/conversion/src/conversion_fft.cpp b/vibration_convert/core/algorithm/conversion/src/conversion_fft.cpp index 4ef39a0a..d6694378 100644 --- a/vibration_convert/core/algorithm/conversion/src/conversion_fft.cpp +++ b/vibration_convert/core/algorithm/conversion/src/conversion_fft.cpp @@ -27,7 +27,7 @@ namespace Sensors { namespace { constexpr int32_t SPECTRUM_COUNT_MAX { 8192 }; constexpr int32_t MAX_FFT_SIZE { 10240 }; -} // namespace +} // namespace int32_t ConversionFFT::Init(const FFTInputPara &fftPara) { @@ -309,5 +309,5 @@ int32_t ConversionOctave::Calculate(const std::vector &fftData) } return Sensors::SUCCESS; } -} // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace Sensors +} // namespace OHOS \ No newline at end of file diff --git a/vibration_convert/core/algorithm/conversion/src/conversion_filter.cpp b/vibration_convert/core/algorithm/conversion/src/conversion_filter.cpp index 261a9528..f54f8523 100644 --- a/vibration_convert/core/algorithm/conversion/src/conversion_filter.cpp +++ b/vibration_convert/core/algorithm/conversion/src/conversion_filter.cpp @@ -27,7 +27,7 @@ constexpr double CUT_OFF_MIN { 10.0 }; constexpr double VALIDE_RESONANCE_MAX { 0.999999 }; constexpr double AMOUNT_RESONANCE_MIN { 1.0 }; constexpr double BAND_PASS_COEF { 4.0 }; -} // namespace +} // namespace // I particularly like these. cutoff between 0 and 1 double ConversionFilter::FilterLowPass(double input, double cutoff) @@ -160,5 +160,5 @@ double ConversionFilter::HandleHighPassOrLowPass(double input, double cutoff, bo { return isHighPass ? FilterHighPass(input, cutoff) : FilterLowPass(input, cutoff); } -} // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace Sensors +} // namespace OHOS \ No newline at end of file diff --git a/vibration_convert/core/algorithm/conversion/src/conversion_mfcc.cpp b/vibration_convert/core/algorithm/conversion/src/conversion_mfcc.cpp index 6982f4df..126329b8 100644 --- a/vibration_convert/core/algorithm/conversion/src/conversion_mfcc.cpp +++ b/vibration_convert/core/algorithm/conversion/src/conversion_mfcc.cpp @@ -28,7 +28,7 @@ namespace Sensors { namespace { constexpr double BANDS_MIN_THRESHOLD { 0.000001 }; constexpr uint32_t MEL_FILTERS_OR_COEFFS_MAX { 4096 * 4096 }; -} // namespace +} // namespace int32_t ConversionMfcc::HandleMelFilterAndLogSquare(const std::vector &powerSpectrum) { @@ -267,5 +267,5 @@ int32_t ConversionMfcc::FiltersMel(int32_t nFft, MfccInputPara para, } return Sensors::SUCCESS; } -} // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace Sensors +} // namespace OHOS \ No newline at end of file diff --git a/vibration_convert/core/algorithm/conversion/src/fft.cpp b/vibration_convert/core/algorithm/conversion/src/fft.cpp index 703162f1..5d6077c8 100644 --- a/vibration_convert/core/algorithm/conversion/src/fft.cpp +++ b/vibration_convert/core/algorithm/conversion/src/fft.cpp @@ -37,7 +37,7 @@ constexpr double HAMMING_WND_DOWN { 0.46 }; constexpr float VOLUME_MIN { 0.000001 }; constexpr double AMP_TO_DB_COEF { 20.0 }; constexpr bool TRANSFORM_INVERSE_FLAG { true }; -} // namespace +} // namespace Fft::~Fft() { @@ -446,5 +446,5 @@ void Fft::InversePowerSpectrum(const std::vector &window, const std::vect ConvertCart(magnitude, phase); CalcIFFT(window, finalOut); } -} // namespace Sensors -} // namespace OHOS \ No newline at end of file +} // namespace Sensors +} // namespace OHOS \ No newline at end of file diff --git a/vibration_convert/core/algorithm/frequency_estimation/include/frequency_estimation.h b/vibration_convert/core/algorithm/frequency_estimation/include/frequency_estimation.h index cc7d46d0..5a6fbf0c 100644 --- a/vibration_convert/core/algorithm/frequency_estimation/include/frequency_estimation.h +++ b/vibration_convert/core/algorithm/frequency_estimation/include/frequency_estimation.h @@ -62,6 +62,6 @@ private: private: bool freqReaderAbsFlag_ { true }; }; -} // namespace Sensors -} // namespace OHOS +} // namespace Sensors +} // namespace OHOS #endif // FREQUENCY_ESTIMATION_H \ No newline at end of file diff --git a/vibration_convert/core/algorithm/frequency_estimation/src/frequency_estimation.cpp b/vibration_convert/core/algorithm/frequency_estimation/src/frequency_estimation.cpp index f9b562a9..eadfa93b 100644 --- a/vibration_convert/core/algorithm/frequency_estimation/src/frequency_estimation.cpp +++ b/vibration_convert/core/algorithm/frequency_estimation/src/frequency_estimation.cpp @@ -32,7 +32,7 @@ constexpr double BASE_SEMITONE { 69.0 }; constexpr double PITCH_INTERVAL_MIN { 12.0 }; constexpr double LA_FREQUENCE { 440.0 }; constexpr double PITCH_INTERVAL_MAX { 108.0 }; -} // namespace +} // namespace double FrequencyEstimation::Mean(const std::vector &data) { @@ -103,5 +103,5 @@ std::vector FrequencyEstimation::GetZeroCrossingRate(const std::vector