libdspl-2.0
Digital Signal Processing Algorithm Library
dspl.h
1 /*
2 * Copyright (c) 2015-2020 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
38 
60 #endif
61 #ifdef DOXYGEN_RUSSIAN
62 
85 #endif
86 typedef double complex_t[2];
87 
88 
89 
90 #ifdef DOXYGEN_ENGLISH
91 
183 #endif
184 #ifdef DOXYGEN_RUSSIAN
185 
276 #endif
277 typedef 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
305 
348 #endif
349 typedef 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
367 
392 #endif
393 #ifdef DOXYGEN_RUSSIAN
394 
419 #endif
420 #define RE(x) (x[0])
421 
422 
423 
424 #ifdef DOXYGEN_ENGLISH
425 
451 #endif
452 #ifdef DOXYGEN_RUSSIAN
453 
477 #endif
478 #define IM(x) (x[1])
479 
480 
481 
482 #define SQR(x) ((x) * (x))
483 
484 
485 #ifdef DOXYGEN_ENGLISH
486 
509 #endif
510 #ifdef DOXYGEN_RUSSIAN
511 
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 /*----------------------------------------------------------------------------*/
747 DECLARE_FUNC(int, acos_cmplx, complex_t*
748  COMMA int
749  COMMA complex_t*);
750 /*----------------------------------------------------------------------------*/
751 DECLARE_FUNC(int, addlog, char* str
752  COMMA char* fn);
753 /*----------------------------------------------------------------------------*/
754 DECLARE_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 /*----------------------------------------------------------------------------*/
762 DECLARE_FUNC(int, asin_cmplx, complex_t*
763  COMMA int
764  COMMA complex_t*);
765 /*----------------------------------------------------------------------------*/
766 DECLARE_FUNC(int, bessel_i0, double* x
767  COMMA int n
768  COMMA double* y);
769 /*----------------------------------------------------------------------------*/
770 DECLARE_FUNC(int, bilinear, double* bs
771  COMMA double* as
772  COMMA int ord
773  COMMA double* bz
774  COMMA double* az);
775 /*----------------------------------------------------------------------------*/
776 DECLARE_FUNC(int, butter_ap, double
777  COMMA int
778  COMMA double*
779  COMMA double*);
780 /*----------------------------------------------------------------------------*/
781 DECLARE_FUNC(int, butter_ap_zp, int
782  COMMA double
783  COMMA complex_t*
784  COMMA int*
785  COMMA complex_t*
786  COMMA int*);
787 /*----------------------------------------------------------------------------*/
788 DECLARE_FUNC(int, cheby_poly1, double*
789  COMMA int
790  COMMA int
791  COMMA double*);
792 /*----------------------------------------------------------------------------*/
793 DECLARE_FUNC(int, cheby_poly2, double*
794  COMMA int
795  COMMA int
796  COMMA double*);
797 /*----------------------------------------------------------------------------*/
798 DECLARE_FUNC(int, cheby1_ap, double
799  COMMA int
800  COMMA double*
801  COMMA double*);
802 /*----------------------------------------------------------------------------*/
803 DECLARE_FUNC(int, cheby1_ap_zp, int
804  COMMA double
805  COMMA complex_t*
806  COMMA int*
807  COMMA complex_t*
808  COMMA int*);
809 /*----------------------------------------------------------------------------*/
810 DECLARE_FUNC(int, cheby2_ap, double rs
811  COMMA int ord
812  COMMA double* b
813  COMMA double* a);
814 /*----------------------------------------------------------------------------*/
815 DECLARE_FUNC(int, cheby2_ap_wp1, double rp
816  COMMA double rs
817  COMMA int ord
818  COMMA double* b
819  COMMA double* a);
820 /*----------------------------------------------------------------------------*/
821 DECLARE_FUNC(int, cheby2_ap_zp, int
822  COMMA double
823  COMMA complex_t*
824  COMMA int*
825  COMMA complex_t*
826  COMMA int*);
827 /*----------------------------------------------------------------------------*/
828 DECLARE_FUNC(int, cmplx2re, complex_t*
829  COMMA int
830  COMMA double*
831  COMMA double*);
832 /*----------------------------------------------------------------------------*/
833 DECLARE_FUNC(int, concat, void*
834  COMMA size_t
835  COMMA void*
836  COMMA size_t
837  COMMA void*);
838 /*----------------------------------------------------------------------------*/
839 DECLARE_FUNC(int, conv, double*
840  COMMA int
841  COMMA double*
842  COMMA int
843  COMMA double*);
844 /*----------------------------------------------------------------------------*/
845 DECLARE_FUNC(int, conv_cmplx, complex_t*
846  COMMA int
847  COMMA complex_t*
848  COMMA int
849  COMMA complex_t*);
850 /*----------------------------------------------------------------------------*/
851 DECLARE_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 /*----------------------------------------------------------------------------*/
859 DECLARE_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 /*----------------------------------------------------------------------------*/
867 DECLARE_FUNC(int, cos_cmplx, complex_t*
868  COMMA int
869  COMMA complex_t*);
870 /*----------------------------------------------------------------------------*/
871 DECLARE_FUNC(int, decimate, double* x
872  COMMA int n
873  COMMA int d
874  COMMA double* y
875  COMMA int* cnt);
876 /*----------------------------------------------------------------------------*/
877 DECLARE_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 /*----------------------------------------------------------------------------*/
883 DECLARE_FUNC(int, dft, double*
884  COMMA int
885  COMMA complex_t*);
886 /*----------------------------------------------------------------------------*/
887 DECLARE_FUNC(int, dft_cmplx, complex_t*
888  COMMA int
889  COMMA complex_t*);
890 /*----------------------------------------------------------------------------*/
891 DECLARE_FUNC(double, dmod, double
892  COMMA double);
893 /*----------------------------------------------------------------------------*/
894 DECLARE_FUNC(void, dspl_info, void);
895 /*----------------------------------------------------------------------------*/
896 DECLARE_FUNC(int, ellip_acd, double* w
897  COMMA int n
898  COMMA double k
899  COMMA double* u);
900 /*----------------------------------------------------------------------------*/
901 DECLARE_FUNC(int, ellip_acd_cmplx, complex_t* w
902  COMMA int n
903  COMMA double k
904  COMMA complex_t* u);
905 /*----------------------------------------------------------------------------*/
906 DECLARE_FUNC(int, ellip_ap, double rp
907  COMMA double rs
908  COMMA int ord
909  COMMA double* b
910  COMMA double* a);
911 /*----------------------------------------------------------------------------*/
912 DECLARE_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 /*----------------------------------------------------------------------------*/
920 DECLARE_FUNC(int, ellip_asn, double* w
921  COMMA int n
922  COMMA double k
923  COMMA double* u);
924 /*----------------------------------------------------------------------------*/
925 DECLARE_FUNC(int, ellip_asn_cmplx, complex_t* w
926  COMMA int n
927  COMMA double k
928  COMMA complex_t* u);
929 /*----------------------------------------------------------------------------*/
930 DECLARE_FUNC(int, ellip_cd, double* u
931  COMMA int n
932  COMMA double k
933  COMMA double* y);
934 /*----------------------------------------------------------------------------*/
935 DECLARE_FUNC(int, ellip_cd_cmplx, complex_t* u
936  COMMA int n
937  COMMA double k
938  COMMA complex_t* y);
939 /*----------------------------------------------------------------------------*/
940 DECLARE_FUNC(int, ellip_landen, double k
941  COMMA int n
942  COMMA double* y);
943 /*----------------------------------------------------------------------------*/
944 DECLARE_FUNC(int, ellip_modulareq, double rp
945  COMMA double rs
946  COMMA int ord
947  COMMA double* k);
948 /*----------------------------------------------------------------------------*/
949 DECLARE_FUNC(int, ellip_rat, double* w
950  COMMA int n
951  COMMA int ord
952  COMMA double k
953  COMMA double* u);
954 /*----------------------------------------------------------------------------*/
955 DECLARE_FUNC(int, ellip_sn, double* u
956  COMMA int n
957  COMMA double k
958  COMMA double* y);
959 /*----------------------------------------------------------------------------*/
960 DECLARE_FUNC(int, ellip_sn_cmplx, complex_t* u
961  COMMA int n
962  COMMA double k
963  COMMA complex_t* y);
964 /*----------------------------------------------------------------------------*/
965 DECLARE_FUNC(int, farrow_lagrange, double*
966  COMMA int
967  COMMA double
968  COMMA double
969  COMMA double
970  COMMA double**
971  COMMA int*);
972 /*----------------------------------------------------------------------------*/
973 DECLARE_FUNC(int, farrow_spline, double*
974  COMMA int
975  COMMA double
976  COMMA double
977  COMMA double
978  COMMA double**
979  COMMA int*);
980 /*----------------------------------------------------------------------------*/
981 DECLARE_FUNC(int, fft, double*
982  COMMA int
983  COMMA fft_t*
984  COMMA complex_t* );
985 /*----------------------------------------------------------------------------*/
986 DECLARE_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 /*----------------------------------------------------------------------------*/
994 DECLARE_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 /*----------------------------------------------------------------------------*/
1002 DECLARE_FUNC(int, fft_cmplx, complex_t*
1003  COMMA int
1004  COMMA fft_t*
1005  COMMA complex_t* );
1006 /*----------------------------------------------------------------------------*/
1007 DECLARE_FUNC(int, fft_create, fft_t*
1008  COMMA int);
1009 /*----------------------------------------------------------------------------*/
1010 DECLARE_FUNC(void, fft_free, fft_t*);
1011 /*----------------------------------------------------------------------------*/
1012 DECLARE_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 /*----------------------------------------------------------------------------*/
1020 DECLARE_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 /*----------------------------------------------------------------------------*/
1028 DECLARE_FUNC(int, fft_shift, double*
1029  COMMA int n
1030  COMMA double*);
1031 /*----------------------------------------------------------------------------*/
1032 DECLARE_FUNC(int, fft_shift_cmplx, complex_t*
1033  COMMA int
1034  COMMA complex_t*);
1035 /*----------------------------------------------------------------------------*/
1036 DECLARE_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 /*----------------------------------------------------------------------------*/
1046 DECLARE_FUNC(int, filter_iir, double*
1047  COMMA double*
1048  COMMA int
1049  COMMA double*
1050  COMMA int
1051  COMMA double*);
1052 /*----------------------------------------------------------------------------*/
1053 DECLARE_FUNC(double, filter_ws1, int ord
1054  COMMA double rp
1055  COMMA double rs
1056  COMMA int type);
1057 /*----------------------------------------------------------------------------*/
1058 DECLARE_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 /*----------------------------------------------------------------------------*/
1066 DECLARE_FUNC(int, find_max_abs, double* a
1067  COMMA int n
1068  COMMA double* m
1069  COMMA int* ind);
1070 /*----------------------------------------------------------------------------*/
1071 DECLARE_FUNC(int, find_nearest, double* x
1072  COMMA int n
1073  COMMA double val
1074  COMMA int* idx
1075  COMMA double* dist);
1076 /*----------------------------------------------------------------------------*/
1077 DECLARE_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 /*----------------------------------------------------------------------------*/
1085 DECLARE_FUNC(int, flipip, double*
1086  COMMA int);
1087 /*----------------------------------------------------------------------------*/
1088 DECLARE_FUNC(int, flipip_cmplx, complex_t*
1089  COMMA int);
1090 /*----------------------------------------------------------------------------*/
1091 DECLARE_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 /*----------------------------------------------------------------------------*/
1098 DECLARE_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 /*----------------------------------------------------------------------------*/
1106 DECLARE_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 /*----------------------------------------------------------------------------*/
1114 DECLARE_FUNC(int, fourier_series_rec, double*
1115  COMMA complex_t*
1116  COMMA int
1117  COMMA double*
1118  COMMA int
1119  COMMA complex_t*);
1120 /*----------------------------------------------------------------------------*/
1121 DECLARE_FUNC(int, freqs, double*
1122  COMMA double*
1123  COMMA int
1124  COMMA double*
1125  COMMA int
1126  COMMA complex_t*);
1127 /*----------------------------------------------------------------------------*/
1128 DECLARE_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 /*----------------------------------------------------------------------------*/
1135 DECLARE_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 /*----------------------------------------------------------------------------*/
1144 DECLARE_FUNC(int, freqz, double*
1145  COMMA double*
1146  COMMA int
1147  COMMA double*
1148  COMMA int
1149  COMMA complex_t*);
1150 /*----------------------------------------------------------------------------*/
1151 DECLARE_FUNC(void, gnuplot_close, void* h);
1152 /*----------------------------------------------------------------------------*/
1153 DECLARE_FUNC(void, gnuplot_cmd, void* h
1154  COMMA char* cmd);
1155 /*----------------------------------------------------------------------------*/
1156 DECLARE_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 /*----------------------------------------------------------------------------*/
1163 DECLARE_FUNC(int, gnuplot_open, void** hplot);
1164 /*----------------------------------------------------------------------------*/
1165 DECLARE_FUNC(int, goertzel, double*
1166  COMMA int
1167  COMMA int*
1168  COMMA int
1169  COMMA complex_t*);
1170 /*----------------------------------------------------------------------------*/
1171 DECLARE_FUNC(int, goertzel_cmplx, complex_t*
1172  COMMA int
1173  COMMA int*
1174  COMMA int
1175  COMMA complex_t*);
1176 /*----------------------------------------------------------------------------*/
1177 DECLARE_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 /*----------------------------------------------------------------------------*/
1185 DECLARE_FUNC(int, histogram, double* x
1186  COMMA int n
1187  COMMA int nh
1188  COMMA double* pedges
1189  COMMA double* ph);
1190 /*----------------------------------------------------------------------------*/
1191 DECLARE_FUNC(int, histogram_norm, double* y
1192  COMMA int n
1193  COMMA int nh
1194  COMMA double* x
1195  COMMA double* w);
1196 /*----------------------------------------------------------------------------*/
1197 DECLARE_FUNC(int, idft_cmplx, complex_t*
1198  COMMA int
1199  COMMA complex_t*);
1200 /*----------------------------------------------------------------------------*/
1201 DECLARE_FUNC(int, ifft_cmplx, complex_t*
1202  COMMA int
1203  COMMA fft_t*
1204  COMMA complex_t* );
1205 /*----------------------------------------------------------------------------*/
1206 DECLARE_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 /*----------------------------------------------------------------------------*/
1215 DECLARE_FUNC(int, linspace, double
1216  COMMA double
1217  COMMA int
1218  COMMA int
1219  COMMA double*);
1220 /*----------------------------------------------------------------------------*/
1221 DECLARE_FUNC(int, log_cmplx, complex_t*
1222  COMMA int
1223  COMMA complex_t*);
1224 /*----------------------------------------------------------------------------*/
1225 DECLARE_FUNC(int, logspace, double
1226  COMMA double
1227  COMMA int
1228  COMMA int
1229  COMMA double*);
1230 /*----------------------------------------------------------------------------*/
1231 DECLARE_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 /*----------------------------------------------------------------------------*/
1240 DECLARE_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 /*----------------------------------------------------------------------------*/
1249 DECLARE_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 /*----------------------------------------------------------------------------*/
1257 DECLARE_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 /*----------------------------------------------------------------------------*/
1265 DECLARE_FUNC(int, matrix_eig_cmplx, complex_t* a
1266  COMMA int n
1267  COMMA complex_t* v
1268  COMMA int* info);
1269 /*----------------------------------------------------------------------------*/
1270 DECLARE_FUNC(int, matrix_eye, double* a
1271  COMMA int n
1272  COMMA int m);
1273 /*----------------------------------------------------------------------------*/
1274 DECLARE_FUNC(int, matrix_eye_cmplx, complex_t* a
1275  COMMA int n
1276  COMMA int m);
1277 /*----------------------------------------------------------------------------*/
1278 DECLARE_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 /*----------------------------------------------------------------------------*/
1286 DECLARE_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 /*----------------------------------------------------------------------------*/
1293 DECLARE_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 /*----------------------------------------------------------------------------*/
1299 DECLARE_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 /*----------------------------------------------------------------------------*/
1305 DECLARE_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 /*----------------------------------------------------------------------------*/
1313 DECLARE_FUNC(int, matrix_transpose, double* a
1314  COMMA int n
1315  COMMA int m
1316  COMMA double* b);
1317 /*----------------------------------------------------------------------------*/
1318 DECLARE_FUNC(int, matrix_transpose_cmplx, complex_t* a
1319  COMMA int n
1320  COMMA int m
1321  COMMA complex_t* b);
1322 /*----------------------------------------------------------------------------*/
1323 DECLARE_FUNC(int, matrix_transpose_hermite, complex_t* a
1324  COMMA int n
1325  COMMA int m
1326  COMMA complex_t* b);
1327 /*----------------------------------------------------------------------------*/
1328 DECLARE_FUNC(int, mean, double* x
1329  COMMA int n
1330  COMMA double* m);
1331 /*----------------------------------------------------------------------------*/
1332 DECLARE_FUNC(int, mean_cmplx, complex_t* x
1333  COMMA int n
1334  COMMA complex_t* m);
1335 /*----------------------------------------------------------------------------*/
1336 DECLARE_FUNC(int, minmax, double* x
1337  COMMA int n
1338  COMMA double* xmin
1339  COMMA double* xmax);
1340 /*----------------------------------------------------------------------------*/
1341 DECLARE_FUNC(int, ones, double* x
1342  COMMA int n);
1343 /*----------------------------------------------------------------------------*/
1344 DECLARE_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 /*----------------------------------------------------------------------------*/
1352 DECLARE_FUNC(int, poly_z2a_cmplx, complex_t*
1353  COMMA int
1354  COMMA int
1355  COMMA complex_t*);
1356 /*----------------------------------------------------------------------------*/
1357 DECLARE_FUNC(int, polyroots, double* a
1358  COMMA int ord
1359  COMMA complex_t* r
1360  COMMA int* info);
1361 /*----------------------------------------------------------------------------*/
1362 DECLARE_FUNC(int, polyval, double*
1363  COMMA int
1364  COMMA double*
1365  COMMA int
1366  COMMA double*);
1367 /*----------------------------------------------------------------------------*/
1368 DECLARE_FUNC(int, polyval_cmplx, complex_t*
1369  COMMA int
1370  COMMA complex_t*
1371  COMMA int
1372  COMMA complex_t*);
1373 /*----------------------------------------------------------------------------*/
1374 DECLARE_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 /*----------------------------------------------------------------------------*/
1383 DECLARE_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 /*----------------------------------------------------------------------------*/
1392 DECLARE_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 /*----------------------------------------------------------------------------*/
1402 DECLARE_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 /*----------------------------------------------------------------------------*/
1412 DECLARE_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 /*----------------------------------------------------------------------------*/
1424 DECLARE_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 /*----------------------------------------------------------------------------*/
1436 DECLARE_FUNC(int, randb, double* x
1437  COMMA int n
1438  COMMA random_t* prnd);
1439 /*----------------------------------------------------------------------------*/
1440 DECLARE_FUNC(int, randb2, double* x
1441  COMMA int n
1442  COMMA random_t* prnd);
1443 /*----------------------------------------------------------------------------*/
1444 DECLARE_FUNC(int, randi, int* x
1445  COMMA int n
1446  COMMA int start
1447  COMMA int stop
1448  COMMA random_t* prnd);
1449 /*----------------------------------------------------------------------------*/
1450 DECLARE_FUNC(int, randn, double* x
1451  COMMA int n
1452  COMMA double mu
1453  COMMA double sigma
1454  COMMA random_t* prnd);
1455 /*----------------------------------------------------------------------------*/
1456 DECLARE_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 /*----------------------------------------------------------------------------*/
1462 DECLARE_FUNC(int, random_init, random_t* prnd
1463  COMMA int type
1464  COMMA void* seed);
1465 /*----------------------------------------------------------------------------*/
1466 DECLARE_FUNC(int, randu, double*
1467  COMMA int
1468  COMMA random_t* prnd);
1469 /*----------------------------------------------------------------------------*/
1470 DECLARE_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 /*----------------------------------------------------------------------------*/
1479 DECLARE_FUNC(int, re2cmplx, double*
1480  COMMA int
1481  COMMA complex_t*);
1482 /*----------------------------------------------------------------------------*/
1483 DECLARE_FUNC(int, readbin, char* fn
1484  COMMA void** x
1485  COMMA int* k
1486  COMMA int* dtype);
1487 /*----------------------------------------------------------------------------*/
1488 DECLARE_FUNC(int, signal_pimp, double*
1489  COMMA size_t
1490  COMMA double
1491  COMMA double
1492  COMMA double
1493  COMMA double
1494  COMMA double*);
1495 /*----------------------------------------------------------------------------*/
1496 DECLARE_FUNC(int, signal_saw, double* t
1497  COMMA size_t n
1498  COMMA double amp
1499  COMMA double dt
1500  COMMA double period
1501  COMMA double* y);
1502 /*----------------------------------------------------------------------------*/
1503 DECLARE_FUNC(int, sin_cmplx, complex_t*
1504  COMMA int
1505  COMMA complex_t*);
1506 /*----------------------------------------------------------------------------*/
1507 DECLARE_FUNC(int, sinc, double* x
1508  COMMA int n
1509  COMMA double a
1510  COMMA double* y);
1511 /*----------------------------------------------------------------------------*/
1512 DECLARE_FUNC(int, sine_int, double* x
1513  COMMA int n
1514  COMMA double* si);
1515 /*----------------------------------------------------------------------------*/
1516 DECLARE_FUNC(int, sqrt_cmplx, complex_t*
1517  COMMA int
1518  COMMA complex_t*);
1519 /*----------------------------------------------------------------------------*/
1520 DECLARE_FUNC(int, std, double* x
1521  COMMA int n
1522  COMMA double* s);
1523 /*----------------------------------------------------------------------------*/
1524 DECLARE_FUNC(int, std_cmplx, complex_t* x
1525  COMMA int n
1526  COMMA double* s);
1527 /*----------------------------------------------------------------------------*/
1528 DECLARE_FUNC(int, sum, double* x
1529  COMMA int n
1530  COMMA double* s);
1531 /*----------------------------------------------------------------------------*/
1532 DECLARE_FUNC(int, sum_sqr, double* x
1533  COMMA int n
1534  COMMA double* s);
1535 /*----------------------------------------------------------------------------*/
1536 DECLARE_FUNC(int, trapint, double*
1537  COMMA double*
1538  COMMA int
1539  COMMA double*);
1540 /*----------------------------------------------------------------------------*/
1541 DECLARE_FUNC(int, trapint_cmplx, double*
1542  COMMA complex_t*
1543  COMMA int
1544  COMMA complex_t*);
1545 /*----------------------------------------------------------------------------*/
1546 DECLARE_FUNC(int, unwrap, double*
1547  COMMA int
1548  COMMA double
1549  COMMA double);
1550 /*----------------------------------------------------------------------------*/
1551 DECLARE_FUNC(int, vector_dot, double* x
1552  COMMA double* y
1553  COMMA int n
1554  COMMA double* p);
1555 /*----------------------------------------------------------------------------*/
1556 DECLARE_FUNC(int, verif, double* x
1557  COMMA double* y
1558  COMMA size_t n
1559  COMMA double eps
1560  COMMA double* err);
1561 /*----------------------------------------------------------------------------*/
1562 DECLARE_FUNC(int, verif_data_gen, int len
1563  COMMA int type
1564  COMMA char* fn);
1565 /*----------------------------------------------------------------------------*/
1566 DECLARE_FUNC(int, verif_cmplx, complex_t* x
1567  COMMA complex_t* y
1568  COMMA size_t n
1569  COMMA double eps
1570  COMMA double* err);
1571 /*----------------------------------------------------------------------------*/
1572 DECLARE_FUNC(void, verif_str, double* yout
1573  COMMA int nout
1574  COMMA char* str_msg
1575  COMMA char* outfn
1576  COMMA char* logfn);
1577 /*----------------------------------------------------------------------------*/
1578 DECLARE_FUNC(void, verif_str_cmplx, complex_t* yout
1579  COMMA int nout
1580  COMMA char* str_msg
1581  COMMA char* outfn
1582  COMMA char* logfn);
1583 /*----------------------------------------------------------------------------*/
1584 DECLARE_FUNC(int, window, double* w
1585  COMMA int n
1586  COMMA int win_type
1587  COMMA double param);
1588 /*----------------------------------------------------------------------------*/
1589 DECLARE_FUNC(int, writebin, void*
1590  COMMA int
1591  COMMA int
1592  COMMA char*);
1593 /*----------------------------------------------------------------------------*/
1594 DECLARE_FUNC(int, writetxt, double*
1595  COMMA double*
1596  COMMA int
1597  COMMA char* );
1598 /*----------------------------------------------------------------------------*/
1599 DECLARE_FUNC(int, writetxt_3d, double* x
1600  COMMA int nx
1601  COMMA double* y
1602  COMMA int ny
1603  COMMA double* z
1604  COMMA char* fn);
1605 /*----------------------------------------------------------------------------*/
1606 DECLARE_FUNC(int, writetxt_3dline, double* x
1607  COMMA double* y
1608  COMMA double* z
1609  COMMA int n
1610  COMMA char* fn);
1611 /*----------------------------------------------------------------------------*/
1612 DECLARE_FUNC(int, writetxt_cmplx, complex_t* x
1613  COMMA int n
1614  COMMA char* fn);
1615 /*----------------------------------------------------------------------------*/
1616 DECLARE_FUNC(int, writetxt_cmplx_im, double*
1617  COMMA complex_t*
1618  COMMA int
1619  COMMA char*);
1620 /*----------------------------------------------------------------------------*/
1621 DECLARE_FUNC(int, writetxt_cmplx_re, double*
1622  COMMA complex_t*
1623  COMMA int
1624  COMMA char*);
1625 /*----------------------------------------------------------------------------*/
1626 DECLARE_FUNC(int, writetxt_int, int*
1627  COMMA int*
1628  COMMA int
1629  COMMA char*);
1630 /*----------------------------------------------------------------------------*/
1631 DECLARE_FUNC(int, xcorr, double* x
1632  COMMA int nx
1633  COMMA double* y
1634  COMMA int ny
1635  COMMA int flag
1636  COMMA int nr
1637  COMMA double* r
1638  COMMA double* t);
1639 /*----------------------------------------------------------------------------*/
1640 DECLARE_FUNC(int, xcorr_cmplx, complex_t* x
1641  COMMA int nx
1642  COMMA complex_t* y
1643  COMMA int ny
1644  COMMA int flag
1645  COMMA int nr
1646  COMMA complex_t* r
1647  COMMA double* t);
1648 /*----------------------------------------------------------------------------*/
1649 
1650 
1651 #ifdef __cplusplus
1652  }
1653 #endif
1654 
1655 
1656 #ifdef DOXYGEN_ENGLISH
1657 
1709 #endif
1710 #ifdef DOXYGEN_RUSSIAN
1711 
1763 #endif
1764 void* dspl_load();
1765 
1766 
1767 
1768 
1769 
1770 #ifdef DOXYGEN_ENGLISH
1771 
1787 #endif
1788 #ifdef DOXYGEN_RUSSIAN
1789 
1805 #endif
1806 void dspl_free(void* handle);
1807 
1808 
1809 
1810 #endif /* DSPL_H */
1811 
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.c:543
int DSPL_API window(double *w, int n, int win_type, double param)
Window function calculation.
Definition: win.c:308
complex_t * w1024
Definition: dspl.h:289
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: filter_ap.c:1780
int DSPL_API sine_int(double *x, int n, double *si)
Sine integral function for the real vector x.
Definition: math.c:1043
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: filter_ap.c:595
int DSPL_API flipip_cmplx(complex_t *x, int n)
Flip complex vector x in place.
Definition: array.c:874
int DSPL_API ellip_cd(double *u, int n, double k, double *y)
Jacobi elliptic function of real vector argument.
Definition: ellipj.c:594
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: filter_ap.c:396
int DSPL_API filter_iir(double *b, double *a, int ord, double *x, int n, double *y)
Real IIR filtration.
Definition: conv.c:993
int DSPL_API ratcompos(double *b, double *a, int n, double *c, double *d, int p, double *beta, double *alpha)
Rational composition.
Definition: filter_ft.c:602
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.
complex_t * t1
Definition: dspl.h:281
Definition: dspl.h:350
int DSPL_API writebin(void *x, int n, int dtype, char *fn)
Save 1D vector to the binary file.
Definition: inout.c:328
int DSPL_API low2low(double *b, double *a, int ord, double w0, double w1, double *beta, double *alpha)
Definition: filter_ft.c:426
int DSPL_API flipip(double *x, int n)
Flip real vector x in place.
Definition: array.c:751
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: filter_iir.c:210
int DSPL_API writetxt_int(int *x, int *y, int n, char *fn)
Save interger data to the text file fn. .
Definition: inout.c:664
int DSPL_API conv(double *a, int na, double *b, int nb, double *c)
Real vectors linear convolution.
Definition: conv.c:157
complex_t * t0
Definition: dspl.h:280
int DSPL_API cheby_poly2(double *x, int n, int ord, double *y)
Chebyshev polynomial of the second kind order ord
Definition: cheby.c:285
int DSPL_API log_cmplx(complex_t *x, int n, complex_t *y)
The logarithm function the complex vector argument x.
Definition: math.c:718
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: math.c:141
int DSPL_API idft_cmplx(complex_t *x, int n, complex_t *y)
Inverse discrete Fourier transform of the complex spectrum.
Definition: dft.c:500
int DSPL_API polyroots(double *a, int ord, complex_t *r, int *info)
Function calculates real polynomial roots.
Definition: polyval.c:199
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.c:1357
int n
Definition: dspl.h:292
void DSPL_API gnuplot_close(void *h)
Close GNUPLOT handle.
Definition: gnuplot.c:325
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: filter_iir.c:404
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: filter_ft.c:280
int DSPL_API fft_create(fft_t *pfft, int n)
Function creates and fill fft_t structure.
Definition: fft.c:935
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.c:646
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 ifft_cmplx(complex_t *x, int n, fft_t *pfft, complex_t *y)
Inverse fast Fourier transform.
Definition: fft.c:180
int DSPL_API std_cmplx(complex_t *x, int n, double *s)
Calculates the standard deviation of the complex input vector x
Definition: statistic.c:662
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.
Definition: conv.c:745
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: array.c:1224
int DSPL_API ellip_acd(double *w, int n, double k, double *u)
Inverse Jacobi elliptic function of the real vector argument.
Definition: ellipj.c:103
void DSPL_API fft_free(fft_t *pfft)
Free fft_t structure.
Definition: fft.c:1177
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: filter_an.c:1190
int type
Definition: dspl.h:360
void * dspl_load()
Perform dynamic linking and load libdspl-2.0 functions.
int DSPL_API ellip_sn_cmplx(complex_t *u, int n, double k, complex_t *y)
Jacobi elliptic function of complex vector argument.
Definition: ellipj.c:1216
int DSPL_API ellip_sn(double *u, int n, double k, double *y)
Jacobi elliptic function of real vector argument.
Definition: ellipj.c:1111
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
Fast Fourier Transform Object Data Structure.
Definition: dspl.h:278
void DSPL_API gnuplot_cmd(void *h, char *cmd)
Function sends cmd command to GNUPLOT corresponds to h handle.
Definition: gnuplot.c:390
complex_t * w4096
Definition: dspl.h:291
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 fft(double *x, int n, fft_t *pfft, complex_t *y)
Fast Fourier transform for the real vector.
Definition: fft.c:357
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: inout.c:880
int DSPL_API ellip_asn_cmplx(complex_t *w, int n, double k, complex_t *u)
Inverse Jacobi elliptic function of complex vector argument.
Definition: ellipj.c:447
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: filter_ap.c:174
int DSPL_API cheby_poly1(double *x, int n, int ord, double *y)
Chebyshev polynomial of the first kind order ord
Definition: cheby.c:134
int DSPL_API re2cmplx(double *x, int n, complex_t *y)
Convert real array to the complex array.
Definition: complex.c:246
int mt19937_mti
Definition: dspl.h:358
int DSPL_API std(double *x, int n, double *s)
Calculates the standard deviation of the input vector x
Definition: statistic.c:556
int DSPL_API writetxt(double *x, double *y, int n, char *fn)
Save real data to the text file fn. .
Definition: inout.c:491
int DSPL_API random_init(random_t *prnd, int type, void *seed)
Pseudorandom numbers generators initialization.
Definition: randgen.c:121
int DSPL_API cmplx2re(complex_t *x, int n, double *re, double *im)
Separate complex vector to the real and image vectors.
Definition: complex.c:130
int DSPL_API conv_cmplx(complex_t *a, int na, complex_t *b, int nb, complex_t *c)
Complex vectors linear convolution.
Definition: conv.c:327
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: filter_an.c:980
int DSPL_API matrix_eig_cmplx(complex_t *a, int n, complex_t *v, int *info)
Eigenvalues calculation of the complex square matrix a.
Definition: matrix.c:144
int DSPL_API ones(double *x, int n)
Function fills all real vector x by ones values.
Definition: array.c:1334
int DSPL_API randb(double *x, int n, random_t *prnd)
Binary unipolar [0, 1] pseudorandom vector.
Definition: randgen.c:244
double complex_t[2]
Complex data type.
Definition: dspl.h:86
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: filter_ap.c:826
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...
Definition: filter_an.c:463
void dspl_free(void *handle)
Cleans up the previously linked DSPL-2.0 dynamic library.
int DSPL_API decimate(double *x, int n, int d, double *y, int *cnt)
Real vector decimation.
Definition: array.c:445
int DSPL_API find_max_abs(double *a, int n, double *m, int *ind)
Find maximum absolute value from the real vector a
Definition: statistic.c:123
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: filter_ap.c:1532
int DSPL_API matrix_eye(double *a, int n, int m)
The real identity matrix size n x m generation.
Definition: matrix.c:229
int DSPL_API verif(double *x, double *y, size_t n, double eps, double *err)
Real arrays verification.
Definition: verification.c:130
int DSPL_API sqrt_cmplx(complex_t *x, int n, complex_t *y)
Square root of the complex vector argguument x.
Definition: math.c:1307
int DSPL_API concat(void *a, size_t na, void *b, size_t nb, void *c)
Concatenate arrays a and b
Definition: array.c:315
int DSPL_API sin_cmplx(complex_t *x, int n, complex_t *y)
The sine function the complex vector argument x.
Definition: math.c:849
int DSPL_API sum(double *x, int n, double *s)
Definition: array.c:1361
int DSPL_API freqs(double *b, double *a, int ord, double *w, int n, complex_t *h)
Analog filter frequency response calculation.
Definition: filter_an.c:659
int DSPL_API array_scale_lin(double *x, int n, double xmin, double xmax, double dx, double h, double *y)
Vector x linear transformation.
Definition: array.c:171
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.
Definition: goertzel.c:263
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 ellip_asn(double *w, int n, double k, double *u)
Inverse Jacobi elliptic function of real vector argument.
Definition: ellipj.c:339
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: array.c:1041
int DSPL_API dft_cmplx(complex_t *x, int n, complex_t *y)
Discrete Fourier transform of a complex signal.
Definition: dft.c:329
int DSPL_API bessel_i0(double *x, int n, double *y)
Modified Bessel Function of the First Kind – [1].
Definition: math.c:386
complex_t * w
Definition: dspl.h:279
int DSPL_API mean_cmplx(complex_t *x, int n, complex_t *m)
Calculates the mean of the complex input vector x
Definition: statistic.c:407
int DSPL_API ellip_cd_cmplx(complex_t *u, int n, double k, complex_t *y)
Jacobi elliptic function of complex vector argument.
Definition: ellipj.c:701
int DSPL_API matrix_eye_cmplx(complex_t *a, int n, int m)
The complex identity matrix size n x m generation.
Definition: matrix.c:300
complex_t * w2048
Definition: dspl.h:290
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: math.c:271
int DSPL_API cos_cmplx(complex_t *x, int n, complex_t *y)
The cosine function the complex vector argument x.
Definition: math.c:585
int DSPL_API sinc(double *x, int n, double a, double *y)
Function for the real vector x.
Definition: math.c:936
int DSPL_API ellip_acd_cmplx(complex_t *w, int n, double k, complex_t *u)
Inverse Jacobi elliptic function of complex vector argument.
Definition: ellipj.c:211
int DSPL_API ellip_landen(double k, int n, double *y)
Function calculates complete elliptical integral coefficients .
Definition: ellipj.c:889
int DSPL_API gnuplot_open(void **hplot)
Open GNUPLOT program.
Definition: gnuplot.c:482
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: filter_fir.c:321
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: filter_ap.c:1298
int DSPL_API verif_cmplx(complex_t *x, complex_t *y, size_t n, double eps, double *err)
Complex arrays verification.
Definition: verification.c:347
int DSPL_API dft(double *x, int n, complex_t *y)
Discrete Fourier transform of a real signal.
Definition: dft.c:163
double mrg32k3a_seed
Definition: dspl.h:352
int DSPL_API gnuplot_create(int argc, char *argv[], int w, int h, char *fn_png, void **hplot)
Create GNUPLOT chart.
Definition: gnuplot.c:200
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: filter_ap.c:1031
int DSPL_API mean(double *x, int n, double *m)
Calculates the mean of the input vector x
Definition: statistic.c:309
int DSPL_API decimate_cmplx(complex_t *x, int n, int d, complex_t *y, int *cnt)
Complex vector decimation.
Definition: array.c:587
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: filter_an.c:166
int DSPL_API matrix_mul(double *a, int na, int ma, double *b, int nb, int mb, double *c)
Matrix multiplication.
Definition: matrix.c:486
int DSPL_API randb2(double *x, int n, random_t *prnd)
Binary bipolar [-1, 1] pseudorandom vector.
Definition: randgen.c:358