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_FS 0x06190000
525 #define ERROR_FWRITE_SIZE 0x06231820
526 /* G 0x07xxxxxx*/
527 #define ERROR_GNUPLOT_CREATE 0x07161203
528 #define ERROR_GNUPLOT_FNPNG 0x07161206
529 #define ERROR_GNUPLOT_TERM 0x07161220
530 /* H 0x08xxxxxx*/
531 /* I 0x09xxxxxx*/
532 #define ERROR_INF 0x09140600
533 /* J 0x10xxxxxx*/
534 /* K 0x11xxxxxx*/
535 /* L 0x12xxxxxx*/
536 #define ERROR_LAPACK 0x12011601
537 /* M 0x13xxxxxx*/
538 #define ERROR_MALLOC 0x13011212
539 #define ERROR_MATRIX_SIZE 0x13011926
540 #define ERROR_MIN_MAX 0x13091413
541 /* N 0x14xxxxxx*/
542 #define ERROR_NAN 0x14011400
543 #define ERROR_NEGATIVE 0x14050701
544 /* O 0x15xxxxxx*/
545 #define ERROR_OVERLAP 0x15220412
546 /* P 0x16xxxxxx*/
547 #define ERROR_POLY_AN 0x16150114
548 #define ERROR_POLY_ORD 0x16151518
549 #define ERROR_PTR 0x16201800
550 /* Q 0x17xxxxxx*/
551 /* R 0x18xxxxxx*/
552 #define ERROR_RAND_SIGMA 0x18011909
553 #define ERROR_RAND_TYPE 0x18012009
554 #define ERROR_RESAMPLE_RATIO 0x18051801
555 #define ERROR_RESAMPLE_FRAC_DELAY 0x18050604
556 /* S 0x19xxxxxx*/
557 #define ERROR_SIZE 0x19092605
558 #define ERROR_SYM_TYPE 0x19251320
559 /* T 0x20xxxxxx*/
560 /* U 0x21xxxxxx*/
561 #define ERROR_UNWRAP 0x21142318
562 /* V 0x22xxxxxx*/
563 /* W 0x23xxxxxx*/
564 #define ERROR_WIN_PARAM 0x23091601
565 #define ERROR_WIN_SYM 0x23091925
566 #define ERROR_WIN_TYPE 0x23092025
567 /* X 0x24xxxxxx*/
568 #define ERROR_XCORR_FLAG 0x24031518
569 /* Y 0x25xxxxxx*/
570 /* Z 0x26xxxxxx*/
571 
572 #define DAT_MASK 0x00000001
573 #define DAT_DOUBLE 0x00000000
574 #define DAT_COMPLEX 0x00000001
575 
576 #define DSPL_MATRIX_BLOCK 32
577 
578 
579 #define DSPL_SYMMETRIC 0x00000000
580 #define DSPL_PERIODIC 0x00000001
581 
582 #define DSPL_FLAG_DIGITAL 0x00000000
583 #define DSPL_FLAG_ANALOG 0x00000001
584 #define DSPL_FLAG_LOGMAG 0x00000002
585 #define DSPL_FLAG_UNWRAP 0x00000004
586 #define DSPL_FLAG_FFT_SHIFT 0x00000008
587 #define DSPL_FLAG_PSD_TWOSIDED DSPL_FLAG_FFT_SHIFT
588 
589 
590 
591 
592 #define DSPL_WIN_SYM_MASK 0x00000001
593 #define DSPL_WIN_MASK 0x00FFFFFE
594 
595 #define DSPL_WIN_SYMMETRIC DSPL_SYMMETRIC
596 #define DSPL_WIN_PERIODIC DSPL_PERIODIC
597 
598 
599 #define DSPL_WIN_BARTLETT 0x00000004
600 #define DSPL_WIN_BARTLETT_HANN 0x00000008
601 #define DSPL_WIN_BLACKMAN 0x00000010
602 #define DSPL_WIN_BLACKMAN_HARRIS 0x00000040
603 #define DSPL_WIN_BLACKMAN_NUTTALL 0x00000080
604 #define DSPL_WIN_FLAT_TOP 0x00000100
605 #define DSPL_WIN_GAUSSIAN 0x00000400
606 #define DSPL_WIN_HAMMING 0x00000800
607 #define DSPL_WIN_HANN 0x00001000
608 #define DSPL_WIN_LANCZOS 0x00004000
609 #define DSPL_WIN_NUTTALL 0x00008000
610 #define DSPL_WIN_RECT 0x00010000
611 #define DSPL_WIN_COS 0x00040000
612 #define DSPL_WIN_CHEBY 0x00080000
613 #define DSPL_WIN_KAISER 0x00100000
614 
615 
616 #define DSPL_FILTER_TYPE_MASK 0x000000FF
617 #define DSPL_FILTER_LPF 0x00000001
618 #define DSPL_FILTER_HPF 0x00000002
619 #define DSPL_FILTER_BPASS 0x00000004
620 #define DSPL_FILTER_BSTOP 0x00000008
621 
622 #define DSPL_FILTER_APPROX_MASK 0x0000FF00
623 #define DSPL_FILTER_BUTTER 0x00000100
624 #define DSPL_FILTER_CHEBY1 0x00000200
625 #define DSPL_FILTER_CHEBY2 0x00000400
626 #define DSPL_FILTER_ELLIP 0x00000800
627 
628 
629 #define DSPL_XCORR_NOSCALE 0x00000000
630 #define DSPL_XCORR_BIASED 0x00000001
631 #define DSPL_XCORR_UNBIASED 0x00000002
632 
633 
634 
635 #define ELLIP_ITER 16
636 #define ELLIP_MAX_ORD 24
637 
638 #define DSPL_VERIF_FAILED 1
639 #define DSPL_VERIF_SUCCESS 0
640 
641 #define PLOT_HOLD 0x00000001
642 
643 #define VERIF_STR_BUF 128
644 #define VERIF_STR_LEN 48
645 #define VERIF_CHAR_POINT 46
646 #define VERIF_LEVEL_COMPLEX 1E-11
647 #define VERIF_LEVEL_DOUBLE 1E-12
648 
649 
650 
651 #ifdef __cplusplus
652  extern "C" {
653 #endif
654 
655 
656 
657 #ifdef BUILD_LIB
658  /* Declare DSPL_API for Windows OS */
659  #ifdef WIN_OS
660  #define DSPL_API __declspec(dllexport)
661  #endif /* WIN_OS */
662  /* Declare DSPL_API for LINUX OS */
663  #ifdef LINUX_OS
664  #define DSPL_API
665  #endif /* LINUX_OS */
666 #endif /* BUILD_DLL */
667 
668 #define COMMA ,
669 
670 
671 #ifdef BUILD_LIB
672  #define DECLARE_FUNC(type, fn, param)\
673  type DSPL_API fn(param);
674 #endif
675 
676 #ifndef BUILD_LIB
677  #define DECLARE_FUNC( type, fn, param)\
678  typedef type (*p_##fn)(param);\
679  extern p_##fn fn;
680 
681 #endif
682 
683 
684 
685 /*----------------------------------------------------------------------------*/
686 DECLARE_FUNC(int, acos_cmplx, complex_t*
687  COMMA int
688  COMMA complex_t*);
689 /*----------------------------------------------------------------------------*/
690 DECLARE_FUNC(int, addlog, char* str
691  COMMA char* fn);
692 /*----------------------------------------------------------------------------*/
693 DECLARE_FUNC(int, array_scale_lin, double* x
694  COMMA int n
695  COMMA double xmin
696  COMMA double xmax
697  COMMA double dx
698  COMMA double h
699  COMMA double* y);
700 /*----------------------------------------------------------------------------*/
701 DECLARE_FUNC(int, asin_cmplx, complex_t*
702  COMMA int
703  COMMA complex_t*);
704 /*----------------------------------------------------------------------------*/
705 DECLARE_FUNC(int, bessel_i0, double* x
706  COMMA int n
707  COMMA double* y);
708 /*----------------------------------------------------------------------------*/
709 DECLARE_FUNC(int, bilinear, double* bs
710  COMMA double* as
711  COMMA int ord
712  COMMA double* bz
713  COMMA double* az);
714 /*----------------------------------------------------------------------------*/
715 DECLARE_FUNC(int, butter_ap, double
716  COMMA int
717  COMMA double*
718  COMMA double*);
719 /*----------------------------------------------------------------------------*/
720 DECLARE_FUNC(int, butter_ap_zp, int
721  COMMA double
722  COMMA complex_t*
723  COMMA int*
724  COMMA complex_t*
725  COMMA int*);
726 /*----------------------------------------------------------------------------*/
727 DECLARE_FUNC(int, cheby_poly1, double*
728  COMMA int
729  COMMA int
730  COMMA double*);
731 /*----------------------------------------------------------------------------*/
732 DECLARE_FUNC(int, cheby_poly2, double*
733  COMMA int
734  COMMA int
735  COMMA double*);
736 /*----------------------------------------------------------------------------*/
737 DECLARE_FUNC(int, cheby1_ap, double
738  COMMA int
739  COMMA double*
740  COMMA double*);
741 /*----------------------------------------------------------------------------*/
742 DECLARE_FUNC(int, cheby1_ap_zp, int
743  COMMA double
744  COMMA complex_t*
745  COMMA int*
746  COMMA complex_t*
747  COMMA int*);
748 /*----------------------------------------------------------------------------*/
749 DECLARE_FUNC(int, cheby2_ap, double rs
750  COMMA int ord
751  COMMA double* b
752  COMMA double* a);
753 /*----------------------------------------------------------------------------*/
754 DECLARE_FUNC(int, cheby2_ap_wp1, double rp
755  COMMA double rs
756  COMMA int ord
757  COMMA double* b
758  COMMA double* a);
759 /*----------------------------------------------------------------------------*/
760 DECLARE_FUNC(int, cheby2_ap_zp, int
761  COMMA double
762  COMMA complex_t*
763  COMMA int*
764  COMMA complex_t*
765  COMMA int*);
766 /*----------------------------------------------------------------------------*/
767 DECLARE_FUNC(int, cmplx2re, complex_t*
768  COMMA int
769  COMMA double*
770  COMMA double*);
771 /*----------------------------------------------------------------------------*/
772 DECLARE_FUNC(int, concat, void*
773  COMMA size_t
774  COMMA void*
775  COMMA size_t
776  COMMA void*);
777 /*----------------------------------------------------------------------------*/
778 DECLARE_FUNC(int, conv, double*
779  COMMA int
780  COMMA double*
781  COMMA int
782  COMMA double*);
783 /*----------------------------------------------------------------------------*/
784 DECLARE_FUNC(int, conv_cmplx, complex_t*
785  COMMA int
786  COMMA complex_t*
787  COMMA int
788  COMMA complex_t*);
789 /*----------------------------------------------------------------------------*/
790 DECLARE_FUNC(int, conv_fft, double* a
791  COMMA int na
792  COMMA double* b
793  COMMA int nb
794  COMMA fft_t* pfft
795  COMMA int nfft
796  COMMA double* c);
797 /*----------------------------------------------------------------------------*/
798 DECLARE_FUNC(int, conv_fft_cmplx, complex_t* a
799  COMMA int na
800  COMMA complex_t* b
801  COMMA int nb
802  COMMA fft_t* pfft
803  COMMA int nfft
804  COMMA complex_t* c);
805 /*----------------------------------------------------------------------------*/
806 DECLARE_FUNC(int, cos_cmplx, complex_t*
807  COMMA int
808  COMMA complex_t*);
809 /*----------------------------------------------------------------------------*/
810 DECLARE_FUNC(int, decimate, double* x
811  COMMA int n
812  COMMA int d
813  COMMA double* y
814  COMMA int* cnt);
815 /*----------------------------------------------------------------------------*/
816 DECLARE_FUNC(int, decimate_cmplx, complex_t* x
817  COMMA int n
818  COMMA int d
819  COMMA complex_t* y
820  COMMA int* cnt);
821 /*----------------------------------------------------------------------------*/
822 DECLARE_FUNC(int, dft, double*
823  COMMA int
824  COMMA complex_t*);
825 /*----------------------------------------------------------------------------*/
826 DECLARE_FUNC(int, dft_cmplx, complex_t*
827  COMMA int
828  COMMA complex_t*);
829 /*----------------------------------------------------------------------------*/
830 DECLARE_FUNC(double, dmod, double
831  COMMA double);
832 /*----------------------------------------------------------------------------*/
833 DECLARE_FUNC(void, dspl_info, void);
834 /*----------------------------------------------------------------------------*/
835 DECLARE_FUNC(int, ellip_acd, double* w
836  COMMA int n
837  COMMA double k
838  COMMA double* u);
839 /*----------------------------------------------------------------------------*/
840 DECLARE_FUNC(int, ellip_acd_cmplx, complex_t* w
841  COMMA int n
842  COMMA double k
843  COMMA complex_t* u);
844 /*----------------------------------------------------------------------------*/
845 DECLARE_FUNC(int, ellip_ap, double rp
846  COMMA double rs
847  COMMA int ord
848  COMMA double* b
849  COMMA double* a);
850 /*----------------------------------------------------------------------------*/
851 DECLARE_FUNC(int, ellip_ap_zp, int ord
852  COMMA double rp
853  COMMA double rs
854  COMMA complex_t* z
855  COMMA int* nz
856  COMMA complex_t* p
857  COMMA int* np);
858 /*----------------------------------------------------------------------------*/
859 DECLARE_FUNC(int, ellip_asn, double* w
860  COMMA int n
861  COMMA double k
862  COMMA double* u);
863 /*----------------------------------------------------------------------------*/
864 DECLARE_FUNC(int, ellip_asn_cmplx, complex_t* w
865  COMMA int n
866  COMMA double k
867  COMMA complex_t* u);
868 /*----------------------------------------------------------------------------*/
869 DECLARE_FUNC(int, ellip_cd, double* u
870  COMMA int n
871  COMMA double k
872  COMMA double* y);
873 /*----------------------------------------------------------------------------*/
874 DECLARE_FUNC(int, ellip_cd_cmplx, complex_t* u
875  COMMA int n
876  COMMA double k
877  COMMA complex_t* y);
878 /*----------------------------------------------------------------------------*/
879 DECLARE_FUNC(int, ellip_landen, double k
880  COMMA int n
881  COMMA double* y);
882 /*----------------------------------------------------------------------------*/
883 DECLARE_FUNC(int, ellip_modulareq, double rp
884  COMMA double rs
885  COMMA int ord
886  COMMA double* k);
887 /*----------------------------------------------------------------------------*/
888 DECLARE_FUNC(int, ellip_rat, double* w
889  COMMA int n
890  COMMA int ord
891  COMMA double k
892  COMMA double* u);
893 /*----------------------------------------------------------------------------*/
894 DECLARE_FUNC(int, ellip_sn, double* u
895  COMMA int n
896  COMMA double k
897  COMMA double* y);
898 /*----------------------------------------------------------------------------*/
899 DECLARE_FUNC(int, ellip_sn_cmplx, complex_t* u
900  COMMA int n
901  COMMA double k
902  COMMA complex_t* y);
903 /*----------------------------------------------------------------------------*/
904 DECLARE_FUNC(int, farrow_lagrange, double*
905  COMMA int
906  COMMA double
907  COMMA double
908  COMMA double
909  COMMA double**
910  COMMA int*);
911 /*----------------------------------------------------------------------------*/
912 DECLARE_FUNC(int, farrow_spline, double*
913  COMMA int
914  COMMA double
915  COMMA double
916  COMMA double
917  COMMA double**
918  COMMA int*);
919 /*----------------------------------------------------------------------------*/
920 DECLARE_FUNC(int, fft, double*
921  COMMA int
922  COMMA fft_t*
923  COMMA complex_t* );
924 /*----------------------------------------------------------------------------*/
925 DECLARE_FUNC(int, fft_abs, double* x
926  COMMA int n
927  COMMA fft_t* pfft
928  COMMA double fs
929  COMMA int flag
930  COMMA double* mag
931  COMMA double* freq);
932 /*----------------------------------------------------------------------------*/
933 DECLARE_FUNC(int, fft_abs_cmplx, complex_t* x
934  COMMA int n
935  COMMA fft_t* pfft
936  COMMA double fs
937  COMMA int flag
938  COMMA double* mag
939  COMMA double* freq);
940 /*----------------------------------------------------------------------------*/
941 DECLARE_FUNC(int, fft_cmplx, complex_t*
942  COMMA int
943  COMMA fft_t*
944  COMMA complex_t* );
945 /*----------------------------------------------------------------------------*/
946 DECLARE_FUNC(int, fft_create, fft_t*
947  COMMA int);
948 /*----------------------------------------------------------------------------*/
949 DECLARE_FUNC(void, fft_free, fft_t*);
950 /*----------------------------------------------------------------------------*/
951 DECLARE_FUNC(int, fft_mag, double* x
952  COMMA int n
953  COMMA fft_t* pfft
954  COMMA double fs
955  COMMA int flag
956  COMMA double* mag
957  COMMA double* freq);
958 /*----------------------------------------------------------------------------*/
959 DECLARE_FUNC(int, fft_mag_cmplx, complex_t* x
960  COMMA int n
961  COMMA fft_t* pfft
962  COMMA double fs
963  COMMA int flag
964  COMMA double* mag
965  COMMA double* freq);
966 /*----------------------------------------------------------------------------*/
967 DECLARE_FUNC(int, fft_shift, double*
968  COMMA int n
969  COMMA double*);
970 /*----------------------------------------------------------------------------*/
971 DECLARE_FUNC(int, fft_shift_cmplx, complex_t*
972  COMMA int
973  COMMA complex_t*);
974 /*----------------------------------------------------------------------------*/
975 DECLARE_FUNC(int, filter_freq_resp, double* b
976  COMMA double* a
977  COMMA int ord
978  COMMA double* w
979  COMMA int n
980  COMMA int flag
981  COMMA double* mag
982  COMMA double* phi
983  COMMA double* tau);
984 /*----------------------------------------------------------------------------*/
985 DECLARE_FUNC(int, filter_iir, double*
986  COMMA double*
987  COMMA int
988  COMMA double*
989  COMMA int
990  COMMA double*);
991 /*----------------------------------------------------------------------------*/
992 DECLARE_FUNC(double, filter_ws1, int ord
993  COMMA double rp
994  COMMA double rs
995  COMMA int type);
996 /*----------------------------------------------------------------------------*/
997 DECLARE_FUNC(int, filter_zp2ab, complex_t*
998  COMMA int
999  COMMA complex_t*
1000  COMMA int
1001  COMMA int
1002  COMMA double*
1003  COMMA double*);
1004 /*----------------------------------------------------------------------------*/
1005 DECLARE_FUNC(int, find_max_abs, double* a
1006  COMMA int n
1007  COMMA double* m
1008  COMMA int* ind);
1009 /*----------------------------------------------------------------------------*/
1010 DECLARE_FUNC(int, fir_linphase, int ord
1011  COMMA double w0
1012  COMMA double w1
1013  COMMA int filter_type
1014  COMMA int wintype
1015  COMMA double winparam
1016  COMMA double* h);
1017 /*----------------------------------------------------------------------------*/
1018 DECLARE_FUNC(int, flipip, double*
1019  COMMA int);
1020 /*----------------------------------------------------------------------------*/
1021 DECLARE_FUNC(int, flipip_cmplx, complex_t*
1022  COMMA int);
1023 /*----------------------------------------------------------------------------*/
1024 DECLARE_FUNC(int, fourier_integral_cmplx, double* t
1025  COMMA complex_t* s
1026  COMMA int nt
1027  COMMA int nw
1028  COMMA double* w
1029  COMMA complex_t* y);
1030 /*----------------------------------------------------------------------------*/
1031 DECLARE_FUNC(int, fourier_series_dec, double*
1032  COMMA double*
1033  COMMA int
1034  COMMA double
1035  COMMA int
1036  COMMA double*
1037  COMMA complex_t*);
1038 /*----------------------------------------------------------------------------*/
1039 DECLARE_FUNC(int, fourier_series_dec_cmplx, double* t
1040  COMMA complex_t* s
1041  COMMA int nt
1042  COMMA double period
1043  COMMA int nw
1044  COMMA double* w
1045  COMMA complex_t* y);
1046 /*----------------------------------------------------------------------------*/
1047 DECLARE_FUNC(int, fourier_series_rec, double*
1048  COMMA complex_t*
1049  COMMA int
1050  COMMA double*
1051  COMMA int
1052  COMMA complex_t*);
1053 /*----------------------------------------------------------------------------*/
1054 DECLARE_FUNC(int, freqs, double*
1055  COMMA double*
1056  COMMA int
1057  COMMA double*
1058  COMMA int
1059  COMMA complex_t*);
1060 /*----------------------------------------------------------------------------*/
1061 DECLARE_FUNC(int, freqs_cmplx, double* b
1062  COMMA double* a
1063  COMMA int ord
1064  COMMA complex_t* s
1065  COMMA int n
1066  COMMA complex_t* h);
1067 /*----------------------------------------------------------------------------*/
1068 DECLARE_FUNC(int, freqs2time, double*
1069  COMMA double*
1070  COMMA int
1071  COMMA double
1072  COMMA int
1073  COMMA fft_t*
1074  COMMA double*
1075  COMMA double*);
1076 /*----------------------------------------------------------------------------*/
1077 DECLARE_FUNC(int, freqz, double*
1078  COMMA double*
1079  COMMA int
1080  COMMA double*
1081  COMMA int
1082  COMMA complex_t*);
1083 /*----------------------------------------------------------------------------*/
1084 DECLARE_FUNC(void, gnuplot_close, void* h);
1085 /*----------------------------------------------------------------------------*/
1086 DECLARE_FUNC(void, gnuplot_cmd, void* h
1087  COMMA char* cmd);
1088 /*----------------------------------------------------------------------------*/
1089 DECLARE_FUNC(int, gnuplot_create, int argc
1090  COMMA char* argv[]
1091  COMMA int w
1092  COMMA int h
1093  COMMA char* fn_png
1094  COMMA void** hplot);
1095 /*----------------------------------------------------------------------------*/
1096 DECLARE_FUNC(int, gnuplot_open, void** hplot);
1097 /*----------------------------------------------------------------------------*/
1098 DECLARE_FUNC(int, goertzel, double*
1099  COMMA int
1100  COMMA int*
1101  COMMA int
1102  COMMA complex_t*);
1103 /*----------------------------------------------------------------------------*/
1104 DECLARE_FUNC(int, goertzel_cmplx, complex_t*
1105  COMMA int
1106  COMMA int*
1107  COMMA int
1108  COMMA complex_t*);
1109 /*----------------------------------------------------------------------------*/
1110 DECLARE_FUNC(int, group_delay, double* b
1111  COMMA double* a
1112  COMMA int ord
1113  COMMA int flag
1114  COMMA double* w
1115  COMMA int n
1116  COMMA double* tau);
1117 /*----------------------------------------------------------------------------*/
1118 DECLARE_FUNC(int, histogram, double* x
1119  COMMA int n
1120  COMMA int nh
1121  COMMA double* pedges
1122  COMMA double* ph);
1123 /*----------------------------------------------------------------------------*/
1124 DECLARE_FUNC(int, histogram_norm, double* y
1125  COMMA int n
1126  COMMA int nh
1127  COMMA double* x
1128  COMMA double* w);
1129 /*----------------------------------------------------------------------------*/
1130 DECLARE_FUNC(int, idft_cmplx, complex_t*
1131  COMMA int
1132  COMMA complex_t*);
1133 /*----------------------------------------------------------------------------*/
1134 DECLARE_FUNC(int, ifft_cmplx, complex_t*
1135  COMMA int
1136  COMMA fft_t*
1137  COMMA complex_t* );
1138 /*----------------------------------------------------------------------------*/
1139 DECLARE_FUNC(int, iir, double rp
1140  COMMA double rs
1141  COMMA int ord
1142  COMMA double w0
1143  COMMA double w1
1144  COMMA int type
1145  COMMA double* b
1146  COMMA double* a);
1147 /*----------------------------------------------------------------------------*/
1148 DECLARE_FUNC(int, linspace, double
1149  COMMA double
1150  COMMA int
1151  COMMA int
1152  COMMA double*);
1153 /*----------------------------------------------------------------------------*/
1154 DECLARE_FUNC(int, log_cmplx, complex_t*
1155  COMMA int
1156  COMMA complex_t*);
1157 /*----------------------------------------------------------------------------*/
1158 DECLARE_FUNC(int, logspace, double
1159  COMMA double
1160  COMMA int
1161  COMMA int
1162  COMMA double*);
1163 /*----------------------------------------------------------------------------*/
1164 DECLARE_FUNC(int, low2bp, double* b
1165  COMMA double* a
1166  COMMA int ord
1167  COMMA double w0
1168  COMMA double wpl
1169  COMMA double wph
1170  COMMA double* beta
1171  COMMA double* alpha);
1172 /*----------------------------------------------------------------------------*/
1173 DECLARE_FUNC(int, low2bs, double* b
1174  COMMA double* a
1175  COMMA int ord
1176  COMMA double w0
1177  COMMA double wsl
1178  COMMA double wsh
1179  COMMA double* beta
1180  COMMA double* alpha);
1181 /*----------------------------------------------------------------------------*/
1182 DECLARE_FUNC(int, low2high, double* b
1183  COMMA double* a
1184  COMMA int ord
1185  COMMA double w0
1186  COMMA double w1
1187  COMMA double* beta
1188  COMMA double* alpha);
1189 /*----------------------------------------------------------------------------*/
1190 DECLARE_FUNC(int, low2low, double* b
1191  COMMA double* a
1192  COMMA int ord
1193  COMMA double w0
1194  COMMA double w1
1195  COMMA double* beta
1196  COMMA double* alpha);
1197 /*----------------------------------------------------------------------------*/
1198 DECLARE_FUNC(int, matrix_eig_cmplx, complex_t* a
1199  COMMA int n
1200  COMMA complex_t* v
1201  COMMA int* info);
1202 /*----------------------------------------------------------------------------*/
1203 DECLARE_FUNC(int, matrix_eye, double* a
1204  COMMA int n
1205  COMMA int m);
1206 /*----------------------------------------------------------------------------*/
1207 DECLARE_FUNC(int, matrix_eye_cmplx, complex_t* a
1208  COMMA int n
1209  COMMA int m);
1210 /*----------------------------------------------------------------------------*/
1211 DECLARE_FUNC(int, matrix_mul, double* a
1212  COMMA int na
1213  COMMA int ma
1214  COMMA double* b
1215  COMMA int nb
1216  COMMA int mb
1217  COMMA double* c);
1218 /*----------------------------------------------------------------------------*/
1219 DECLARE_FUNC(int, matrix_pinv, double* a
1220  COMMA int n
1221  COMMA int m
1222  COMMA double* tol
1223  COMMA double* inv
1224  COMMA int* info);
1225 /*----------------------------------------------------------------------------*/
1226 DECLARE_FUNC(int, matrix_print, double* a
1227  COMMA int n
1228  COMMA int m
1229  COMMA const char* name
1230  COMMA const char* format);
1231 /*----------------------------------------------------------------------------*/
1232 DECLARE_FUNC(int, matrix_print_cmplx, complex_t* a
1233  COMMA int n
1234  COMMA int m
1235  COMMA const char* name
1236  COMMA const char* format);
1237 /*----------------------------------------------------------------------------*/
1238 DECLARE_FUNC(int, matrix_svd, double* a
1239  COMMA int n
1240  COMMA int m
1241  COMMA double* u
1242  COMMA double* s
1243  COMMA double* vt
1244  COMMA int* info);
1245 /*----------------------------------------------------------------------------*/
1246 DECLARE_FUNC(int, matrix_transpose, double* a
1247  COMMA int n
1248  COMMA int m
1249  COMMA double* b);
1250 /*----------------------------------------------------------------------------*/
1251 DECLARE_FUNC(int, matrix_transpose_cmplx, complex_t* a
1252  COMMA int n
1253  COMMA int m
1254  COMMA complex_t* b);
1255 /*----------------------------------------------------------------------------*/
1256 DECLARE_FUNC(int, matrix_transpose_hermite, complex_t* a
1257  COMMA int n
1258  COMMA int m
1259  COMMA complex_t* b);
1260 /*----------------------------------------------------------------------------*/
1261 DECLARE_FUNC(int, mean, double* x
1262  COMMA int n
1263  COMMA double* m);
1264 /*----------------------------------------------------------------------------*/
1265 DECLARE_FUNC(int, mean_cmplx, complex_t* x
1266  COMMA int n
1267  COMMA complex_t* m);
1268 /*----------------------------------------------------------------------------*/
1269 DECLARE_FUNC(int, minmax, double* x
1270  COMMA int n
1271  COMMA double* xmin
1272  COMMA double* xmax);
1273 /*----------------------------------------------------------------------------*/
1274 DECLARE_FUNC(int, ones, double* x
1275  COMMA int n);
1276 /*----------------------------------------------------------------------------*/
1277 DECLARE_FUNC(int, phase_delay, double* b
1278  COMMA double* a
1279  COMMA int ord
1280  COMMA int flag
1281  COMMA double* w
1282  COMMA int n
1283  COMMA double* tau);
1284 /*----------------------------------------------------------------------------*/
1285 DECLARE_FUNC(int, poly_z2a_cmplx, complex_t*
1286  COMMA int
1287  COMMA int
1288  COMMA complex_t*);
1289 /*----------------------------------------------------------------------------*/
1290 DECLARE_FUNC(int, polyroots, double* a
1291  COMMA int ord
1292  COMMA complex_t* r
1293  COMMA int* info);
1294 /*----------------------------------------------------------------------------*/
1295 DECLARE_FUNC(int, polyval, double*
1296  COMMA int
1297  COMMA double*
1298  COMMA int
1299  COMMA double*);
1300 /*----------------------------------------------------------------------------*/
1301 DECLARE_FUNC(int, polyval_cmplx, complex_t*
1302  COMMA int
1303  COMMA complex_t*
1304  COMMA int
1305  COMMA complex_t*);
1306 /*----------------------------------------------------------------------------*/
1307 DECLARE_FUNC(int, psd_bartlett, double* x
1308  COMMA int n
1309  COMMA int nfft
1310  COMMA fft_t* pfft
1311  COMMA double fs
1312  COMMA int flag
1313  COMMA double* ppsd
1314  COMMA double* pfrq);
1315 /*----------------------------------------------------------------------------*/
1316 DECLARE_FUNC(int, psd_bartlett_cmplx, complex_t* x
1317  COMMA int n
1318  COMMA int nfft
1319  COMMA fft_t* pfft
1320  COMMA double fs
1321  COMMA int flag
1322  COMMA double* ppsd
1323  COMMA double* pfrq);
1324 /*----------------------------------------------------------------------------*/
1325 DECLARE_FUNC(int, psd_periodogram, double* x
1326  COMMA int n
1327  COMMA int win_type
1328  COMMA double win_param
1329  COMMA fft_t* pfft
1330  COMMA double fs
1331  COMMA int flag
1332  COMMA double* ppsd
1333  COMMA double* pfrq);
1334 /*----------------------------------------------------------------------------*/
1335 DECLARE_FUNC(int, psd_periodogram_cmplx, complex_t* x
1336  COMMA int n
1337  COMMA int win_type
1338  COMMA double win_param
1339  COMMA fft_t* pfft
1340  COMMA double fs
1341  COMMA int flag
1342  COMMA double* ppsd
1343  COMMA double* pfrq);
1344 /*----------------------------------------------------------------------------*/
1345 DECLARE_FUNC(int, psd_welch, double* x
1346  COMMA int n
1347  COMMA int win_type
1348  COMMA double win_param
1349  COMMA int npsd
1350  COMMA int noverlap
1351  COMMA fft_t* pfft
1352  COMMA double fs
1353  COMMA int flag
1354  COMMA double* ppsd
1355  COMMA double* pfrq);
1356 /*----------------------------------------------------------------------------*/
1357 DECLARE_FUNC(int, psd_welch_cmplx, complex_t* x
1358  COMMA int n
1359  COMMA int win_type
1360  COMMA double win_param
1361  COMMA int npsd
1362  COMMA int noverlap
1363  COMMA fft_t* pfft
1364  COMMA double fs
1365  COMMA int flag
1366  COMMA double* ppsd
1367  COMMA double* pfrq);
1368 /*----------------------------------------------------------------------------*/
1369 DECLARE_FUNC(int, randb, double* x
1370  COMMA int n
1371  COMMA random_t* prnd);
1372 /*----------------------------------------------------------------------------*/
1373 DECLARE_FUNC(int, randb2, double* x
1374  COMMA int n
1375  COMMA random_t* prnd);
1376 /*----------------------------------------------------------------------------*/
1377 DECLARE_FUNC(int, randi, int* x
1378  COMMA int n
1379  COMMA int start
1380  COMMA int stop
1381  COMMA random_t* prnd);
1382 /*----------------------------------------------------------------------------*/
1383 DECLARE_FUNC(int, randn, double* x
1384  COMMA int n
1385  COMMA double mu
1386  COMMA double sigma
1387  COMMA random_t* prnd);
1388 /*----------------------------------------------------------------------------*/
1389 DECLARE_FUNC(int, randn_cmplx, complex_t* x
1390  COMMA int n
1391  COMMA complex_t* mu
1392  COMMA double sigma
1393  COMMA random_t* prnd);
1394 /*----------------------------------------------------------------------------*/
1395 DECLARE_FUNC(int, random_init, random_t* prnd
1396  COMMA int type
1397  COMMA void* seed);
1398 /*----------------------------------------------------------------------------*/
1399 DECLARE_FUNC(int, randu, double*
1400  COMMA int
1401  COMMA random_t* prnd);
1402 /*----------------------------------------------------------------------------*/
1403 DECLARE_FUNC(int, ratcompos, double* b
1404  COMMA double* a
1405  COMMA int n
1406  COMMA double* c
1407  COMMA double* d
1408  COMMA int p
1409  COMMA double* beta
1410  COMMA double* alpha);
1411 /*----------------------------------------------------------------------------*/
1412 DECLARE_FUNC(int, re2cmplx, double*
1413  COMMA int
1414  COMMA complex_t*);
1415 /*----------------------------------------------------------------------------*/
1416 DECLARE_FUNC(int, readbin, char* fn
1417  COMMA void** x
1418  COMMA int* k
1419  COMMA int* dtype);
1420 /*----------------------------------------------------------------------------*/
1421 DECLARE_FUNC(int, signal_pimp, double*
1422  COMMA size_t
1423  COMMA double
1424  COMMA double
1425  COMMA double
1426  COMMA double
1427  COMMA double*);
1428 /*----------------------------------------------------------------------------*/
1429 DECLARE_FUNC(int, signal_saw, double* t
1430  COMMA size_t n
1431  COMMA double amp
1432  COMMA double dt
1433  COMMA double period
1434  COMMA double* y);
1435 /*----------------------------------------------------------------------------*/
1436 DECLARE_FUNC(int, sin_cmplx, complex_t*
1437  COMMA int
1438  COMMA complex_t*);
1439 /*----------------------------------------------------------------------------*/
1440 DECLARE_FUNC(int, sinc, double* x
1441  COMMA int n
1442  COMMA double a
1443  COMMA double* y);
1444 /*----------------------------------------------------------------------------*/
1445 DECLARE_FUNC(int, sine_int, double* x
1446  COMMA int n
1447  COMMA double* si);
1448 /*----------------------------------------------------------------------------*/
1449 DECLARE_FUNC(int, sqrt_cmplx, complex_t*
1450  COMMA int
1451  COMMA complex_t*);
1452 /*----------------------------------------------------------------------------*/
1453 DECLARE_FUNC(int, std, double* x
1454  COMMA int n
1455  COMMA double* s);
1456 /*----------------------------------------------------------------------------*/
1457 DECLARE_FUNC(int, std_cmplx, complex_t* x
1458  COMMA int n
1459  COMMA double* s);
1460 /*----------------------------------------------------------------------------*/
1461 DECLARE_FUNC(int, trapint, double*
1462  COMMA double*
1463  COMMA int
1464  COMMA double*);
1465 /*----------------------------------------------------------------------------*/
1466 DECLARE_FUNC(int, trapint_cmplx, double*
1467  COMMA complex_t*
1468  COMMA int
1469  COMMA complex_t*);
1470 /*----------------------------------------------------------------------------*/
1471 DECLARE_FUNC(int, unwrap, double*
1472  COMMA int
1473  COMMA double
1474  COMMA double);
1475 /*----------------------------------------------------------------------------*/
1476 DECLARE_FUNC(int, vector_dot, double* x
1477  COMMA double* y
1478  COMMA int n
1479  COMMA double* p);
1480 /*----------------------------------------------------------------------------*/
1481 DECLARE_FUNC(int, verif, double* x
1482  COMMA double* y
1483  COMMA size_t n
1484  COMMA double eps
1485  COMMA double* err);
1486 /*----------------------------------------------------------------------------*/
1487 DECLARE_FUNC(int, verif_data_gen, int len
1488  COMMA int type
1489  COMMA char* fn);
1490 /*----------------------------------------------------------------------------*/
1491 DECLARE_FUNC(int, verif_cmplx, complex_t* x
1492  COMMA complex_t* y
1493  COMMA size_t n
1494  COMMA double eps
1495  COMMA double* err);
1496 /*----------------------------------------------------------------------------*/
1497 DECLARE_FUNC(void, verif_str, double* yout
1498  COMMA int nout
1499  COMMA char* str_msg
1500  COMMA char* outfn
1501  COMMA char* logfn);
1502 /*----------------------------------------------------------------------------*/
1503 DECLARE_FUNC(void, verif_str_cmplx, complex_t* yout
1504  COMMA int nout
1505  COMMA char* str_msg
1506  COMMA char* outfn
1507  COMMA char* logfn);
1508 /*----------------------------------------------------------------------------*/
1509 DECLARE_FUNC(int, window, double* w
1510  COMMA int n
1511  COMMA int win_type
1512  COMMA double param);
1513 /*----------------------------------------------------------------------------*/
1514 DECLARE_FUNC(int, writebin, void*
1515  COMMA int
1516  COMMA int
1517  COMMA char*);
1518 /*----------------------------------------------------------------------------*/
1519 DECLARE_FUNC(int, writetxt, double*
1520  COMMA double*
1521  COMMA int
1522  COMMA char* );
1523 /*----------------------------------------------------------------------------*/
1524 DECLARE_FUNC(int, writetxt_3d, double* x
1525  COMMA int nx
1526  COMMA double* y
1527  COMMA int ny
1528  COMMA double* z
1529  COMMA char* fn);
1530 /*----------------------------------------------------------------------------*/
1531 DECLARE_FUNC(int, writetxt_3dline, double* x
1532  COMMA double* y
1533  COMMA double* z
1534  COMMA int n
1535  COMMA char* fn);
1536 /*----------------------------------------------------------------------------*/
1537 DECLARE_FUNC(int, writetxt_cmplx, complex_t* x
1538  COMMA int n
1539  COMMA char* fn);
1540 /*----------------------------------------------------------------------------*/
1541 DECLARE_FUNC(int, writetxt_cmplx_im, double*
1542  COMMA complex_t*
1543  COMMA int
1544  COMMA char*);
1545 /*----------------------------------------------------------------------------*/
1546 DECLARE_FUNC(int, writetxt_cmplx_re, double*
1547  COMMA complex_t*
1548  COMMA int
1549  COMMA char*);
1550 /*----------------------------------------------------------------------------*/
1551 DECLARE_FUNC(int, writetxt_int, int*
1552  COMMA int*
1553  COMMA int
1554  COMMA char*);
1555 /*----------------------------------------------------------------------------*/
1556 DECLARE_FUNC(int, xcorr, double* x
1557  COMMA int nx
1558  COMMA double* y
1559  COMMA int ny
1560  COMMA int flag
1561  COMMA int nr
1562  COMMA double* r
1563  COMMA double* t);
1564 /*----------------------------------------------------------------------------*/
1565 DECLARE_FUNC(int, xcorr_cmplx, complex_t* x
1566  COMMA int nx
1567  COMMA complex_t* y
1568  COMMA int ny
1569  COMMA int flag
1570  COMMA int nr
1571  COMMA complex_t* r
1572  COMMA double* t);
1573 /*----------------------------------------------------------------------------*/
1574 
1575 
1576 #ifdef __cplusplus
1577  }
1578 #endif
1579 
1580 
1581 #ifdef DOXYGEN_ENGLISH
1582 
1634 #endif
1635 #ifdef DOXYGEN_RUSSIAN
1636 
1688 #endif
1689 void* dspl_load();
1690 
1691 
1692 
1693 
1694 
1695 #ifdef DOXYGEN_ENGLISH
1696 
1712 #endif
1713 #ifdef DOXYGEN_RUSSIAN
1714 
1730 #endif
1731 void dspl_free(void* handle);
1732 
1733 
1734 
1735 #endif /* DSPL_H */
1736 
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
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:842
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: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: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: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 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:1153
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:892
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:645
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:179
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: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:1009
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
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: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:356
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:297
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: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: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 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: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 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
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: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: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