File indexing completed on 2024-05-12 03:47:52

0001 /*
0002     File                 : nsl_hilbert.h
0003     Project              : LabPlot
0004     Description          : NSL Hilbert transform
0005     --------------------------------------------------------------------
0006     SPDX-FileCopyrightText: 2021 Stefan Gerlach <stefan.gerlach@uni.kn>
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 
0010 #ifndef NSL_HILBERT_H
0011 #define NSL_HILBERT_H
0012 
0013 #include "nsl_dft.h"
0014 #include <stdlib.h>
0015 
0016 /* Hilbert transform result type:
0017  * imag = imaginary part
0018  * envelope = abs(hilbert())
0019  *
0020  * */
0021 #define NSL_HILBERT_RESULT_TYPE_COUNT 2
0022 typedef enum { nsl_hilbert_result_imag, nsl_hilbert_result_envelope } nsl_hilbert_result_type;
0023 extern const char* nsl_hilbert_result_type_name[];
0024 
0025 /* transform data of size n. result in data
0026     calculates the Hilbert transform using algorithm described in
0027     https://de.wikipedia.org/wiki/Hilbert-Transformation#Berechnung_%C3%BCber_Fouriertransformation
0028 */
0029 int nsl_hilbert_transform(double data[], size_t stride, size_t n, nsl_hilbert_result_type type);
0030 
0031 #endif /* NSL_HILBERT_H */