libdspl-2.0
Digital Signal Processing Algorithm Library
dspl.h
1/*
2* Copyright (c) 2015-2022 Sergey Bakhurin
3* Digital Signal Processing Library [http://dsplib.org]
4*
5* This file is part of libdspl-2.0.
6*
7* is free software: you can redistribute it and/or modify
8* it under the terms of the GNU Lesser General Public License as published by
9* the Free Software Foundation, either version 3 of the License, or
10* (at your option) any later version.
11*
12* DSPL is distributed in the hope that it will be useful,
13* but WITHOUT ANY WARRANTY; without even the implied warranty of
14* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15* GNU General Public License for more details.
16*
17* You should have received a copy of the GNU Lesser General Public License
18* along with Foobar. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21
22#ifndef DSPL_H
23#define DSPL_H
24
25#include <math.h>
26
27/* math const definition */
28#ifndef M_PI
29 #define M_PI 3.1415926535897932384626433832795
30#endif
31
32#ifndef M_2PI
33 #define M_2PI 6.283185307179586476925286766559
34#endif
35
36
37#ifdef DOXYGEN_ENGLISH
60#endif
61#ifdef DOXYGEN_RUSSIAN
85#endif
86typedef double complex_t[2];
87
88
89
90#ifdef DOXYGEN_ENGLISH
183#endif
184#ifdef DOXYGEN_RUSSIAN
276#endif
277typedef struct
278{
282
283 /* radix-2 twiddle factors vectors */
284 complex_t w32[ 32];
285 complex_t w64[ 64];
286 complex_t w128[128];
287 complex_t w256[256];
288 complex_t w512[512];
292 int n;
293} fft_t;
294
295
296
297#define RAND_TYPE_MRG32K3A 0x00000001
298#define RAND_TYPE_MT19937 0x00000002
299#define RAND_MT19937_NN 312
300
301#ifdef DOXYGEN_ENGLISH
302
303#endif
304#ifdef DOXYGEN_RUSSIAN
348#endif
349typedef struct
350{
351
353 double mrg32k3a_x[3];
354 double mrg32k3a_y[3];
355
356 /* The array for the MT19937 state vector */
357 unsigned long long mt19937_mt[RAND_MT19937_NN];
359
360 int type;
361
362}random_t;
363
364
365
366#ifdef DOXYGEN_ENGLISH
392#endif
393#ifdef DOXYGEN_RUSSIAN
419#endif
420#define RE(x) (x[0])
421
422
423
424#ifdef DOXYGEN_ENGLISH
451#endif
452#ifdef DOXYGEN_RUSSIAN
477#endif
478#define IM(x) (x[1])
479
480
481
482#define SQR(x) ((x) * (x))
483
484
485#ifdef DOXYGEN_ENGLISH
509#endif
510#ifdef DOXYGEN_RUSSIAN
533#endif
534#define ABSSQR(x) ((SQR(RE(x))) + (SQR(IM(x))))
535
536
537
538
539#define ABS(x) sqrt((ABSSQR(x)))
540
541
542#define ARG(x) atan2(IM(x), RE(x))
543
544
545#define CMRE(a,b) ((RE(a)) * (RE(b)) - (IM(a)) * (IM(b)))
546
547
548#define CMIM(a,b) ((RE(a)) * (IM(b)) + (IM(a)) * (RE(b)))
549
550
551#define CMCONJRE(a, b) ((RE(a)) * (RE(b)) + (IM(a)) * (IM(b)))
552
553
554#define CMCONJIM(a, b) ((IM(a)) * (RE(b)) - (RE(a)) * (IM(b)))
555
556
557
558#define RES_OK 0
559
560/* Error codes */
561/* A 0x01xxxxxx*/
562#define ERROR_ARG_PARAM 0x01180716
563/* B 0x02xxxxxx*/
564/* C 0x03xxxxxx*/
565/* D 0x04xxxxxx*/
566#define ERROR_DAT_TYPE 0x04012020
567#define ERROR_DIV_ZERO 0x04102226
568/* E 0x05xxxxxx*/
569#define ERROR_ELLIP_MODULE 0x05121315
570/* F 0x06xxxxxx*/
571#define ERROR_FFT_SIZE 0x06062021
572#define ERROR_FILTER_A0 0x06090100
573#define ERROR_FILTER_APPROX 0x06090116
574#define ERROR_FILTER_FT 0x06090620
575#define ERROR_FILTER_ORD 0x06091518
576#define ERROR_FILTER_ORD_BP 0x06091519
577#define ERROR_FILTER_RP 0x06091816
578#define ERROR_FILTER_RS 0x06091819
579#define ERROR_FILTER_TYPE 0x06092025
580#define ERROR_FILTER_WP 0x06092316
581#define ERROR_FILTER_WS 0x06092319
582#define ERROR_FNAME 0x06140113
583#define ERROR_FOPEN 0x06151605
584#define ERROR_FREAD_SIZE 0x06180501
585#define ERROR_FS 0x06190000
586#define ERROR_FWRITE_SIZE 0x06231820
587/* G 0x07xxxxxx*/
588#define ERROR_GNUPLOT_CREATE 0x07161203
589#define ERROR_GNUPLOT_FNPNG 0x07161206
590#define ERROR_GNUPLOT_TERM 0x07161220
591/* H 0x08xxxxxx*/
592/* I 0x09xxxxxx*/
593#define ERROR_INF 0x09140600
594/* J 0x10xxxxxx*/
595/* K 0x11xxxxxx*/
596/* L 0x12xxxxxx*/
597#define ERROR_LAPACK 0x12011601
598/* M 0x13xxxxxx*/
599#define ERROR_MALLOC 0x13011212
600#define ERROR_MATRIX_SIZE 0x13011926
601#define ERROR_MIN_MAX 0x13091413
602/* N 0x14xxxxxx*/
603#define ERROR_NAN 0x14011400
604#define ERROR_NEGATIVE 0x14050701
605/* O 0x15xxxxxx*/
606#define ERROR_OVERLAP 0x15220412
607/* P 0x16xxxxxx*/
608#define ERROR_POLY_AN 0x16150114
609#define ERROR_POLY_ORD 0x16151518
610#define ERROR_PTR 0x16201800
611/* Q 0x17xxxxxx*/
612/* R 0x18xxxxxx*/
613#define ERROR_RAND_SIGMA 0x18011909
614#define ERROR_RAND_TYPE 0x18012009
615#define ERROR_RESAMPLE_RATIO 0x18051801
616#define ERROR_RESAMPLE_FRAC_DELAY 0x18050604
617/* S 0x19xxxxxx*/
618#define ERROR_SIZE 0x19092605
619#define ERROR_SYM_TYPE 0x19251320
620/* T 0x20xxxxxx*/
621/* U 0x21xxxxxx*/
622#define ERROR_UNWRAP 0x21142318
623/* V 0x22xxxxxx*/
624/* W 0x23xxxxxx*/
625#define ERROR_WIN_PARAM 0x23091601
626#define ERROR_WIN_SYM 0x23091925
627#define ERROR_WIN_TYPE 0x23092025
628/* X 0x24xxxxxx*/
629#define ERROR_XCORR_FLAG 0x24031518
630/* Y 0x25xxxxxx*/
631/* Z 0x26xxxxxx*/
632
633#define DAT_MASK 0x00000001
634#define DAT_DOUBLE 0x00000000
635#define DAT_COMPLEX 0x00000001
636
637#define DSPL_MATRIX_BLOCK 32
638
639
640#define DSPL_SYMMETRIC 0x00000000
641#define DSPL_PERIODIC 0x00000001
642
643#define DSPL_FLAG_DIGITAL 0x00000000
644#define DSPL_FLAG_ANALOG 0x00000001
645#define DSPL_FLAG_LOGMAG 0x00000002
646#define DSPL_FLAG_UNWRAP 0x00000004
647#define DSPL_FLAG_FFT_SHIFT 0x00000008
648#define DSPL_FLAG_PSD_TWOSIDED DSPL_FLAG_FFT_SHIFT
649
650
651
652
653#define DSPL_WIN_SYM_MASK 0x00000001
654#define DSPL_WIN_MASK 0x00FFFFFE
655
656#define DSPL_WIN_SYMMETRIC DSPL_SYMMETRIC
657#define DSPL_WIN_PERIODIC DSPL_PERIODIC
658
659
660#define DSPL_WIN_BARTLETT 0x00000004
661#define DSPL_WIN_BARTLETT_HANN 0x00000008
662#define DSPL_WIN_BLACKMAN 0x00000010
663#define DSPL_WIN_BLACKMAN_HARRIS 0x00000040
664#define DSPL_WIN_BLACKMAN_NUTTALL 0x00000080
665#define DSPL_WIN_FLAT_TOP 0x00000100
666#define DSPL_WIN_GAUSSIAN 0x00000400
667#define DSPL_WIN_HAMMING 0x00000800
668#define DSPL_WIN_HANN 0x00001000
669#define DSPL_WIN_LANCZOS 0x00004000
670#define DSPL_WIN_NUTTALL 0x00008000
671#define DSPL_WIN_RECT 0x00010000
672#define DSPL_WIN_COS 0x00040000
673#define DSPL_WIN_CHEBY 0x00080000
674#define DSPL_WIN_KAISER 0x00100000
675
676
677#define DSPL_FILTER_TYPE_MASK 0x000000FF
678#define DSPL_FILTER_LPF 0x00000001
679#define DSPL_FILTER_HPF 0x00000002
680#define DSPL_FILTER_BPASS 0x00000004
681#define DSPL_FILTER_BSTOP 0x00000008
682
683#define DSPL_FILTER_APPROX_MASK 0x0000FF00
684#define DSPL_FILTER_BUTTER 0x00000100
685#define DSPL_FILTER_CHEBY1 0x00000200
686#define DSPL_FILTER_CHEBY2 0x00000400
687#define DSPL_FILTER_ELLIP 0x00000800
688
689
690#define DSPL_XCORR_NOSCALE 0x00000000
691#define DSPL_XCORR_BIASED 0x00000001
692#define DSPL_XCORR_UNBIASED 0x00000002
693
694
695
696#define ELLIP_ITER 16
697#define ELLIP_MAX_ORD 24
698
699#define DSPL_VERIF_FAILED 1
700#define DSPL_VERIF_SUCCESS 0
701
702#define PLOT_HOLD 0x00000001
703
704#define VERIF_STR_BUF 128
705#define VERIF_STR_LEN 48
706#define VERIF_CHAR_POINT 46
707#define VERIF_LEVEL_COMPLEX 1E-11
708#define VERIF_LEVEL_DOUBLE 1E-12
709
710
711
712#ifdef __cplusplus
713 extern "C" {
714#endif
715
716
717
718#ifdef BUILD_LIB
719 /* Declare DSPL_API for Windows OS */
720 #ifdef WIN_OS
721 #define DSPL_API __declspec(dllexport)
722 #endif /* WIN_OS */
723 /* Declare DSPL_API for LINUX OS */
724 #ifdef LINUX_OS
725 #define DSPL_API
726 #endif /* LINUX_OS */
727#endif /* BUILD_DLL */
728
729#define COMMA ,
730
731
732#ifdef BUILD_LIB
733 #define DECLARE_FUNC(type, fn, param)\
734 type DSPL_API fn(param);
735#endif
736
737#ifndef BUILD_LIB
738 #define DECLARE_FUNC( type, fn, param)\
739 typedef type (*p_##fn)(param);\
740 extern p_##fn fn;
741
742#endif
743
744
745
746/*----------------------------------------------------------------------------*/
747DECLARE_FUNC(int, acos_cmplx, complex_t*
748 COMMA int
749 COMMA complex_t*);
750/*----------------------------------------------------------------------------*/
751DECLARE_FUNC(int, addlog, char* str
752 COMMA char* fn);
753/*----------------------------------------------------------------------------*/
754DECLARE_FUNC(int, array_scale_lin, double* x
755 COMMA int n
756 COMMA double xmin
757 COMMA double xmax
758 COMMA double dx
759 COMMA double h
760 COMMA double* y);
761/*----------------------------------------------------------------------------*/
762DECLARE_FUNC(int, asin_cmplx, complex_t*
763 COMMA int
764 COMMA complex_t*);
765/*----------------------------------------------------------------------------*/
766DECLARE_FUNC(int, bessel_i0, double* x
767 COMMA int n
768 COMMA double* y);
769/*----------------------------------------------------------------------------*/
770DECLARE_FUNC(int, bilinear, double* bs
771 COMMA double* as
772 COMMA int ord
773 COMMA double* bz
774 COMMA double* az);
775/*----------------------------------------------------------------------------*/
776DECLARE_FUNC(int, butter_ap, double
777 COMMA int
778 COMMA double*
779 COMMA double*);
780/*----------------------------------------------------------------------------*/
781DECLARE_FUNC(int, butter_ap_zp, int
782 COMMA double
783 COMMA complex_t*
784 COMMA int*
785 COMMA complex_t*
786 COMMA int*);
787/*----------------------------------------------------------------------------*/
788DECLARE_FUNC(int, cheby_poly1, double*
789 COMMA int
790 COMMA int
791 COMMA double*);
792/*----------------------------------------------------------------------------*/
793DECLARE_FUNC(int, cheby_poly2, double*
794 COMMA int
795 COMMA int
796 COMMA double*);
797/*----------------------------------------------------------------------------*/
798DECLARE_FUNC(int, cheby1_ap, double
799 COMMA int
800 COMMA double*
801 COMMA double*);
802/*----------------------------------------------------------------------------*/
803DECLARE_FUNC(int, cheby1_ap_zp, int
804 COMMA double
805 COMMA complex_t*
806 COMMA int*
807 COMMA complex_t*
808 COMMA int*);
809/*----------------------------------------------------------------------------*/
810DECLARE_FUNC(int, cheby2_ap, double rs
811 COMMA int ord
812 COMMA double* b
813 COMMA double* a);
814/*----------------------------------------------------------------------------*/
815DECLARE_FUNC(int, cheby2_ap_wp1, double rp
816 COMMA double rs
817 COMMA int ord
818 COMMA double* b
819 COMMA double* a);
820/*----------------------------------------------------------------------------*/
821DECLARE_FUNC(int, cheby2_ap_zp, int
822 COMMA double
823 COMMA complex_t*
824 COMMA int*
825 COMMA complex_t*
826 COMMA int*);
827/*----------------------------------------------------------------------------*/
828DECLARE_FUNC(int, cmplx2re, complex_t*
829 COMMA int
830 COMMA double*
831 COMMA double*);
832/*----------------------------------------------------------------------------*/
833DECLARE_FUNC(int, concat, void*
834 COMMA size_t
835 COMMA void*
836 COMMA size_t
837 COMMA void*);
838/*----------------------------------------------------------------------------*/
839DECLARE_FUNC(int, conv, double*
840 COMMA int
841 COMMA double*
842 COMMA int
843 COMMA double*);
844/*----------------------------------------------------------------------------*/
845DECLARE_FUNC(int, conv_cmplx, complex_t*
846 COMMA int
847 COMMA complex_t*
848 COMMA int
849 COMMA complex_t*);
850/*----------------------------------------------------------------------------*/
851DECLARE_FUNC(int, conv_fft, double* a
852 COMMA int na
853 COMMA double* b
854 COMMA int nb
855 COMMA fft_t* pfft
856 COMMA int nfft
857 COMMA double* c);
858/*----------------------------------------------------------------------------*/
859DECLARE_FUNC(int, conv_fft_cmplx, complex_t* a
860 COMMA int na
861 COMMA complex_t* b
862 COMMA int nb
863 COMMA fft_t* pfft
864 COMMA int nfft
865 COMMA complex_t* c);
866/*----------------------------------------------------------------------------*/
867DECLARE_FUNC(int, cos_cmplx, complex_t*
868 COMMA int
869 COMMA complex_t*);
870/*----------------------------------------------------------------------------*/
871DECLARE_FUNC(int, decimate, double* x
872 COMMA int n
873 COMMA int d
874 COMMA double* y
875 COMMA int* cnt);
876/*----------------------------------------------------------------------------*/
877DECLARE_FUNC(int, decimate_cmplx, complex_t* x
878 COMMA int n
879 COMMA int d
880 COMMA complex_t* y
881 COMMA int* cnt);
882/*----------------------------------------------------------------------------*/
883DECLARE_FUNC(int, dft, double*
884 COMMA int
885 COMMA complex_t*);
886/*----------------------------------------------------------------------------*/
887DECLARE_FUNC(int, dft_cmplx, complex_t*
888 COMMA int
889 COMMA complex_t*);
890/*----------------------------------------------------------------------------*/
891DECLARE_FUNC(double, dmod, double
892 COMMA double);
893/*----------------------------------------------------------------------------*/
894DECLARE_FUNC(void, dspl_info, void);
895/*----------------------------------------------------------------------------*/
896DECLARE_FUNC(int, ellip_acd, double* w
897 COMMA int n
898 COMMA double k
899 COMMA double* u);
900/*----------------------------------------------------------------------------*/
901DECLARE_FUNC(int, ellip_acd_cmplx, complex_t* w
902 COMMA int n
903 COMMA double k
904 COMMA complex_t* u);
905/*----------------------------------------------------------------------------*/
906DECLARE_FUNC(int, ellip_ap, double rp
907 COMMA double rs
908 COMMA int ord
909 COMMA double* b
910 COMMA double* a);
911/*----------------------------------------------------------------------------*/
912DECLARE_FUNC(int, ellip_ap_zp, int ord
913 COMMA double rp
914 COMMA double rs
915 COMMA complex_t* z
916 COMMA int* nz
917 COMMA complex_t* p
918 COMMA int* np);
919/*----------------------------------------------------------------------------*/
920DECLARE_FUNC(int, ellip_asn, double* w
921 COMMA int n
922 COMMA double k
923 COMMA double* u);
924/*----------------------------------------------------------------------------*/
925DECLARE_FUNC(int, ellip_asn_cmplx, complex_t* w
926 COMMA int n
927 COMMA double k
928 COMMA complex_t* u);
929/*----------------------------------------------------------------------------*/
930DECLARE_FUNC(int, ellip_cd, double* u
931 COMMA int n
932 COMMA double k
933 COMMA double* y);
934/*----------------------------------------------------------------------------*/
935DECLARE_FUNC(int, ellip_cd_cmplx, complex_t* u
936 COMMA int n
937 COMMA double k
938 COMMA complex_t* y);
939/*----------------------------------------------------------------------------*/
940DECLARE_FUNC(int, ellip_landen, double k
941 COMMA int n
942 COMMA double* y);
943/*----------------------------------------------------------------------------*/
944DECLARE_FUNC(int, ellip_modulareq, double rp
945 COMMA double rs
946 COMMA int ord
947 COMMA double* k);
948/*----------------------------------------------------------------------------*/
949DECLARE_FUNC(int, ellip_rat, double* w
950 COMMA int n
951 COMMA int ord
952 COMMA double k
953 COMMA double* u);
954/*----------------------------------------------------------------------------*/
955DECLARE_FUNC(int, ellip_sn, double* u
956 COMMA int n
957 COMMA double k
958 COMMA double* y);
959/*----------------------------------------------------------------------------*/
960DECLARE_FUNC(int, ellip_sn_cmplx, complex_t* u
961 COMMA int n
962 COMMA double k
963 COMMA complex_t* y);
964/*----------------------------------------------------------------------------*/
965DECLARE_FUNC(int, farrow_lagrange, double*
966 COMMA int
967 COMMA double
968 COMMA double
969 COMMA double
970 COMMA double**
971 COMMA int*);
972/*----------------------------------------------------------------------------*/
973DECLARE_FUNC(int, farrow_spline, double*
974 COMMA int
975 COMMA double
976 COMMA double
977 COMMA double
978 COMMA double**
979 COMMA int*);
980/*----------------------------------------------------------------------------*/
981DECLARE_FUNC(int, fft, double*
982 COMMA int
983 COMMA fft_t*
984 COMMA complex_t* );
985/*----------------------------------------------------------------------------*/
986DECLARE_FUNC(int, fft_abs, double* x
987 COMMA int n
988 COMMA fft_t* pfft
989 COMMA double fs
990 COMMA int flag
991 COMMA double* mag
992 COMMA double* freq);
993/*----------------------------------------------------------------------------*/
994DECLARE_FUNC(int, fft_abs_cmplx, complex_t* x
995 COMMA int n
996 COMMA fft_t* pfft
997 COMMA double fs
998 COMMA int flag
999 COMMA double* mag
1000 COMMA double* freq);
1001/*----------------------------------------------------------------------------*/
1002DECLARE_FUNC(int, fft_cmplx, complex_t*
1003 COMMA int
1004 COMMA fft_t*
1005 COMMA complex_t* );
1006/*----------------------------------------------------------------------------*/
1007DECLARE_FUNC(int, fft_create, fft_t*
1008 COMMA int);
1009/*----------------------------------------------------------------------------*/
1010DECLARE_FUNC(void, fft_free, fft_t*);
1011/*----------------------------------------------------------------------------*/
1012DECLARE_FUNC(int, fft_mag, double* x
1013 COMMA int n
1014 COMMA fft_t* pfft
1015 COMMA double fs
1016 COMMA int flag
1017 COMMA double* mag
1018 COMMA double* freq);
1019/*----------------------------------------------------------------------------*/
1020DECLARE_FUNC(int, fft_mag_cmplx, complex_t* x
1021 COMMA int n
1022 COMMA fft_t* pfft
1023 COMMA double fs
1024 COMMA int flag
1025 COMMA double* mag
1026 COMMA double* freq);
1027/*----------------------------------------------------------------------------*/
1028DECLARE_FUNC(int, fft_shift, double*
1029 COMMA int n
1030 COMMA double*);
1031/*----------------------------------------------------------------------------*/
1032DECLARE_FUNC(int, fft_shift_cmplx, complex_t*
1033 COMMA int
1034 COMMA complex_t*);
1035/*----------------------------------------------------------------------------*/
1036DECLARE_FUNC(int, filter_freq_resp, double* b
1037 COMMA double* a
1038 COMMA int ord
1039 COMMA double* w
1040 COMMA int n
1041 COMMA int flag
1042 COMMA double* mag
1043 COMMA double* phi
1044 COMMA double* tau);
1045/*----------------------------------------------------------------------------*/
1046DECLARE_FUNC(int, filter_iir, double*
1047 COMMA double*
1048 COMMA int
1049 COMMA double*
1050 COMMA int
1051 COMMA double*);
1052/*----------------------------------------------------------------------------*/
1053DECLARE_FUNC(double, filter_ws1, int ord
1054 COMMA double rp
1055 COMMA double rs
1056 COMMA int type);
1057/*----------------------------------------------------------------------------*/
1058DECLARE_FUNC(int, filter_zp2ab, complex_t*
1059 COMMA int
1060 COMMA complex_t*
1061 COMMA int
1062 COMMA int
1063 COMMA double*
1064 COMMA double*);
1065/*----------------------------------------------------------------------------*/
1066DECLARE_FUNC(int, find_max_abs, double* a
1067 COMMA int n
1068 COMMA double* m
1069 COMMA int* ind);
1070/*----------------------------------------------------------------------------*/
1071DECLARE_FUNC(int, find_nearest, double* x
1072 COMMA int n
1073 COMMA double val
1074 COMMA int* idx
1075 COMMA double* dist);
1076/*----------------------------------------------------------------------------*/
1077DECLARE_FUNC(int, fir_linphase, int ord
1078 COMMA double w0
1079 COMMA double w1
1080 COMMA int filter_type
1081 COMMA int wintype
1082 COMMA double winparam
1083 COMMA double* h);
1084/*----------------------------------------------------------------------------*/
1085DECLARE_FUNC(int, flipip, double*
1086 COMMA int);
1087/*----------------------------------------------------------------------------*/
1088DECLARE_FUNC(int, flipip_cmplx, complex_t*
1089 COMMA int);
1090/*----------------------------------------------------------------------------*/
1091DECLARE_FUNC(int, fourier_integral_cmplx, double* t
1092 COMMA complex_t* s
1093 COMMA int nt
1094 COMMA int nw
1095 COMMA double* w
1096 COMMA complex_t* y);
1097/*----------------------------------------------------------------------------*/
1098DECLARE_FUNC(int, fourier_series_dec, double*
1099 COMMA double*
1100 COMMA int
1101 COMMA double
1102 COMMA int
1103 COMMA double*
1104 COMMA complex_t*);
1105/*----------------------------------------------------------------------------*/
1106DECLARE_FUNC(int, fourier_series_dec_cmplx, double* t
1107 COMMA complex_t* s
1108 COMMA int nt
1109 COMMA double period
1110 COMMA int nw
1111 COMMA double* w
1112 COMMA complex_t* y);
1113/*----------------------------------------------------------------------------*/
1114DECLARE_FUNC(int, fourier_series_rec, double*
1115 COMMA complex_t*
1116 COMMA int
1117 COMMA double*
1118 COMMA int
1119 COMMA complex_t*);
1120/*----------------------------------------------------------------------------*/
1121DECLARE_FUNC(int, freqs, double*
1122 COMMA double*
1123 COMMA int
1124 COMMA double*
1125 COMMA int
1126 COMMA complex_t*);
1127/*----------------------------------------------------------------------------*/
1128DECLARE_FUNC(int, freqs_cmplx, double* b
1129 COMMA double* a
1130 COMMA int ord
1131 COMMA complex_t* s
1132 COMMA int n
1133 COMMA complex_t* h);
1134/*----------------------------------------------------------------------------*/
1135DECLARE_FUNC(int, freqs2time, double*
1136 COMMA double*
1137 COMMA int
1138 COMMA double
1139 COMMA int
1140 COMMA fft_t*
1141 COMMA double*
1142 COMMA double*);
1143/*----------------------------------------------------------------------------*/
1144DECLARE_FUNC(int, freqz, double*
1145 COMMA double*
1146 COMMA int
1147 COMMA double*
1148 COMMA int
1149 COMMA complex_t*);
1150/*----------------------------------------------------------------------------*/
1151DECLARE_FUNC(void, gnuplot_close, void* h);
1152/*----------------------------------------------------------------------------*/
1153DECLARE_FUNC(void, gnuplot_cmd, void* h
1154 COMMA char* cmd);
1155/*----------------------------------------------------------------------------*/
1156DECLARE_FUNC(int, gnuplot_create, int argc
1157 COMMA char* argv[]
1158 COMMA int w
1159 COMMA int h
1160 COMMA char* fn_png
1161 COMMA void** hplot);
1162/*----------------------------------------------------------------------------*/
1163DECLARE_FUNC(int, gnuplot_open, void** hplot);
1164/*----------------------------------------------------------------------------*/
1165DECLARE_FUNC(int, goertzel, double*
1166 COMMA int
1167 COMMA int*
1168 COMMA int
1169 COMMA complex_t*);
1170/*----------------------------------------------------------------------------*/
1171DECLARE_FUNC(int, goertzel_cmplx, complex_t*
1172 COMMA int
1173 COMMA int*
1174 COMMA int
1175 COMMA complex_t*);
1176/*----------------------------------------------------------------------------*/
1177DECLARE_FUNC(int, group_delay, double* b
1178 COMMA double* a
1179 COMMA int ord
1180 COMMA int flag
1181 COMMA double* w
1182 COMMA int n
1183 COMMA double* tau);
1184/*----------------------------------------------------------------------------*/
1185DECLARE_FUNC(int, histogram, double* x
1186 COMMA int n
1187 COMMA int nh
1188 COMMA double* pedges
1189 COMMA double* ph);
1190/*----------------------------------------------------------------------------*/
1191DECLARE_FUNC(int, histogram_norm, double* y
1192 COMMA int n
1193 COMMA int nh
1194 COMMA double* x
1195 COMMA double* w);
1196/*----------------------------------------------------------------------------*/
1197DECLARE_FUNC(int, idft_cmplx, complex_t*
1198 COMMA int
1199 COMMA complex_t*);
1200/*----------------------------------------------------------------------------*/
1201DECLARE_FUNC(int, ifft_cmplx, complex_t*
1202 COMMA int
1203 COMMA fft_t*
1204 COMMA complex_t* );
1205/*----------------------------------------------------------------------------*/
1206DECLARE_FUNC(int, iir, double rp
1207 COMMA double rs
1208 COMMA int ord
1209 COMMA double w0
1210 COMMA double w1
1211 COMMA int type
1212 COMMA double* b
1213 COMMA double* a);
1214/*----------------------------------------------------------------------------*/
1215DECLARE_FUNC(int, linspace, double
1216 COMMA double
1217 COMMA int
1218 COMMA int
1219 COMMA double*);
1220/*----------------------------------------------------------------------------*/
1221DECLARE_FUNC(int, log_cmplx, complex_t*
1222 COMMA int
1223 COMMA complex_t*);
1224/*----------------------------------------------------------------------------*/
1225DECLARE_FUNC(int, logspace, double
1226 COMMA double
1227 COMMA int
1228 COMMA int
1229 COMMA double*);
1230/*----------------------------------------------------------------------------*/
1231DECLARE_FUNC(int, low2bp, double* b
1232 COMMA double* a
1233 COMMA int ord
1234 COMMA double w0
1235 COMMA double wpl
1236 COMMA double wph
1237 COMMA double* beta
1238 COMMA double* alpha);
1239/*----------------------------------------------------------------------------*/
1240DECLARE_FUNC(int, low2bs, double* b
1241 COMMA double* a
1242 COMMA int ord
1243 COMMA double w0
1244 COMMA double wsl
1245 COMMA double wsh
1246 COMMA double* beta
1247 COMMA double* alpha);
1248/*----------------------------------------------------------------------------*/
1249DECLARE_FUNC(int, low2high, double* b
1250 COMMA double* a
1251 COMMA int ord
1252 COMMA double w0
1253 COMMA double w1
1254 COMMA double* beta
1255 COMMA double* alpha);
1256/*----------------------------------------------------------------------------*/
1257DECLARE_FUNC(int, low2low, double* b
1258 COMMA double* a
1259 COMMA int ord
1260 COMMA double w0
1261 COMMA double w1
1262 COMMA double* beta
1263 COMMA double* alpha);
1264/*----------------------------------------------------------------------------*/
1265DECLARE_FUNC(int, matrix_eig_cmplx, complex_t* a
1266 COMMA int n
1267 COMMA complex_t* v
1268 COMMA int* info);
1269/*----------------------------------------------------------------------------*/
1270DECLARE_FUNC(int, matrix_eye, double* a
1271 COMMA int n
1272 COMMA int m);
1273/*----------------------------------------------------------------------------*/
1274DECLARE_FUNC(int, matrix_eye_cmplx, complex_t* a
1275 COMMA int n
1276 COMMA int m);
1277/*----------------------------------------------------------------------------*/
1278DECLARE_FUNC(int, matrix_mul, double* a
1279 COMMA int na
1280 COMMA int ma
1281 COMMA double* b
1282 COMMA int nb
1283 COMMA int mb
1284 COMMA double* c);
1285/*----------------------------------------------------------------------------*/
1286DECLARE_FUNC(int, matrix_pinv, double* a
1287 COMMA int n
1288 COMMA int m
1289 COMMA double* tol
1290 COMMA double* inv
1291 COMMA int* info);
1292/*----------------------------------------------------------------------------*/
1293DECLARE_FUNC(int, matrix_print, double* a
1294 COMMA int n
1295 COMMA int m
1296 COMMA const char* name
1297 COMMA const char* format);
1298/*----------------------------------------------------------------------------*/
1299DECLARE_FUNC(int, matrix_print_cmplx, complex_t* a
1300 COMMA int n
1301 COMMA int m
1302 COMMA const char* name
1303 COMMA const char* format);
1304/*----------------------------------------------------------------------------*/
1305DECLARE_FUNC(int, matrix_svd, double* a
1306 COMMA int n
1307 COMMA int m
1308 COMMA double* u
1309 COMMA double* s
1310 COMMA double* vt
1311 COMMA int* info);
1312/*----------------------------------------------------------------------------*/
1313DECLARE_FUNC(int, matrix_transpose, double* a
1314 COMMA int n
1315 COMMA int m
1316 COMMA double* b);
1317/*----------------------------------------------------------------------------*/
1318DECLARE_FUNC(int, matrix_transpose_cmplx, complex_t* a
1319 COMMA int n
1320 COMMA int m
1321 COMMA complex_t* b);
1322/*----------------------------------------------------------------------------*/
1323DECLARE_FUNC(int, matrix_transpose_hermite, complex_t* a
1324 COMMA int n
1325 COMMA int m
1326 COMMA complex_t* b);
1327/*----------------------------------------------------------------------------*/
1328DECLARE_FUNC(int, mean, double* x
1329 COMMA int n
1330 COMMA double* m);
1331/*----------------------------------------------------------------------------*/
1332DECLARE_FUNC(int, mean_cmplx, complex_t* x
1333 COMMA int n
1334 COMMA complex_t* m);
1335/*----------------------------------------------------------------------------*/
1336DECLARE_FUNC(int, minmax, double* x
1337 COMMA int n
1338 COMMA double* xmin
1339 COMMA double* xmax);
1340/*----------------------------------------------------------------------------*/
1341DECLARE_FUNC(int, ones, double* x
1342 COMMA int n);
1343/*----------------------------------------------------------------------------*/
1344DECLARE_FUNC(int, phase_delay, double* b
1345 COMMA double* a
1346 COMMA int ord
1347 COMMA int flag
1348 COMMA double* w
1349 COMMA int n
1350 COMMA double* tau);
1351/*----------------------------------------------------------------------------*/
1352DECLARE_FUNC(int, poly_z2a_cmplx, complex_t*
1353 COMMA int
1354 COMMA int
1355 COMMA complex_t*);
1356/*----------------------------------------------------------------------------*/
1357DECLARE_FUNC(int, polyroots, double* a
1358 COMMA int ord
1359 COMMA complex_t* r
1360 COMMA int* info);
1361/*----------------------------------------------------------------------------*/
1362DECLARE_FUNC(int, polyval, double*
1363 COMMA int
1364 COMMA double*
1365 COMMA int
1366 COMMA double*);
1367/*----------------------------------------------------------------------------*/
1368DECLARE_FUNC(int, polyval_cmplx, complex_t*
1369 COMMA int
1370 COMMA complex_t*
1371 COMMA int
1372 COMMA complex_t*);
1373/*----------------------------------------------------------------------------*/
1374DECLARE_FUNC(int, psd_bartlett, double* x
1375 COMMA int n
1376 COMMA int nfft
1377 COMMA fft_t* pfft
1378 COMMA double fs
1379 COMMA int flag
1380 COMMA double* ppsd
1381 COMMA double* pfrq);
1382/*----------------------------------------------------------------------------*/
1383DECLARE_FUNC(int, psd_bartlett_cmplx, complex_t* x
1384 COMMA int n
1385 COMMA int nfft
1386 COMMA fft_t* pfft
1387 COMMA double fs
1388 COMMA int flag
1389 COMMA double* ppsd
1390 COMMA double* pfrq);
1391/*----------------------------------------------------------------------------*/
1392DECLARE_FUNC(int, psd_periodogram, double* x
1393 COMMA int n
1394 COMMA int win_type
1395 COMMA double win_param
1396 COMMA fft_t* pfft
1397 COMMA double fs
1398 COMMA int flag
1399 COMMA double* ppsd
1400 COMMA double* pfrq);
1401/*----------------------------------------------------------------------------*/
1402DECLARE_FUNC(int, psd_periodogram_cmplx, complex_t* x
1403 COMMA int n
1404 COMMA int win_type
1405 COMMA double win_param
1406 COMMA fft_t* pfft
1407 COMMA double fs
1408 COMMA int flag
1409 COMMA double* ppsd
1410 COMMA double* pfrq);
1411/*----------------------------------------------------------------------------*/
1412DECLARE_FUNC(int, psd_welch, double* x
1413 COMMA int n
1414 COMMA int win_type
1415 COMMA double win_param
1416 COMMA int npsd
1417 COMMA int noverlap
1418 COMMA fft_t* pfft
1419 COMMA double fs
1420 COMMA int flag
1421 COMMA double* ppsd
1422 COMMA double* pfrq);
1423/*----------------------------------------------------------------------------*/
1424DECLARE_FUNC(int, psd_welch_cmplx, complex_t* x
1425 COMMA int n
1426 COMMA int win_type
1427 COMMA double win_param
1428 COMMA int npsd
1429 COMMA int noverlap
1430 COMMA fft_t* pfft
1431 COMMA double fs
1432 COMMA int flag
1433 COMMA double* ppsd
1434 COMMA double* pfrq);
1435/*----------------------------------------------------------------------------*/
1436DECLARE_FUNC(int, randb, double* x
1437 COMMA int n
1438 COMMA random_t* prnd);
1439/*----------------------------------------------------------------------------*/
1440DECLARE_FUNC(int, randb2, double* x
1441 COMMA int n
1442 COMMA random_t* prnd);
1443/*----------------------------------------------------------------------------*/
1444DECLARE_FUNC(int, randi, int* x
1445 COMMA int n
1446 COMMA int start
1447 COMMA int stop
1448 COMMA random_t* prnd);
1449/*----------------------------------------------------------------------------*/
1450DECLARE_FUNC(int, randn, double* x
1451 COMMA int n
1452 COMMA double mu
1453 COMMA double sigma
1454 COMMA random_t* prnd);
1455/*----------------------------------------------------------------------------*/
1456DECLARE_FUNC(int, randn_cmplx, complex_t* x
1457 COMMA int n
1458 COMMA complex_t* mu
1459 COMMA double sigma
1460 COMMA random_t* prnd);
1461/*----------------------------------------------------------------------------*/
1462DECLARE_FUNC(int, random_init, random_t* prnd
1463 COMMA int type
1464 COMMA void* seed);
1465/*----------------------------------------------------------------------------*/
1466DECLARE_FUNC(int, randu, double*
1467 COMMA int
1468 COMMA random_t* prnd);
1469/*----------------------------------------------------------------------------*/
1470DECLARE_FUNC(int, ratcompos, double* b
1471 COMMA double* a
1472 COMMA int n
1473 COMMA double* c
1474 COMMA double* d
1475 COMMA int p
1476 COMMA double* beta
1477 COMMA double* alpha);
1478/*----------------------------------------------------------------------------*/
1479DECLARE_FUNC(int, re2cmplx, double*
1480 COMMA int
1481 COMMA complex_t*);
1482/*----------------------------------------------------------------------------*/
1483DECLARE_FUNC(int, readbin, char* fn
1484 COMMA void** x
1485 COMMA int* pn
1486 COMMA int* pm
1487 COMMA int* dtype);
1488/*----------------------------------------------------------------------------*/
1489DECLARE_FUNC(int, signal_pimp, double*
1490 COMMA size_t
1491 COMMA double
1492 COMMA double
1493 COMMA double
1494 COMMA double
1495 COMMA double*);
1496/*----------------------------------------------------------------------------*/
1497DECLARE_FUNC(int, signal_saw, double* t
1498 COMMA size_t n
1499 COMMA double amp
1500 COMMA double dt
1501 COMMA double period
1502 COMMA double* y);
1503/*----------------------------------------------------------------------------*/
1504DECLARE_FUNC(int, sin_cmplx, complex_t*
1505 COMMA int
1506 COMMA complex_t*);
1507/*----------------------------------------------------------------------------*/
1508DECLARE_FUNC(int, sinc, double* x
1509 COMMA int n
1510 COMMA double a
1511 COMMA double* y);
1512/*----------------------------------------------------------------------------*/
1513DECLARE_FUNC(int, sine_int, double* x
1514 COMMA int n
1515 COMMA double* si);
1516/*----------------------------------------------------------------------------*/
1517DECLARE_FUNC(int, sqrt_cmplx, complex_t*
1518 COMMA int
1519 COMMA complex_t*);
1520/*----------------------------------------------------------------------------*/
1521DECLARE_FUNC(int, stat_std, double* x
1522 COMMA int n
1523 COMMA double* s);
1524/*----------------------------------------------------------------------------*/
1525DECLARE_FUNC(int, stat_std_cmplx, complex_t* x
1526 COMMA int n
1527 COMMA double* s);
1528/*----------------------------------------------------------------------------*/
1529DECLARE_FUNC(int, sum, double* x
1530 COMMA int n
1531 COMMA double* s);
1532/*----------------------------------------------------------------------------*/
1533DECLARE_FUNC(int, sum_sqr, double* x
1534 COMMA int n
1535 COMMA double* s);
1536/*----------------------------------------------------------------------------*/
1537DECLARE_FUNC(int, trapint, double*
1538 COMMA double*
1539 COMMA int
1540 COMMA double*);
1541/*----------------------------------------------------------------------------*/
1542DECLARE_FUNC(int, trapint_cmplx, double*
1543 COMMA complex_t*
1544 COMMA int
1545 COMMA complex_t*);
1546/*----------------------------------------------------------------------------*/
1547DECLARE_FUNC(int, unwrap, double*
1548 COMMA int
1549 COMMA double
1550 COMMA double);
1551/*----------------------------------------------------------------------------*/
1552DECLARE_FUNC(int, vector_dot, double* x
1553 COMMA double* y
1554 COMMA int n
1555 COMMA double* p);
1556/*----------------------------------------------------------------------------*/
1557DECLARE_FUNC(int, verif, double* x
1558 COMMA double* y
1559 COMMA size_t n
1560 COMMA double eps
1561 COMMA double* err);
1562/*----------------------------------------------------------------------------*/
1563DECLARE_FUNC(int, verif_data_gen, int len
1564 COMMA int type
1565 COMMA char* fn);
1566/*----------------------------------------------------------------------------*/
1567DECLARE_FUNC(int, verif_cmplx, complex_t* x
1568 COMMA complex_t* y
1569 COMMA size_t n
1570 COMMA double eps
1571 COMMA double* err);
1572/*----------------------------------------------------------------------------*/
1573DECLARE_FUNC(void, verif_str, double* yout
1574 COMMA int nout
1575 COMMA char* str_msg
1576 COMMA char* outfn
1577 COMMA char* logfn);
1578/*----------------------------------------------------------------------------*/
1579DECLARE_FUNC(void, verif_str_cmplx, complex_t* yout
1580 COMMA int nout
1581 COMMA char* str_msg
1582 COMMA char* outfn
1583 COMMA char* logfn);
1584/*----------------------------------------------------------------------------*/
1585DECLARE_FUNC(int, window, double* w
1586 COMMA int n
1587 COMMA int win_type
1588 COMMA double param);
1589/*----------------------------------------------------------------------------*/
1590DECLARE_FUNC(int, writebin, void*
1591 COMMA int
1592 COMMA int
1593 COMMA int
1594 COMMA char*);
1595/*----------------------------------------------------------------------------*/
1596DECLARE_FUNC(int, writetxt, double*
1597 COMMA double*
1598 COMMA int
1599 COMMA char* );
1600/*----------------------------------------------------------------------------*/
1601DECLARE_FUNC(int, writetxt_3d, double* x
1602 COMMA int nx
1603 COMMA double* y
1604 COMMA int ny
1605 COMMA double* z
1606 COMMA char* fn);
1607/*----------------------------------------------------------------------------*/
1608DECLARE_FUNC(int, writetxt_3dline, double* x
1609 COMMA double* y
1610 COMMA double* z
1611 COMMA int n
1612 COMMA char* fn);
1613/*----------------------------------------------------------------------------*/
1614DECLARE_FUNC(int, writetxt_cmplx, complex_t* x
1615 COMMA int n
1616 COMMA char* fn);
1617/*----------------------------------------------------------------------------*/
1618DECLARE_FUNC(int, writetxt_cmplx_im, double*
1619 COMMA complex_t*
1620 COMMA int
1621 COMMA char*);
1622/*----------------------------------------------------------------------------*/
1623DECLARE_FUNC(int, writetxt_cmplx_re, double*
1624 COMMA complex_t*
1625 COMMA int
1626 COMMA char*);
1627/*----------------------------------------------------------------------------*/
1628DECLARE_FUNC(int, writetxt_int, int*
1629 COMMA int*
1630 COMMA int
1631 COMMA char*);
1632/*----------------------------------------------------------------------------*/
1633DECLARE_FUNC(int, xcorr, double* x
1634 COMMA int nx
1635 COMMA double* y
1636 COMMA int ny
1637 COMMA int flag
1638 COMMA int nr
1639 COMMA double* r
1640 COMMA double* t);
1641/*----------------------------------------------------------------------------*/
1642DECLARE_FUNC(int, xcorr_cmplx, complex_t* x
1643 COMMA int nx
1644 COMMA complex_t* y
1645 COMMA int ny
1646 COMMA int flag
1647 COMMA int nr
1648 COMMA complex_t* r
1649 COMMA double* t);
1650/*----------------------------------------------------------------------------*/
1651
1652
1653#ifdef __cplusplus
1654 }
1655#endif
1656
1657
1658#ifdef DOXYGEN_ENGLISH
1711#endif
1712#ifdef DOXYGEN_RUSSIAN
1765#endif
1767
1768
1769
1770
1771
1772#ifdef DOXYGEN_ENGLISH
1789#endif
1790#ifdef DOXYGEN_RUSSIAN
1807#endif
1808void dspl_free(void* handle);
1809
1810
1811
1812#endif /* DSPL_H */
1813
int DSPL_API decimate_cmplx(complex_t *x, int n, int d, complex_t *y, int *cnt)
Complex vector decimation.
int DSPL_API linspace(double x0, double x1, int n, int type, double *x)
Function fills a vector with n linearly spaced elements between x0 and x1.
Definition: linspace.c:169
int DSPL_API concat(void *a, size_t na, void *b, size_t nb, void *c)
Concatenate arrays a and b
Definition: concat.c:146
int DSPL_API verif(double *x, double *y, size_t n, double eps, double *err)
Real arrays verification.
Definition: verif.c:130
int DSPL_API ones(double *x, int n)
Function fills all real vector x by ones values.
Definition: ones.c:103
int DSPL_API verif_cmplx(complex_t *x, complex_t *y, size_t n, double eps, double *err)
Complex arrays verification.
Definition: verif_cmplx.c:141
int DSPL_API decimate(double *x, int n, int d, double *y, int *cnt)
Real vector decimation.
Definition: decimate.c:140
int DSPL_API flipip_cmplx(complex_t *x, int n)
Flip complex vector x in place.
Definition: flipip_cmplx.c:132
int DSPL_API array_scale_lin(double *x, int n, double xmin, double xmax, double dx, double h, double *y)
Vector x linear transformation.
int DSPL_API logspace(double x0, double x1, int n, int type, double *x)
Function fills a vector with n logarithmically spaced elements between and .
Definition: logspace.c:178
int DSPL_API sum(double *x, int n, double *s)
Definition: sum.c:43
int DSPL_API flipip(double *x, int n)
Flip real vector x in place.
Definition: flipip.c:133
int DSPL_API fourier_series_dec(double *t, double *s, int nt, double period, int nw, double *w, complex_t *y)
Fourier series coefficient calculation for periodic signal.
int DSPL_API idft_cmplx(complex_t *x, int n, complex_t *y)
Inverse discrete Fourier transform of the complex spectrum.
Definition: idft_cmplx.c:163
void DSPL_API fft_free(fft_t *pfft)
Free fft_t structure.
Definition: fft_free.c:63
int DSPL_API fft_cmplx(complex_t *x, int n, fft_t *pfft, complex_t *y)
Fast Fourier transform for the complex vector.
Definition: fft_cmplx.c:179
int DSPL_API fft_create(fft_t *pfft, int n)
Function creates and fill fft_t structure.
Definition: fft_create.c:161
int DSPL_API ifft_cmplx(complex_t *x, int n, fft_t *pfft, complex_t *y)
Inverse fast Fourier transform.
Definition: ifft_cmplx.c:179
int DSPL_API fft_shift(double *x, int n, double *y)
Perform a shift of the vector x, for use with the fft and ifft functions, in order to move the freque...
Definition: fft_shift.c:95
int DSPL_API fft(double *x, int n, fft_t *pfft, complex_t *y)
Fast Fourier transform for the real vector.
Definition: fft.c:173
int DSPL_API dft(double *x, int n, complex_t *y)
Discrete Fourier transform of a real signal.
Definition: dft.c:163
int DSPL_API goertzel(double *x, int n, int *ind, int k, complex_t *y)
Goertzel algorithm individual DFT samples calculation for the real input vector x.
Definition: goertzel.c:125
int DSPL_API fourier_series_rec(double *w, complex_t *s, int nw, double *t, int nt, complex_t *y)
Time signal reconstruction from Fourier series coefficients.
int DSPL_API dft_cmplx(complex_t *x, int n, complex_t *y)
Discrete Fourier transform of a complex signal.
Definition: dft_cmplx.c:163
int DSPL_API goertzel_cmplx(complex_t *x, int n, int *ind, int k, complex_t *y)
Goertzel algorithm individual DFT samples calculation for the complex input vector x.
int DSPL_API phase_delay(double *b, double *a, int ord, int flag, double *w, int n, double *tau)
Phase delay calculation for digital or analog filter corresponds to , or transfer function.
Definition: phase_delay.c:165
int DSPL_API group_delay(double *pb, double *pa, int ord, int flag, double *w, int n, double *tau)
Group delay calculation for digital or analog filter corresponds to , or transfer function.
Definition: group_delay.c:164
int DSPL_API freqs(double *b, double *a, int ord, double *w, int n, complex_t *h)
Analog filter frequency response calculation.
Definition: freqs.c:143
int DSPL_API freqz(double *b, double *a, int ord, double *w, int n, complex_t *h)
Function calculates the digital filter frequency response corresponds to transfer function .
Definition: freqz.c:157
int DSPL_API filter_freq_resp(double *b, double *a, int ord, double *w, int n, int flag, double *mag, double *phi, double *tau)
Magnitude, phase response and group delay vectors calculation for digital or analog filter correspond...
int DSPL_API filter_iir(double *b, double *a, int ord, double *x, int n, double *y)
Real IIR filtration.
Definition: filter_iir.c:167
int DSPL_API conv_cmplx(complex_t *a, int na, complex_t *b, int nb, complex_t *c)
Complex vectors linear convolution.
Definition: conv_cmplx.c:160
int DSPL_API conv(double *a, int na, double *b, int nb, double *c)
Real vectors linear convolution.
Definition: conv.c:159
int DSPL_API conv_fft_cmplx(complex_t *a, int na, complex_t *b, int nb, fft_t *pfft, int nfft, complex_t *c)
Complex vectors fast linear convolution by using fast Fourier transform algorithms.
int DSPL_API conv_fft(double *a, int na, double *b, int nb, fft_t *pfft, int nfft, double *c)
Real vectors fast linear convolution by using fast Fourier transform algorithms.
Definition: conv_fft.c:202
int DSPL_API fir_linphase(int ord, double w0, double w1, int filter_type, int win_type, double win_param, double *h)
Function calculates linear-phase FIR filter coefficients by window method.
Definition: fir_linphase.c:323
int DSPL_API bilinear(double *bs, double *as, int ord, double *bz, double *az)
Transform a s-plane analog filter transfer function to the digital filter transfer function .
Definition: bilinear.c:210
int DSPL_API iir(double rp, double rs, int ord, double w0, double w1, int type, double *b, double *a)
Digital IIR filter design.
Definition: iir.c:244
int DSPL_API cheby2_ap_zp(int ord, double rs, complex_t *z, int *nz, complex_t *p, int *np)
Function calculates arrays of zeros and poles for analog normlized lowpass Chebyshev type 2 filter tr...
Definition: cheby2_ap_zp.c:220
int DSPL_API low2high(double *b, double *a, int ord, double w0, double w1, double *beta, double *alpha)
Lowpass to highpass filter frequency transform.
Definition: low2high.c:148
int DSPL_API cheby1_ap(double rp, int ord, double *b, double *a)
Function calculates the transfer function coefficients of analog normalized lowpass Chebyshev type 1...
Definition: cheby1_ap.c:181
int DSPL_API butter_ap(double rp, int ord, double *b, double *a)
Function calculates the transfer function coefficients of analog normalized lowpass Butterworth filt...
Definition: butter_ap.c:173
int DSPL_API ellip_ap_zp(int ord, double rp, double rs, complex_t *z, int *nz, complex_t *p, int *np)
Function calculates arrays of zeros and poles for analog normlized lowpass elliptic filter transfer f...
Definition: ellip_ap_zp.c:220
int DSPL_API cheby1_ap_zp(int ord, double rp, complex_t *z, int *nz, complex_t *p, int *np)
Function calculates arrays of zeros and poles for analog normlized lowpass Chebyshev type 1 filter tr...
Definition: cheby1_ap_zp.c:205
int DSPL_API low2low(double *b, double *a, int ord, double w0, double w1, double *beta, double *alpha)
Definition: low2low.c:149
int DSPL_API ratcompos(double *b, double *a, int n, double *c, double *d, int p, double *beta, double *alpha)
Rational composition.
Definition: ratcompos.c:184
int DSPL_API butter_ap_zp(int ord, double rp, complex_t *z, int *nz, complex_t *p, int *np)
Function calculates arrays of zeros and poles for analog normlized lowpass Batterworth filter transfe...
Definition: butter_ap_zp.c:211
int DSPL_API ellip_ap(double rp, double rs, int ord, double *b, double *a)
Function calculates the transfer function coefficients of analog normalized lowpass elliptic filter ...
Definition: ellip_ap.c:193
int DSPL_API cheby2_ap(double rs, int ord, double *b, double *a)
Function calculates the transfer function coefficients of analog normalized lowpass Chebyshev type 2...
Definition: cheby2_ap.c:184
int DSPL_API writebin(void *x, int n, int m, int dtype, char *fn)
Save 1D vector to the binary file.
Definition: writebin.c:217
int DSPL_API writetxt_3d(double *x, int nx, double *y, int ny, double *z, char *fn)
Save data to the text file fn for 3D surface plotting.
Definition: writetxt_3d.c:214
int DSPL_API readbin(char *fn, void **x, int *pn, int *pm, int *dtype)
Read array from the bin-file.
Definition: readbin.c:314
int DSPL_API writetxt_int(int *x, int *y, int n, char *fn)
Save interger data to the text file fn. .
Definition: writetxt_int.c:115
int DSPL_API writetxt(double *x, double *y, int n, char *fn)
Save real data to the text file fn. .
Definition: writetxt.c:122
int DSPL_API gnuplot_open(void **hplot)
Open GNUPLOT program.
Definition: gnuplot_open.c:103
void DSPL_API gnuplot_close(void *h)
Close GNUPLOT handle.
Definition: gnuplot_close.c:80
int DSPL_API gnuplot_create(int argc, char *argv[], int w, int h, char *fn_png, void **hplot)
Create GNUPLOT chart.
void DSPL_API gnuplot_cmd(void *h, char *cmd)
Function sends cmd command to GNUPLOT corresponds to h handle.
Definition: gnuplot_cmd.c:82
int DSPL_API sinc(double *x, int n, double a, double *y)
Function for the real vector x.
Definition: sinc.c:88
int DSPL_API sqrt_cmplx(complex_t *x, int n, complex_t *y)
Square root of the complex vector argguument x.
Definition: sqrt_cmplx.c:136
int DSPL_API log_cmplx(complex_t *x, int n, complex_t *y)
The logarithm function the complex vector argument x.
Definition: log_cmplx.c:139
int DSPL_API ellip_sn_cmplx(complex_t *u, int n, double k, complex_t *y)
Jacobi elliptic function of complex vector argument.
int DSPL_API ellip_cd_cmplx(complex_t *u, int n, double k, complex_t *y)
Jacobi elliptic function of complex vector argument.
int DSPL_API ellip_asn(double *w, int n, double k, double *u)
Inverse Jacobi elliptic function of real vector argument.
Definition: ellip_asn.c:106
int DSPL_API ellip_acd_cmplx(complex_t *w, int n, double k, complex_t *u)
Inverse Jacobi elliptic function of complex vector argument.
int DSPL_API ellip_cd(double *u, int n, double k, double *y)
Jacobi elliptic function of real vector argument.
Definition: ellip_cd.c:125
int DSPL_API ellip_asn_cmplx(complex_t *w, int n, double k, complex_t *u)
Inverse Jacobi elliptic function of complex vector argument.
int DSPL_API ellip_sn(double *u, int n, double k, double *y)
Jacobi elliptic function of real vector argument.
Definition: ellip_sn.c:127
int DSPL_API ellip_landen(double k, int n, double *y)
Function calculates complete elliptical integral coefficients .
Definition: ellip_landen.c:175
int DSPL_API ellip_acd(double *w, int n, double k, double *u)
Inverse Jacobi elliptic function of the real vector argument.
Definition: ellip_acd.c:102
int DSPL_API matrix_eye_cmplx(complex_t *a, int n, int m)
The complex identity matrix size n x m generation.
int DSPL_API matrix_eye(double *a, int n, int m)
The real identity matrix size n x m generation.
Definition: matrix_eye.c:80
int DSPL_API matrix_mul(double *a, int na, int ma, double *b, int nb, int mb, double *c)
Matrix multiplication.
Definition: matrix_mul.c:191
int DSPL_API matrix_eig_cmplx(complex_t *a, int n, complex_t *v, int *info)
Eigenvalues calculation of the complex square matrix a.
int DSPL_API cheby_poly1(double *x, int n, int ord, double *y)
Chebyshev polynomial of the first kind order ord
Definition: cheby_poly1.c:136
int DSPL_API cheby_poly2(double *x, int n, int ord, double *y)
Chebyshev polynomial of the second kind order ord
Definition: cheby_poly2.c:133
int DSPL_API polyroots(double *a, int ord, complex_t *r, int *info)
Function calculates real polynomial roots.
Definition: polyroots.c:157
int DSPL_API randb2(double *x, int n, random_t *prnd)
Binary bipolar [-1, 1] pseudorandom vector.
Definition: randb2.c:116
int DSPL_API random_init(random_t *prnd, int type, void *seed)
Pseudorandom numbers generators initialization.
Definition: random_init.c:120
int DSPL_API randb(double *x, int n, random_t *prnd)
Binary unipolar [0, 1] pseudorandom vector.
Definition: randb.c:118
int DSPL_API xcorr_cmplx(complex_t *x, int nx, complex_t *y, int ny, int flag, int nr, complex_t *r, double *t)
Estimates the cross-correlation vector for complex discrete-time sequences x and y.
Definition: xcorr.c:449
int DSPL_API mean_cmplx(complex_t *x, int n, complex_t *m)
Calculates the mean of the complex input vector x
Definition: mean_cmplx.c:108
int DSPL_API mean(double *x, int n, double *m)
Calculates the mean of the input vector x
Definition: mean.c:105
int DSPL_API find_max_abs(double *a, int n, double *m, int *ind)
Find maximum absolute value from the real vector a
Definition: find_max_abs.c:121
int DSPL_API stat_std_cmplx(complex_t *x, int n, double *s)
Calculates the standard deviation of the complex input vector x
int DSPL_API stat_std(double *x, int n, double *s)
Calculates the standard deviation of the input vector x
Definition: stat_std.c:116
int DSPL_API xcorr(double *x, int nx, double *y, int ny, int flag, int nr, double *r, double *t)
Estimates the cross-correlation vector for real discrete-time sequences x and y.
Definition: xcorr.c:214
int DSPL_API bessel_i0(double *x, int n, double *y)
Modified Bessel Function of the First Kind – [1].
Definition: bessel_i0.c:116
int DSPL_API sine_int(double *x, int n, double *si)
Sine integral function for the real vector x.
Definition: sine_int.c:114
int DSPL_API cos_cmplx(complex_t *x, int n, complex_t *y)
The cosine function the complex vector argument x.
Definition: cos_cmplx.c:136
int DSPL_API acos_cmplx(complex_t *x, int n, complex_t *y)
The inverse of the cosine function the complex vector argument x.
Definition: acos_cmplx.c:141
int DSPL_API sin_cmplx(complex_t *x, int n, complex_t *y)
The sine function the complex vector argument x.
Definition: sin_cmplx.c:136
int DSPL_API asin_cmplx(complex_t *x, int n, complex_t *y)
The inverse of the sine function the complex vector argument x.
Definition: asin_cmplx.c:138
void * dspl_load()
Perform dynamic linking and load libdspl-2.0 functions.
void dspl_free(void *handle)
Cleans up the previously linked DSPL-2.0 dynamic library.
int DSPL_API cmplx2re(complex_t *x, int n, double *re, double *im)
Separate complex vector to the real and image vectors.
Definition: cmplx2re.c:130
int DSPL_API re2cmplx(double *x, int n, complex_t *y)
Convert real array to the complex array.
Definition: re2cmplx.c:120
double complex_t[2]
Complex data type.
Definition: dspl.h:86
int DSPL_API window(double *w, int n, int win_type, double param)
Window function calculation.
Definition: win.c:329
Fast Fourier Transform Object Data Structure.
Definition: dspl.h:278
complex_t * w
Definition: dspl.h:279
int n
Definition: dspl.h:292
complex_t * t0
Definition: dspl.h:280
complex_t * t1
Definition: dspl.h:281
complex_t * w4096
Definition: dspl.h:291
complex_t * w2048
Definition: dspl.h:290
complex_t * w1024
Definition: dspl.h:289
Definition: dspl.h:350
int mt19937_mti
Definition: dspl.h:358
double mrg32k3a_seed
Definition: dspl.h:352
int type
Definition: dspl.h:360