summaryrefslogtreecommitdiff
path: root/src/signalProcessing/hilbert/shilberta.c
diff options
context:
space:
mode:
authortorset2008-12-22 09:01:17 +0000
committertorset2008-12-22 09:01:17 +0000
commitf078539597de7a54d982984635ee6cdbe36fe138 (patch)
tree80c7026547a535b96b04c1e8847e1d73fcac864a /src/signalProcessing/hilbert/shilberta.c
parent92a94f77a9d6a31d2423e85f74547eca45d89425 (diff)
downloadscilab2c-f078539597de7a54d982984635ee6cdbe36fe138.tar.gz
scilab2c-f078539597de7a54d982984635ee6cdbe36fe138.tar.bz2
scilab2c-f078539597de7a54d982984635ee6cdbe36fe138.zip
Add hilbert (failed but I don't know why)
Diffstat (limited to 'src/signalProcessing/hilbert/shilberta.c')
-rw-r--r--src/signalProcessing/hilbert/shilberta.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/signalProcessing/hilbert/shilberta.c b/src/signalProcessing/hilbert/shilberta.c
new file mode 100644
index 00000000..bbdd4eaf
--- /dev/null
+++ b/src/signalProcessing/hilbert/shilberta.c
@@ -0,0 +1,32 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2008 - INRIA - Arnaud TORSET
+ *
+ * This file must be used under the terms of the CeCILL.
+ * This source file is licensed as described in the file COPYING, which
+ * you should have received as part of this distribution. The terms
+ * are also available at
+ * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+ *
+ */
+
+#include "hilbert.h"
+#include "fft.h"
+#include "ifft.h"
+#include "multiplication.h"
+
+void shilberta (float* in, int rows, int cols, floatComplex *out){
+ int i;
+
+
+ for (i=0;i<rows*cols;i++) out[i]=FloatComplex(in[i],0);
+
+ cfftma(out, rows, cols, out);
+
+ for (i=0;i<rows;i++){
+ if ((i>0)&&(i<cols/2)) out[i] = cmuls(out[i],FloatComplex(2,0));
+ if (i>cols/2+1) out[i] = cmuls(out[i],FloatComplex(0,0));
+ }
+
+ cifftma(out, rows, cols,out);
+}