diff --git a/vibration_convert/core/algorithm/conversion/include/conversion_fft.h b/vibration_convert/core/algorithm/conversion/include/conversion_fft.h index 49f3ee2f16deff1cd58c31c2bf3be0b132484632..7165d241b2a4c537c7ce30c2cbb1989e1f526454 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 925af0f9776010157e8b752fcf62c34922e6ec61..5e141ca0997382c111a86f010f9bb14d8f1c72cc 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 5159824233cc002d08e203b602bfdcb9ae17b5d9..6fe28fe2f32abd7765fe16518ae82bf0528d760c 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 958392d389b2dfe3b3b6ba1311c6f14caf15c98b..d4c03403681f1a6cc31563f950c194172eefca63 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 4ef39a0aa4b70e0e8c2cddc4d34dd0025568d48a..d669437812392fd4eeaa906e3932355fcc30d7ce 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 261a95284afd4df761362aca84e7cd93a296e894..f54f8523eb92295459f5751dc394e03913ac105c 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 6982f4df4fc2fc21bc18a359e8024c5c477fa570..126329b81c9a86b2306334886037535325c6f29d 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 703162f1a06e60876577ee13b3f4f9ef5efcf38f..5d6077c81238a1f76b89dc9a626d27b7d721efda 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 cc7d46d05382c170e069492ff97792805d594ff1..5a6fbf0c0fbd2b4289fbc6febd748bce63bdec52 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 f9b562a96d447901ad3088e2a615649af7ae97ff..eadfa93bd45a4d7997eb8ed7ef58e7c8277b6b5d 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