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 
158 #endif
159 #ifdef DOXYGEN_RUSSIAN
160 
225 #endif
226 typedef struct
227 {
231  int n;
232 } fft_t;
233 
234 
235 
236 #define RAND_TYPE_MRG32K3A 0x00000001
237 #define RAND_TYPE_MT19937 0x00000002
238 #define RAND_MT19937_NN 312
239 
240 #ifdef DOXYGEN_ENGLISH
241 
242 #endif
243 #ifdef DOXYGEN_RUSSIAN
244 
287 #endif
288 typedef struct
289 {
290 
292  double mrg32k3a_x[3];
293  double mrg32k3a_y[3];
294 
295  /* The array for the MT19937 state vector */
296  unsigned long long mt19937_mt[RAND_MT19937_NN];
298 
299  int type;
300 
301 }random_t;
302 
303 
304 
305 #ifdef DOXYGEN_ENGLISH
306 
331 #endif
332 #ifdef DOXYGEN_RUSSIAN
333 
358 #endif
359 #define RE(x) (x[0])
360 
361 
362 
363 #ifdef DOXYGEN_ENGLISH
364 
390 #endif
391 #ifdef DOXYGEN_RUSSIAN
392 
416 #endif
417 #define IM(x) (x[1])
418 
419 
420 
421 #define SQR(x) ((x) * (x))
422 
423 
424 #ifdef DOXYGEN_ENGLISH
425 
448 #endif
449 #ifdef DOXYGEN_RUSSIAN
450 
472 #endif
473 #define ABSSQR(x) ((SQR(RE(x))) + (SQR(IM(x))))
474 
475 
476 
477 
478 #define ABS(x) sqrt((ABSSQR(x)))
479 
480 
481 #define ARG(x) atan2(IM(x), RE(x))
482 
483 
484 #define CMRE(a,b) ((RE(a)) * (RE(b)) - (IM(a)) * (IM(b)))
485 
486 
487 #define CMIM(a,b) ((RE(a)) * (IM(b)) + (IM(a)) * (RE(b)))
488 
489 
490 #define CMCONJRE(a, b) ((RE(a)) * (RE(b)) + (IM(a)) * (IM(b)))
491 
492 
493 #define CMCONJIM(a, b) ((IM(a)) * (RE(b)) - (RE(a)) * (IM(b)))
494 
495 
496 
497 #define RES_OK 0
498 
499 /* Error codes */
500 /* A 0x01xxxxxx*/
501 #define ERROR_ARG_PARAM 0x01180716
502 /* B 0x02xxxxxx*/
503 /* C 0x03xxxxxx*/
504 /* D 0x04xxxxxx*/
505 #define ERROR_DAT_TYPE 0x04012020
506 #define ERROR_DIV_ZERO 0x04102226
507 /* E 0x05xxxxxx*/
508 #define ERROR_ELLIP_MODULE 0x05121315
509 /* F 0x06xxxxxx*/
510 #define ERROR_FFT_SIZE 0x06062021
511 #define ERROR_FILTER_A0 0x06090100
512 #define ERROR_FILTER_APPROX 0x06090116
513 #define ERROR_FILTER_FT 0x06090620
514 #define ERROR_FILTER_ORD 0x06091518
515 #define ERROR_FILTER_ORD_BP 0x06091519
516 #define ERROR_FILTER_RP 0x06091816
517 #define ERROR_FILTER_RS 0x06091819
518 #define ERROR_FILTER_TYPE 0x06092025
519 #define ERROR_FILTER_WP 0x06092316
520 #define ERROR_FILTER_WS 0x06092319
521 #define ERROR_FNAME 0x06140113
522 #define ERROR_FOPEN 0x06151605
523 #define ERROR_FREAD_SIZE 0x06180501
524 #define ERROR_FWRITE_SIZE 0x06231820
525 /* G 0x07xxxxxx*/
526 #define ERROR_GNUPLOT_CREATE 0x07161203
527 #define ERROR_GNUPLOT_FNPNG 0x07161206
528 #define ERROR_GNUPLOT_TERM 0x07161220
529 /* H 0x08xxxxxx*/
530 /* I 0x09xxxxxx*/
531 /* J 0x10xxxxxx*/
532 /* K 0x11xxxxxx*/
533 /* L 0x12xxxxxx*/
534 #define ERROR_LAPACK 0x12011601
535 /* M 0x13xxxxxx*/
536 #define ERROR_MALLOC 0x13011212
537 #define ERROR_MATRIX_SIZE 0x13011926
538 #define ERROR_MIN_MAX 0x13091413
539 /* N 0x14xxxxxx*/
540 #define ERROR_NEGATIVE 0x14050701
541 /* O 0x15xxxxxx*/
542 /* P 0x16xxxxxx*/
543 #define ERROR_POLY_AN 0x16150114
544 #define ERROR_POLY_ORD 0x16151518
545 #define ERROR_PTR 0x16201800
546 /* Q 0x17xxxxxx*/
547 /* R 0x18xxxxxx*/
548 #define ERROR_RAND_SIGMA 0x18011909
549 #define ERROR_RAND_TYPE 0x18012009
550 #define ERROR_RESAMPLE_RATIO 0x18051801
551 #define ERROR_RESAMPLE_FRAC_DELAY 0x18050604
552 /* S 0x19xxxxxx*/
553 #define ERROR_SIZE 0x19092605
554 #define ERROR_SYM_TYPE 0x19251320
555 /* T 0x20xxxxxx*/
556 /* U 0x21xxxxxx*/
557 #define ERROR_UNWRAP 0x21142318
558 /* V 0x22xxxxxx*/
559 /* W 0x23xxxxxx*/
560 #define ERROR_WIN_PARAM 0x23091601
561 #define ERROR_WIN_SYM 0x23091925
562 #define ERROR_WIN_TYPE 0x23092025
563 /* X 0x24xxxxxx*/
564 #define ERROR_XCORR_FLAG 0x24031518
565 /* Y 0x25xxxxxx*/
566 /* Z 0x26xxxxxx*/
567 
568 #define DAT_MASK 0x00000001
569 #define DAT_DOUBLE 0x00000000
570 #define DAT_COMPLEX 0x00000001
571 
572 #define DSPL_MATRIX_BLOCK 32
573 
574 
575 #define DSPL_SYMMETRIC 0x00000000
576 #define DSPL_PERIODIC 0x00000001
577 
578 #define DSPL_FLAG_DIGITAL 0x00000000
579 #define DSPL_FLAG_ANALOG 0x00000001
580 #define DSPL_FLAG_LOGMAG 0x00000002
581 #define DSPL_FLAG_UNWRAP 0x00000004
582 #define DSPL_FLAG_FFT_SHIFT 0x00000008
583 
584 
585 
586 #define DSPL_WIN_SYM_MASK 0x00000001
587 #define DSPL_WIN_MASK 0x00FFFFFE
588 
589 #define DSPL_WIN_SYMMETRIC DSPL_SYMMETRIC
590 #define DSPL_WIN_PERIODIC DSPL_PERIODIC
591 
592 
593 #define DSPL_WIN_BARTLETT 0x00000004
594 #define DSPL_WIN_BARTLETT_HANN 0x00000008
595 #define DSPL_WIN_BLACKMAN 0x00000010
596 #define DSPL_WIN_BLACKMAN_HARRIS 0x00000040
597 #define DSPL_WIN_BLACKMAN_NUTTALL 0x00000080
598 #define DSPL_WIN_FLAT_TOP 0x00000100
599 #define DSPL_WIN_GAUSSIAN 0x00000400
600 #define DSPL_WIN_HAMMING 0x00000800
601 #define DSPL_WIN_HANN 0x00001000
602 #define DSPL_WIN_LANCZOS 0x00004000
603 #define DSPL_WIN_NUTTALL 0x00008000
604 #define DSPL_WIN_RECT 0x00010000
605 #define DSPL_WIN_COS 0x00040000
606 #define DSPL_WIN_CHEBY 0x00080000
607 #define DSPL_WIN_KAISER 0x00100000
608 
609 
610 #define DSPL_FILTER_TYPE_MASK 0x000000FF
611 #define DSPL_FILTER_LPF 0x00000001
612 #define DSPL_FILTER_HPF 0x00000002
613 #define DSPL_FILTER_BPASS 0x00000004
614 #define DSPL_FILTER_BSTOP 0x00000008
615 
616 #define DSPL_FILTER_APPROX_MASK 0x0000FF00
617 #define DSPL_FILTER_BUTTER 0x00000100
618 #define DSPL_FILTER_CHEBY1 0x00000200
619 #define DSPL_FILTER_CHEBY2 0x00000400
620 #define DSPL_FILTER_ELLIP 0x00000800
621 
622 
623 #define DSPL_XCORR_NOSCALE 0x00000000
624 #define DSPL_XCORR_BIASED 0x00000001
625 #define DSPL_XCORR_UNBIASED 0x00000002
626 
627 
628 
629 #define ELLIP_ITER 16
630 #define ELLIP_MAX_ORD 24
631 
632 #define DSPL_VERIF_FAILED 1
633 #define DSPL_VERIF_SUCCESS 0
634 
635 #define PLOT_HOLD 0x00000001
636 
637 
638 #ifdef __cplusplus
639  extern "C" {
640 #endif
641 
642 
643 
644 #ifdef BUILD_LIB
645  /* Declare DSPL_API for Windows OS */
646  #ifdef WIN_OS
647  #define DSPL_API __declspec(dllexport)
648  #endif /* WIN_OS */
649  /* Declare DSPL_API for LINUX OS */
650  #ifdef LINUX_OS
651  #define DSPL_API
652  #endif /* LINUX_OS */
653 #endif /* BUILD_DLL */
654 
655 #define COMMA ,
656 
657 
658 #ifdef BUILD_LIB
659  #define DECLARE_FUNC(type, fn, param)\
660  type DSPL_API fn(param);
661 #endif
662 
663 #ifndef BUILD_LIB
664  #define DECLARE_FUNC( type, fn, param)\
665  typedef type (*p_##fn)(param);\
666  extern p_##fn fn;
667 
668 #endif
669 
670 
671 
672 /*----------------------------------------------------------------------------*/
673 DECLARE_FUNC(int, acos_cmplx, complex_t*
674  COMMA int
675  COMMA complex_t*);
676 /*----------------------------------------------------------------------------*/
677 DECLARE_FUNC(int, addlog, char* str
678  COMMA char* fn);
679 /*----------------------------------------------------------------------------*/
680 DECLARE_FUNC(int, array_scale_lin, double* x
681  COMMA int n
682  COMMA double xmin
683  COMMA double xmax
684  COMMA double dx
685  COMMA double h
686  COMMA double* y);
687 /*----------------------------------------------------------------------------*/
688 DECLARE_FUNC(int, asin_cmplx, complex_t*
689  COMMA int
690  COMMA complex_t*);
691 /*----------------------------------------------------------------------------*/
692 DECLARE_FUNC(int, bessel_i0, double* x
693  COMMA int n
694  COMMA double* y);
695 /*----------------------------------------------------------------------------*/
696 DECLARE_FUNC(int, bilinear, double* bs
697  COMMA double* as
698  COMMA int ord
699  COMMA double* bz
700  COMMA double* az);
701 /*----------------------------------------------------------------------------*/
702 DECLARE_FUNC(int, butter_ap, double
703  COMMA int
704  COMMA double*
705  COMMA double*);
706 /*----------------------------------------------------------------------------*/
707 DECLARE_FUNC(int, butter_ap_zp, int
708  COMMA double
709  COMMA complex_t*
710  COMMA int*
711  COMMA complex_t*
712  COMMA int*);
713 /*----------------------------------------------------------------------------*/
714 DECLARE_FUNC(int, cheby_poly1, double*
715  COMMA int
716  COMMA int
717  COMMA double*);
718 /*----------------------------------------------------------------------------*/
719 DECLARE_FUNC(int, cheby_poly2, double*
720  COMMA int
721  COMMA int
722  COMMA double*);
723 /*----------------------------------------------------------------------------*/
724 DECLARE_FUNC(int, cheby1_ap, double
725  COMMA int
726  COMMA double*
727  COMMA double*);
728 /*----------------------------------------------------------------------------*/
729 DECLARE_FUNC(int, cheby1_ap_zp, int
730  COMMA double
731  COMMA complex_t*
732  COMMA int*
733  COMMA complex_t*
734  COMMA int*);
735 /*----------------------------------------------------------------------------*/
736 DECLARE_FUNC(int, cheby2_ap, double rs
737  COMMA int ord
738  COMMA double* b
739  COMMA double* a);
740 /*----------------------------------------------------------------------------*/
741 DECLARE_FUNC(int, cheby2_ap_wp1, double rp
742  COMMA double rs
743  COMMA int ord
744  COMMA double* b
745  COMMA double* a);
746 /*----------------------------------------------------------------------------*/
747 DECLARE_FUNC(int, cheby2_ap_zp, int
748  COMMA double
749  COMMA complex_t*
750  COMMA int*
751  COMMA complex_t*
752  COMMA int*);
753 /*----------------------------------------------------------------------------*/
754 DECLARE_FUNC(int, cmplx2re, complex_t*
755  COMMA int
756  COMMA double*
757  COMMA double*);
758 /*----------------------------------------------------------------------------*/
759 DECLARE_FUNC(int, concat, void*
760  COMMA size_t
761  COMMA void*
762  COMMA size_t
763  COMMA void*);
764 /*----------------------------------------------------------------------------*/
765 DECLARE_FUNC(int, conv, double*
766  COMMA int
767  COMMA double*
768  COMMA int
769  COMMA double*);
770 /*----------------------------------------------------------------------------*/
771 DECLARE_FUNC(int, conv_cmplx, complex_t*
772  COMMA int
773  COMMA complex_t*
774  COMMA int
775  COMMA complex_t*);
776 /*----------------------------------------------------------------------------*/
777 DECLARE_FUNC(int, conv_fft, double* a
778  COMMA int na
779  COMMA double* b
780  COMMA int nb
781  COMMA fft_t* pfft
782  COMMA int nfft
783  COMMA double* c);
784 /*----------------------------------------------------------------------------*/
785 DECLARE_FUNC(int, conv_fft_cmplx, complex_t* a
786  COMMA int na
787  COMMA complex_t* b
788  COMMA int nb
789  COMMA fft_t* pfft
790  COMMA int nfft
791  COMMA complex_t* c);
792 /*----------------------------------------------------------------------------*/
793 DECLARE_FUNC(int, cos_cmplx, complex_t*
794  COMMA int
795  COMMA complex_t*);
796 /*----------------------------------------------------------------------------*/
797 DECLARE_FUNC(int, decimate, double* x
798  COMMA int n
799  COMMA int d
800  COMMA double* y
801  COMMA int* cnt);
802 /*----------------------------------------------------------------------------*/
803 DECLARE_FUNC(int, decimate_cmplx, complex_t* x
804  COMMA int n
805  COMMA int d
806  COMMA complex_t* y
807  COMMA int* cnt);
808 /*----------------------------------------------------------------------------*/
809 DECLARE_FUNC(int, dft, double*
810  COMMA int
811  COMMA complex_t*);
812 /*----------------------------------------------------------------------------*/
813 DECLARE_FUNC(int, dft_cmplx, complex_t*
814  COMMA int
815  COMMA complex_t*);
816 /*----------------------------------------------------------------------------*/
817 DECLARE_FUNC(double, dmod, double
818  COMMA double);
819 /*----------------------------------------------------------------------------*/
820 DECLARE_FUNC(void, dspl_info, void);
821 /*----------------------------------------------------------------------------*/
822 DECLARE_FUNC(int, ellip_acd, double* w
823  COMMA int n
824  COMMA double k
825  COMMA double* u);
826 /*----------------------------------------------------------------------------*/
827 DECLARE_FUNC(int, ellip_acd_cmplx, complex_t* w
828  COMMA int n
829  COMMA double k
830  COMMA complex_t* u);
831 /*----------------------------------------------------------------------------*/
832 DECLARE_FUNC(int, ellip_ap, double rp
833  COMMA double rs
834  COMMA int ord
835  COMMA double* b
836  COMMA double* a);
837 /*----------------------------------------------------------------------------*/
838 DECLARE_FUNC(int, ellip_ap_zp, int ord
839  COMMA double rp
840  COMMA double rs
841  COMMA complex_t* z
842  COMMA int* nz
843  COMMA complex_t* p
844  COMMA int* np);
845 /*----------------------------------------------------------------------------*/
846 DECLARE_FUNC(int, ellip_asn, double* w
847  COMMA int n
848  COMMA double k
849  COMMA double* u);
850 /*----------------------------------------------------------------------------*/
851 DECLARE_FUNC(int, ellip_asn_cmplx, complex_t* w
852  COMMA int n
853  COMMA double k
854  COMMA complex_t* u);
855 /*----------------------------------------------------------------------------*/
856 DECLARE_FUNC(int, ellip_cd, double* u
857  COMMA int n
858  COMMA double k
859  COMMA double* y);
860 /*----------------------------------------------------------------------------*/
861 DECLARE_FUNC(int, ellip_cd_cmplx, complex_t* u
862  COMMA int n
863  COMMA double k
864  COMMA complex_t* y);
865 /*----------------------------------------------------------------------------*/
866 DECLARE_FUNC(int, ellip_landen, double k
867  COMMA int n
868  COMMA double* y);
869 /*----------------------------------------------------------------------------*/
870 DECLARE_FUNC(int, ellip_modulareq, double rp
871  COMMA double rs
872  COMMA int ord
873  COMMA double* k);
874 /*----------------------------------------------------------------------------*/
875 DECLARE_FUNC(int, ellip_rat, double* w
876  COMMA int n
877  COMMA int ord
878  COMMA double k
879  COMMA double* u);
880 /*----------------------------------------------------------------------------*/
881 DECLARE_FUNC(int, ellip_sn, double* u
882  COMMA int n
883  COMMA double k
884  COMMA double* y);
885 /*----------------------------------------------------------------------------*/
886 DECLARE_FUNC(int, ellip_sn_cmplx, complex_t* u
887  COMMA int n
888  COMMA double k
889  COMMA complex_t* y);
890 /*----------------------------------------------------------------------------*/
891 DECLARE_FUNC(int, farrow_lagrange, double*
892  COMMA int
893  COMMA double
894  COMMA double
895  COMMA double
896  COMMA double**
897  COMMA int*);
898 /*----------------------------------------------------------------------------*/
899 DECLARE_FUNC(int, farrow_spline, double*
900  COMMA int
901  COMMA double
902  COMMA double
903  COMMA double
904  COMMA double**
905  COMMA int*);
906 /*----------------------------------------------------------------------------*/
907 DECLARE_FUNC(int, fft, double*
908  COMMA int
909  COMMA fft_t*
910  COMMA complex_t* );
911 /*----------------------------------------------------------------------------*/
912 DECLARE_FUNC(int, fft_cmplx, complex_t*
913  COMMA int
914  COMMA fft_t*
915  COMMA complex_t* );
916 /*----------------------------------------------------------------------------*/
917 DECLARE_FUNC(int, fft_create, fft_t*
918  COMMA int);
919 /*----------------------------------------------------------------------------*/
920 DECLARE_FUNC(void, fft_free, fft_t*);
921 /*----------------------------------------------------------------------------*/
922 DECLARE_FUNC(int, fft_mag, double* x
923  COMMA int n
924  COMMA fft_t* pfft
925  COMMA double fs
926  COMMA int flag
927  COMMA double* mag
928  COMMA double* freq);
929 /*----------------------------------------------------------------------------*/
930 DECLARE_FUNC(int, fft_mag_cmplx, complex_t* x
931  COMMA int n
932  COMMA fft_t* pfft
933  COMMA double fs
934  COMMA int flag
935  COMMA double* mag
936  COMMA double* freq);
937 /*----------------------------------------------------------------------------*/
938 DECLARE_FUNC(int, fft_shift, double*
939  COMMA int n
940  COMMA double*);
941 /*----------------------------------------------------------------------------*/
942 DECLARE_FUNC(int, fft_shift_cmplx, complex_t*
943  COMMA int
944  COMMA complex_t*);
945 /*----------------------------------------------------------------------------*/
946 DECLARE_FUNC(int, filter_freq_resp, double* b
947  COMMA double* a
948  COMMA int ord
949  COMMA double* w
950  COMMA int n
951  COMMA int flag
952  COMMA double* mag
953  COMMA double* phi
954  COMMA double* tau);
955 /*----------------------------------------------------------------------------*/
956 DECLARE_FUNC(int, filter_iir, double*
957  COMMA double*
958  COMMA int
959  COMMA double*
960  COMMA int
961  COMMA double*);
962 /*----------------------------------------------------------------------------*/
963 DECLARE_FUNC(double, filter_ws1, int ord
964  COMMA double rp
965  COMMA double rs
966  COMMA int type);
967 /*----------------------------------------------------------------------------*/
968 DECLARE_FUNC(int, filter_zp2ab, complex_t*
969  COMMA int
970  COMMA complex_t*
971  COMMA int
972  COMMA int
973  COMMA double*
974  COMMA double*);
975 /*----------------------------------------------------------------------------*/
976 DECLARE_FUNC(int, find_max_abs, double* a
977  COMMA int n
978  COMMA double* m
979  COMMA int* ind);
980 /*----------------------------------------------------------------------------*/
981 DECLARE_FUNC(int, fir_linphase, int ord
982  COMMA double w0
983  COMMA double w1
984  COMMA int filter_type
985  COMMA int wintype
986  COMMA double winparam
987  COMMA double* h);
988 /*----------------------------------------------------------------------------*/
989 DECLARE_FUNC(int, flipip, double*
990  COMMA int);
991 /*----------------------------------------------------------------------------*/
992 DECLARE_FUNC(int, flipip_cmplx, complex_t*
993  COMMA int);
994 /*----------------------------------------------------------------------------*/
995 DECLARE_FUNC(int, fourier_integral_cmplx, double* t
996  COMMA complex_t* s
997  COMMA int nt
998  COMMA int nw
999  COMMA double* w
1000  COMMA complex_t* y);
1001 /*----------------------------------------------------------------------------*/
1002 DECLARE_FUNC(int, fourier_series_dec, double*
1003  COMMA double*
1004  COMMA int
1005  COMMA double
1006  COMMA int
1007  COMMA double*
1008  COMMA complex_t*);
1009 /*----------------------------------------------------------------------------*/
1010 DECLARE_FUNC(int, fourier_series_dec_cmplx, double* t
1011  COMMA complex_t* s
1012  COMMA int nt
1013  COMMA double period
1014  COMMA int nw
1015  COMMA double* w
1016  COMMA complex_t* y);
1017 /*----------------------------------------------------------------------------*/
1018 DECLARE_FUNC(int, fourier_series_rec, double*
1019  COMMA complex_t*
1020  COMMA int
1021  COMMA double*
1022  COMMA int
1023  COMMA complex_t*);
1024 /*----------------------------------------------------------------------------*/
1025 DECLARE_FUNC(int, freqs, double*
1026  COMMA double*
1027  COMMA int
1028  COMMA double*
1029  COMMA int
1030  COMMA complex_t*);
1031 /*----------------------------------------------------------------------------*/
1032 DECLARE_FUNC(int, freqs_cmplx, double* b
1033  COMMA double* a
1034  COMMA int ord
1035  COMMA complex_t* s
1036  COMMA int n
1037  COMMA complex_t* h);
1038 /*----------------------------------------------------------------------------*/
1039 DECLARE_FUNC(int, freqs2time, double*
1040  COMMA double*
1041  COMMA int
1042  COMMA double
1043  COMMA int
1044  COMMA fft_t*
1045  COMMA double*
1046  COMMA double*);
1047 /*----------------------------------------------------------------------------*/
1048 DECLARE_FUNC(int, freqz, double*
1049  COMMA double*
1050  COMMA int
1051  COMMA double*
1052  COMMA int
1053  COMMA complex_t*);
1054 /*----------------------------------------------------------------------------*/
1055 DECLARE_FUNC(void, gnuplot_close, void* h);
1056 /*----------------------------------------------------------------------------*/
1057 DECLARE_FUNC(void, gnuplot_cmd, void* h
1058  COMMA char* cmd);
1059 /*----------------------------------------------------------------------------*/
1060 DECLARE_FUNC(int, gnuplot_create, int argc
1061  COMMA char* argv[]
1062  COMMA int w
1063  COMMA int h
1064  COMMA char* fn_png
1065  COMMA void** hplot);
1066 /*----------------------------------------------------------------------------*/
1067 DECLARE_FUNC(int, gnuplot_open, void** hplot);
1068 /*----------------------------------------------------------------------------*/
1069 DECLARE_FUNC(int, goertzel, double*
1070  COMMA int
1071  COMMA int*
1072  COMMA int
1073  COMMA complex_t*);
1074 /*----------------------------------------------------------------------------*/
1075 DECLARE_FUNC(int, goertzel_cmplx, complex_t*
1076  COMMA int
1077  COMMA int*
1078  COMMA int
1079  COMMA complex_t*);
1080 /*----------------------------------------------------------------------------*/
1081 DECLARE_FUNC(int, group_delay, double* b
1082  COMMA double* a
1083  COMMA int ord
1084  COMMA int flag
1085  COMMA double* w
1086  COMMA int n
1087  COMMA double* tau);
1088 /*----------------------------------------------------------------------------*/
1089 DECLARE_FUNC(int, histogram, double* x
1090  COMMA int n
1091  COMMA int nh
1092  COMMA double* pedges
1093  COMMA double* ph);
1094 /*----------------------------------------------------------------------------*/
1095 DECLARE_FUNC(int, histogram_norm, double* y
1096  COMMA int n
1097  COMMA int nh
1098  COMMA double* x
1099  COMMA double* w);
1100 /*----------------------------------------------------------------------------*/
1101 DECLARE_FUNC(int, idft_cmplx, complex_t*
1102  COMMA int
1103  COMMA complex_t*);
1104 /*----------------------------------------------------------------------------*/
1105 DECLARE_FUNC(int, ifft_cmplx, complex_t*
1106  COMMA int
1107  COMMA fft_t*
1108  COMMA complex_t* );
1109 /*----------------------------------------------------------------------------*/
1110 DECLARE_FUNC(int, iir, double rp
1111  COMMA double rs
1112  COMMA int ord
1113  COMMA double w0
1114  COMMA double w1
1115  COMMA int type
1116  COMMA double* b
1117  COMMA double* a);
1118 /*----------------------------------------------------------------------------*/
1119 DECLARE_FUNC(int, linspace, double
1120  COMMA double
1121  COMMA int
1122  COMMA int
1123  COMMA double*);
1124 /*----------------------------------------------------------------------------*/
1125 DECLARE_FUNC(int, log_cmplx, complex_t*
1126  COMMA int
1127  COMMA complex_t*);
1128 /*----------------------------------------------------------------------------*/
1129 DECLARE_FUNC(int, logspace, double
1130  COMMA double
1131  COMMA int
1132  COMMA int
1133  COMMA double*);
1134 /*----------------------------------------------------------------------------*/
1135 DECLARE_FUNC(int, low2bp, double* b
1136  COMMA double* a
1137  COMMA int ord
1138  COMMA double w0
1139  COMMA double wpl
1140  COMMA double wph
1141  COMMA double* beta
1142  COMMA double* alpha);
1143 /*----------------------------------------------------------------------------*/
1144 DECLARE_FUNC(int, low2bs, double* b
1145  COMMA double* a
1146  COMMA int ord
1147  COMMA double w0
1148  COMMA double wsl
1149  COMMA double wsh
1150  COMMA double* beta
1151  COMMA double* alpha);
1152 /*----------------------------------------------------------------------------*/
1153 DECLARE_FUNC(int, low2high, double* b
1154  COMMA double* a
1155  COMMA int ord
1156  COMMA double w0
1157  COMMA double w1
1158  COMMA double* beta
1159  COMMA double* alpha);
1160 /*----------------------------------------------------------------------------*/
1161 DECLARE_FUNC(int, low2low, double* b
1162  COMMA double* a
1163  COMMA int ord
1164  COMMA double w0
1165  COMMA double w1
1166  COMMA double* beta
1167  COMMA double* alpha);
1168 /*----------------------------------------------------------------------------*/
1169 DECLARE_FUNC(int, matrix_eig_cmplx, complex_t* a
1170  COMMA int n
1171  COMMA complex_t* v
1172  COMMA int* info);
1173 /*----------------------------------------------------------------------------*/
1174 DECLARE_FUNC(int, matrix_eye, double* a
1175  COMMA int n
1176  COMMA int m);
1177 /*----------------------------------------------------------------------------*/
1178 DECLARE_FUNC(int, matrix_eye_cmplx, complex_t* a
1179  COMMA int n
1180  COMMA int m);
1181 /*----------------------------------------------------------------------------*/
1182 DECLARE_FUNC(int, matrix_mul, double* a
1183  COMMA int na
1184  COMMA int ma
1185  COMMA double* b
1186  COMMA int nb
1187  COMMA int mb
1188  COMMA double* c);
1189 /*----------------------------------------------------------------------------*/
1190 DECLARE_FUNC(int, matrix_print, double* a
1191  COMMA int n
1192  COMMA int m
1193  COMMA const char* name
1194  COMMA const char* format);
1195 /*----------------------------------------------------------------------------*/
1196 DECLARE_FUNC(int, matrix_print_cmplx, complex_t* a
1197  COMMA int n
1198  COMMA int m
1199  COMMA const char* name
1200  COMMA const char* format);
1201 /*----------------------------------------------------------------------------*/
1202 DECLARE_FUNC(int, matrix_transpose, double* a
1203  COMMA int n
1204  COMMA int m
1205  COMMA double* b);
1206 /*----------------------------------------------------------------------------*/
1207 DECLARE_FUNC(int, matrix_transpose_cmplx, complex_t* a
1208  COMMA int n
1209  COMMA int m
1210  COMMA complex_t* b);
1211 /*----------------------------------------------------------------------------*/
1212 DECLARE_FUNC(int, matrix_transpose_hermite, complex_t* a
1213  COMMA int n
1214  COMMA int m
1215  COMMA complex_t* b);
1216 /*----------------------------------------------------------------------------*/
1217 DECLARE_FUNC(int, minmax, double* x
1218  COMMA int n
1219  COMMA double* xmin
1220  COMMA double* xmax);
1221 /*----------------------------------------------------------------------------*/
1222 DECLARE_FUNC(int, ones, double* x
1223  COMMA int n);
1224 /*----------------------------------------------------------------------------*/
1225 DECLARE_FUNC(int, phase_delay, double* b
1226  COMMA double* a
1227  COMMA int ord
1228  COMMA int flag
1229  COMMA double* w
1230  COMMA int n
1231  COMMA double* tau);
1232 /*----------------------------------------------------------------------------*/
1233 DECLARE_FUNC(int, poly_z2a_cmplx, complex_t*
1234  COMMA int
1235  COMMA int
1236  COMMA complex_t*);
1237 /*----------------------------------------------------------------------------*/
1238 DECLARE_FUNC(int, polyroots, double* a
1239  COMMA int ord
1240  COMMA complex_t* r
1241  COMMA int* info);
1242 /*----------------------------------------------------------------------------*/
1243 DECLARE_FUNC(int, polyval, double*
1244  COMMA int
1245  COMMA double*
1246  COMMA int
1247  COMMA double*);
1248 /*----------------------------------------------------------------------------*/
1249 DECLARE_FUNC(int, polyval_cmplx, complex_t*
1250  COMMA int
1251  COMMA complex_t*
1252  COMMA int
1253  COMMA complex_t*);
1254 /*----------------------------------------------------------------------------*/
1255 DECLARE_FUNC(int, randb, double* x
1256  COMMA int n
1257  COMMA random_t* prnd);
1258 /*----------------------------------------------------------------------------*/
1259 DECLARE_FUNC(int, randb2, double* x
1260  COMMA int n
1261  COMMA random_t* prnd);
1262 /*----------------------------------------------------------------------------*/
1263 DECLARE_FUNC(int, randi, int* x
1264  COMMA int n
1265  COMMA int start
1266  COMMA int stop
1267  COMMA random_t* prnd);
1268 /*----------------------------------------------------------------------------*/
1269 DECLARE_FUNC(int, randn, double*
1270  COMMA int
1271  COMMA double
1272  COMMA double
1273  COMMA random_t* prnd);
1274 /*----------------------------------------------------------------------------*/
1275 DECLARE_FUNC(int, random_init, random_t* prnd
1276  COMMA int type
1277  COMMA void* seed);
1278 /*----------------------------------------------------------------------------*/
1279 DECLARE_FUNC(int, randu, double*
1280  COMMA int
1281  COMMA random_t* prnd);
1282 /*----------------------------------------------------------------------------*/
1283 DECLARE_FUNC(int, ratcompos, double* b
1284  COMMA double* a
1285  COMMA int n
1286  COMMA double* c
1287  COMMA double* d
1288  COMMA int p
1289  COMMA double* beta
1290  COMMA double* alpha);
1291 /*----------------------------------------------------------------------------*/
1292 DECLARE_FUNC(int, re2cmplx, double*
1293  COMMA int
1294  COMMA complex_t*);
1295 /*----------------------------------------------------------------------------*/
1296 DECLARE_FUNC(int, readbin, char* fn
1297  COMMA void** x
1298  COMMA int* k
1299  COMMA int* dtype);
1300 /*----------------------------------------------------------------------------*/
1301 DECLARE_FUNC(int, signal_pimp, double*
1302  COMMA size_t
1303  COMMA double
1304  COMMA double
1305  COMMA double
1306  COMMA double
1307  COMMA double*);
1308 /*----------------------------------------------------------------------------*/
1309 DECLARE_FUNC(int, signal_saw, double* t
1310  COMMA size_t n
1311  COMMA double amp
1312  COMMA double dt
1313  COMMA double period
1314  COMMA double* y);
1315 /*----------------------------------------------------------------------------*/
1316 DECLARE_FUNC(int, sin_cmplx, complex_t*
1317  COMMA int
1318  COMMA complex_t*);
1319 /*----------------------------------------------------------------------------*/
1320 DECLARE_FUNC(int, sinc, double* x
1321  COMMA int n
1322  COMMA double a
1323  COMMA double* y);
1324 /*----------------------------------------------------------------------------*/
1325 DECLARE_FUNC(int, sine_int, double* x
1326  COMMA int n
1327  COMMA double* si);
1328 /*----------------------------------------------------------------------------*/
1329 DECLARE_FUNC(int, sqrt_cmplx, complex_t*
1330  COMMA int
1331  COMMA complex_t*);
1332 /*----------------------------------------------------------------------------*/
1333 DECLARE_FUNC(int, trapint, double*
1334  COMMA double*
1335  COMMA int
1336  COMMA double*);
1337 /*----------------------------------------------------------------------------*/
1338 DECLARE_FUNC(int, trapint_cmplx, double*
1339  COMMA complex_t*
1340  COMMA int
1341  COMMA complex_t*);
1342 /*----------------------------------------------------------------------------*/
1343 DECLARE_FUNC(int, unwrap, double*
1344  COMMA int
1345  COMMA double
1346  COMMA double);
1347 /*----------------------------------------------------------------------------*/
1348 DECLARE_FUNC(int, vector_dot, double* x
1349  COMMA double* y
1350  COMMA int n
1351  COMMA double* p);
1352 /*----------------------------------------------------------------------------*/
1353 DECLARE_FUNC(int, verif, double* x
1354  COMMA double* y
1355  COMMA size_t n
1356  COMMA double eps
1357  COMMA double* err);
1358 /*----------------------------------------------------------------------------*/
1359 DECLARE_FUNC(int, verif_cmplx, complex_t* x
1360  COMMA complex_t* y
1361  COMMA size_t n
1362  COMMA double eps
1363  COMMA double* err);
1364 /*----------------------------------------------------------------------------*/
1365 DECLARE_FUNC(int, window, double* w
1366  COMMA int n
1367  COMMA int win_type
1368  COMMA double param);
1369 /*----------------------------------------------------------------------------*/
1370 DECLARE_FUNC(int, writebin, void*
1371  COMMA int
1372  COMMA int
1373  COMMA char*);
1374 /*----------------------------------------------------------------------------*/
1375 DECLARE_FUNC(int, writetxt, double*
1376  COMMA double*
1377  COMMA int
1378  COMMA char*);
1379 /*----------------------------------------------------------------------------*/
1380 DECLARE_FUNC(int, writetxt_3d, double* x
1381  COMMA int nx
1382  COMMA double* y
1383  COMMA int ny
1384  COMMA double* z
1385  COMMA char* fn);
1386 /*----------------------------------------------------------------------------*/
1387 DECLARE_FUNC(int, writetxt_3dline, double* x
1388  COMMA double* y
1389  COMMA double* z
1390  COMMA int n
1391  COMMA char* fn);
1392 /*----------------------------------------------------------------------------*/
1393 DECLARE_FUNC(int, writetxt_cmplx, complex_t* x
1394  COMMA int n
1395  COMMA char* fn);
1396 /*----------------------------------------------------------------------------*/
1397 DECLARE_FUNC(int, writetxt_cmplx_im, double*
1398  COMMA complex_t*
1399  COMMA int
1400  COMMA char*);
1401 /*----------------------------------------------------------------------------*/
1402 DECLARE_FUNC(int, writetxt_cmplx_re, double*
1403  COMMA complex_t*
1404  COMMA int
1405  COMMA char*);
1406 /*----------------------------------------------------------------------------*/
1407 DECLARE_FUNC(int, writetxt_int, int*
1408  COMMA int*
1409  COMMA int
1410  COMMA char*);
1411 /*----------------------------------------------------------------------------*/
1412 DECLARE_FUNC(int, xcorr, double* x
1413  COMMA int nx
1414  COMMA double* y
1415  COMMA int ny
1416  COMMA int flag
1417  COMMA int nr
1418  COMMA double* r
1419  COMMA double* t);
1420 /*----------------------------------------------------------------------------*/
1421 DECLARE_FUNC(int, xcorr_cmplx, complex_t* x
1422  COMMA int nx
1423  COMMA complex_t* y
1424  COMMA int ny
1425  COMMA int flag
1426  COMMA int nr
1427  COMMA complex_t* r
1428  COMMA double* t);
1429 /*----------------------------------------------------------------------------*/
1430 
1431 
1432 #ifdef __cplusplus
1433  }
1434 #endif
1435 
1436 
1437 void* dspl_load();
1438 void dspl_free(void* handle);
1439 
1440 
1441 
1442 #endif /* DSPL_H */
1443 
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 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:1786
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:601
int DSPL_API flipip_cmplx(complex_t *x, int n)
Flip complex vector x in place.
Definition: array.c:842
int DSPL_API ellip_cd(double *u, int n, double k, double *y)
Jacobi elliptic function of real vector argument.
Definition: ellipj.c:577
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:402
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:230
Definition: dspl.h:289
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:719
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:637
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:229
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 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:1098
int n
Definition: dspl.h:231
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:774
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:527
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:178
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:1192
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:891
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:299
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:1179
int DSPL_API ellip_sn(double *u, int n, double k, double *y)
Jacobi elliptic function of real vector argument.
Definition: ellipj.c:1074
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:227
void DSPL_API gnuplot_cmd(void *h, char *cmd)
Function sends cmd command to GNUPLOT corresponds to h handle.
Definition: gnuplot.c:390
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:355
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:853
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:175
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:297
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 ones(double *x, int n)
Function fills all real vector x by ones values.
Definition: array.c:1302
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:832
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
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:1538
int DSPL_API verif(double *x, double *y, size_t n, double eps, double *err)
Real arrays verification.
Definition: array.c:1417
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 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:445
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:1009
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:228
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:684
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:872
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:1304
int DSPL_API verif_cmplx(complex_t *x, complex_t *y, size_t n, double eps, double *err)
Complex arrays verification.
Definition: array.c:1564
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:291
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:1037
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 randb2(double *x, int n, random_t *prnd)
Binary bipolar [-1, 1] pseudorandom vector.
Definition: randgen.c:358