commit 7663ecd374cfc042a990077ea5e2659dd920c2cb
parent eaa8148d9a13e5c0a587d124faf2b4caa3466729
Author: samuriddle@gmail.com <samuriddle@gmail.com>
Date: Sun, 7 Aug 2016 07:38:26 +0300
new algorithm: dcremove
Diffstat:
3 files changed, 40 insertions(+), 0 deletions(-)
diff --git a/include/kfr/dsp.hpp b/include/kfr/dsp.hpp
@@ -26,6 +26,7 @@
#include "dsp/biquad.hpp"
#include "dsp/biquad_design.hpp"
+#include "dsp/dcremove.hpp"
#include "dsp/fir.hpp"
#include "dsp/fir_design.hpp"
#include "dsp/fracdelay.hpp"
diff --git a/include/kfr/dsp/dcremove.hpp b/include/kfr/dsp/dcremove.hpp
@@ -0,0 +1,38 @@
+/**
+ * Copyright (C) 2016 D Levin (http://www.kfrlib.com)
+ * This file is part of KFR
+ *
+ * KFR is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * KFR is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with KFR.
+ *
+ * If GPL is not suitable for your project, you must purchase a commercial license to use KFR.
+ * Buying a commercial license is mandatory as soon as you develop commercial activities without
+ * disclosing the source code of your own applications.
+ * See http://www.kfrlib.com for details.
+ */
+#pragma once
+
+#include "biquad.hpp"
+#include "biquad_design.hpp"
+
+namespace kfr
+{
+
+template <typename T, typename E1>
+KFR_INLINE internal::expression_biquads<1, T, internal::arg<E1>> dcremove(
+ E1&& e1, double cutoff = 0.00025)
+{
+ const biquad_params<T> bqs[1] = { biquad_highpass(cutoff, 0.5) };
+ return internal::expression_biquads<1, T, internal::arg<E1>>(bqs, std::forward<E1>(e1));
+}
+}
diff --git a/sources.cmake b/sources.cmake
@@ -65,6 +65,7 @@ set(
${PROJECT_SOURCE_DIR}/include/kfr/dft/reference_dft.hpp
${PROJECT_SOURCE_DIR}/include/kfr/dsp/biquad.hpp
${PROJECT_SOURCE_DIR}/include/kfr/dsp/biquad_design.hpp
+ ${PROJECT_SOURCE_DIR}/include/kfr/dsp/dcremove.hpp
${PROJECT_SOURCE_DIR}/include/kfr/dsp/fir.hpp
${PROJECT_SOURCE_DIR}/include/kfr/dsp/fir_design.hpp
${PROJECT_SOURCE_DIR}/include/kfr/dsp/fracdelay.hpp