Added gnuplot interface commande line functions.

No need to use plt filees anymore

 Changes to be committed:
	deleted:    bin/gnuplot/bessel_i0.plt
	deleted:    bin/gnuplot/bilinear_test.plt
	deleted:    bin/gnuplot/butter_ap_test.plt
	deleted:    bin/gnuplot/cheby1_ap_test.plt
	deleted:    bin/gnuplot/cheby_poly1.plt
	deleted:    bin/gnuplot/cheby_poly2.plt
	deleted:    bin/gnuplot/filter_iir.plt
	deleted:    bin/gnuplot/gnuplot_script.plt
	deleted:    bin/gnuplot/iir_bstop.plt
	deleted:    bin/gnuplot/iir_lpf.plt
	deleted:    bin/gnuplot/iir_test.plt
	deleted:    bin/gnuplot/sinc_test.plt
	deleted:    bin/gnuplot/sine_int.plt
	modified:   bin/img/bessel_i0.png
	modified:   bin/img/bilinear.png
	modified:   bin/img/cheby_poly1.png
	modified:   bin/img/cheby_poly2.png
	modified:   bin/img/filter_iir_test.png
	deleted:    bin/img/gnuplot_script.png
	modified:   bin/img/iir_bstop.png
	modified:   bin/img/iir_lpf.png
	modified:   bin/img/iir_test.png
	modified:   bin/img/sinc_test.png
	new file:   dspl/doc/html/_form0_tmp.ps
	new file:   dspl/doc/html/_formulas.aux
	new file:   dspl/doc/html/_formulas.dvi
	new file:   dspl/doc/html/_formulas.log
	new file:   dspl/doc/html/_formulas.tex
	deleted:    dspl/doc/html/formula.repository
	modified:   dspl/dox/doxyfile_ru
	modified:   dspl/dox/ru/error_list.dox
	new file:   dspl/dox/ru/gnuplot.dox
	modified:   dspl/dox/ru/groups_define.dox
	modified:   dspl/dox/ru/mainpage.dox
	new file:   dspl/src/gnuplot.c
	modified:   dspl/src/inout.c
	modified:   examples/src/bessel_i0.c
	modified:   examples/src/bilinear_test.c
	modified:   examples/src/butter_ap_test.c
	modified:   examples/src/cheby1_ap_test.c
	modified:   examples/src/cheby2_ap_zp_test.c
	modified:   examples/src/cheby_poly1_test.c
	modified:   examples/src/cheby_poly2_test.c
	modified:   examples/src/filter_iir_test.c
	modified:   examples/src/gnuplot_script_test.c
	modified:   examples/src/iir_bstop.c
	modified:   examples/src/iir_lpf.c
	modified:   examples/src/iir_test.c
	modified:   examples/src/sinc_test.c
	modified:   examples/src/sine_int_test.c
	deleted:    examples/src/test.c
	modified:   ide/codeblocks/examples.depend
	modified:   include/dspl.c
	modified:   include/dspl.h
pull/6/merge
Dsplib 2020-01-09 22:31:03 +03:00
rodzic 7769efae10
commit 159d414784
54 zmienionych plików z 2355 dodań i 635 usunięć

Wyświetl plik

@ -1,15 +0,0 @@
if(!exists("plotterm")) plotterm = 'wxt'
if(plotterm eq "pngcairo") set output 'img/bessel_i0.png'
set grid
set xlabel "x"
set lmargin at screen 0.10
set key left top
set terminal plotterm size 560,380 enhanced font 'Verdana,8'
set ylabel "I_0(x)"
set yrange [0:5]
plot 'dat/dat0.txt' with lines

Wyświetl plik

@ -1,17 +0,0 @@
if(!exists("plotterm")) plotterm = 'wxt'
if(plotterm eq "pngcairo") set output 'img/bilinear.png'
unset key
set grid
set xlabel "normalized frequency"
set terminal plotterm size 520, 380 enhanced font 'Verdana,8'
set ylabel "Magnitude, dB"
set yrange [-80:5]
plot 'dat/bilinear.txt' with lines

Wyświetl plik

@ -1,27 +0,0 @@
if(!exists("plotterm")) plotterm = 'wxt'
if(plotterm eq "pngcairo") set output 'img/butter_ap_test.png'
set logscale x
unset key
set grid
set xlabel "frequency, rad/s"
set terminal plotterm size 920, 260 enhanced font 'Verdana,8'
set multiplot layout 1,3 rowsfirst
set ylabel "Magnitude, dB"
set yrange [-100:5]
plot 'dat/butter_ap_test_mag.txt' with lines
set ylabel "Phase response, rad"
unset yrange
plot 'dat/butter_ap_test_phi.txt' with lines
set ylabel "Groupdelay, sec"
unset yrange
plot 'dat/butter_ap_test_tau.txt' with lines
unset multiplot

Wyświetl plik

@ -1,26 +0,0 @@
if(!exists("plotterm")) plotterm = 'wxt'
if(plotterm eq "pngcairo") set output 'img/cheby1_ap_test.png'
set logscale x
unset key
set grid
set xlabel "frequency, rad/s"
set terminal plotterm size 920, 260 enhanced font 'Verdana,8'
set multiplot layout 1,3 rowsfirst
set ylabel "Magnitude, dB"
set yrange [-100:5]
plot 'dat/cheby1_ap_test_mag.txt' with lines
set ylabel "Phase response, rad"
unset yrange
plot 'dat/cheby1_ap_test_phi.txt' with lines
set ylabel "Groupdelay, sec"
unset yrange
plot 'dat/cheby1_ap_test_tau.txt' with lines
unset multiplot

Wyświetl plik

@ -1,19 +0,0 @@
if(!exists("plotterm")) plotterm = 'wxt'
if(plotterm eq "pngcairo") set output 'img/cheby_poly1.png'
set terminal plotterm size 560,380 enhanced font 'Verdana,8'
set grid
set xlabel "x"
set lmargin at screen 0.10
set key left top
set ylabel "C_N(x)"
set yrange [-1.5:1.5]
plot 'dat/cheby_poly1_ord1.txt' with lines, \
'dat/cheby_poly1_ord2.txt' with lines, \
'dat/cheby_poly1_ord3.txt' with lines, \
'dat/cheby_poly1_ord4.txt' with lines

Wyświetl plik

@ -1,18 +0,0 @@
if(!exists("plotterm")) plotterm = 'wxt'
if(plotterm eq "pngcairo") set output 'img/cheby_poly2.png'
set grid
set xlabel "x"
set lmargin at screen 0.10
set key left top
set terminal plotterm size 560,380 enhanced font 'Verdana,8'
set ylabel "C_N(x)"
set yrange [-3.5:3.5]
plot 'dat/cheby_poly2_ord1.txt' with lines, \
'dat/cheby_poly2_ord2.txt' with lines, \
'dat/cheby_poly2_ord3.txt' with lines, \
'dat/cheby_poly2_ord4.txt' with lines

Wyświetl plik

@ -1,22 +0,0 @@
if(!exists("plotterm")) plotterm = 'wxt'
if(plotterm eq "pngcairo") set output 'img/filter_iir_test.png'
unset key
set grid
set xlabel "n"
set terminal plotterm size 820, 340 enhanced font 'Verdana,8'
set ylabel "s(n)"
set yrange [-3:3]
set multiplot layout 2,1 rowsfirst
plot 'dat/s.txt' with lines
set ylabel "s_f(n)"
plot 'dat/sf.txt' with lines
unset multiplot

Wyświetl plik

@ -1,15 +0,0 @@
if(!exists("plotterm")) plotterm = 'wxt'
if(plotterm eq "pngcairo") set output 'img/gnuplot_script.png'
set grid
set xlabel "x"
set terminal plotterm size 560,280 enhanced font 'Verdana,8'
set ylabel "sin(x), cos(x)"
plot 'dat/sine.txt' with lines title "sin(x)", \
'dat/cosine.txt' with lines title "cos(x)"

Wyświetl plik

@ -1,24 +0,0 @@
if(!exists("plotterm")) plotterm = 'wxt'
if(plotterm eq "pngcairo") set output 'img/iir_bstop.png'
unset key
set grid
set xlabel " normalized frequency"
set terminal plotterm size 920, 260 enhanced font 'Verdana,8'
set multiplot layout 1,3 rowsfirst
set ylabel "Magnitude, dB"
set yrange [-100:5]
plot 'dat/iir_bstop_mag.txt' with lines
set ylabel "Phase response, rad"
unset yrange
plot 'dat/iir_bstop_phi.txt' with lines
set ylabel "Groupdelay, samples"
unset yrange
plot 'dat/iir_bstop_tau.txt' with lines
unset multiplot

Wyświetl plik

@ -1,23 +0,0 @@
if(!exists("plotterm")) plotterm = 'wxt'
if(plotterm eq "pngcairo") set output 'img/iir_lpf.png'
unset key
set grid
set xlabel " normalized frequency"
set terminal plotterm size 920, 260 enhanced font 'Verdana,8'
set multiplot layout 1,3 rowsfirst
set ylabel "Magnitude, dB"
set yrange [-100:5]
plot 'dat/iir_lpf_mag.txt' with lines
set ylabel "Phase response, rad"
unset yrange
plot 'dat/iir_lpf_phi.txt' with lines
set ylabel "Groupdelay, samples"
unset yrange
plot 'dat/iir_lpf_tau.txt' with lines
unset multiplot

Wyświetl plik

@ -1,45 +0,0 @@
if(!exists("plotterm")) plotterm = 'wxt'
if(plotterm eq "pngcairo") set output 'img/iir_test.png'
unset key
set grid
set xlabel " normalized frequency"
set terminal plotterm size 920, 840 enhanced font 'Verdana,8'
set ylabel "Magnitude, dB"
set yrange [-100:5]
set xtics 0,1
set xtics add ("0.3" 0.3)
set xtics add ("0.7" 0.7)
set xtics add ("1" 1)
set multiplot layout 4,4 rowsfirst
plot 'dat/iir_butter_lpf.txt' with lines
plot 'dat/iir_butter_hpf.txt' with lines
plot 'dat/iir_butter_bpf.txt' with lines
plot 'dat/iir_butter_bsf.txt' with lines
plot 'dat/iir_cheby1_lpf.txt' with lines
plot 'dat/iir_cheby1_hpf.txt' with lines
plot 'dat/iir_cheby1_bpf.txt' with lines
plot 'dat/iir_cheby1_bsf.txt' with lines
plot 'dat/iir_cheby2_lpf.txt' with lines
plot 'dat/iir_cheby2_hpf.txt' with lines
plot 'dat/iir_cheby2_bpf.txt' with lines
plot 'dat/iir_cheby2_bsf.txt' with lines
plot 'dat/iir_ellip_lpf.txt' with lines
plot 'dat/iir_ellip_hpf.txt' with lines
plot 'dat/iir_ellip_bpf.txt' with lines
plot 'dat/iir_ellip_bsf.txt' with lines
unset multiplot

Wyświetl plik

@ -1,17 +0,0 @@
if(!exists("plotterm")) plotterm = 'wxt'
if(plotterm eq "pngcairo") set output 'img/sinc_test.png'
set grid
set xlabel "x"
set lmargin at screen 0.10
set terminal plotterm size 560,280 enhanced font 'Verdana,8'
set ylabel "sinc(x,a)"
set yrange [-0.25:1.1]
plot 'dat/sinc_test_1.0.txt' with lines title "a = 1.0", \
'dat/sinc_test_pi.txt' with lines title "a = pi", \
'dat/sinc_test_2pi.txt' with lines title "a = 2pi"

Wyświetl plik

@ -1,16 +0,0 @@
if(!exists("plotterm")) plotterm = 'wxt'
if(plotterm eq "pngcairo") set output 'img/sine_int.png'
set grid
set xlabel "x"
set lmargin at screen 0.10
set key left top
set terminal plotterm size 560,280 enhanced font 'Verdana,8'
set ylabel "Si(x), sinc(x)"
set yrange [-2:2]
plot 'dat/dat0.txt' with lines title "Si(x)", \
'dat/dat1.txt' with lines title "sinc(x)"

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 11 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 11 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 13 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 14 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 36 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 36 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 32 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 32 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 88 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 87 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 32 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 32 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 32 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 25 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 25 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 81 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 81 KiB

Plik binarny nie jest wyświetlany.

Przed

Szerokość:  |  Wysokość:  |  Rozmiar: 30 KiB

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 65 KiB

Plik diff jest za duży Load Diff

Wyświetl plik

@ -0,0 +1 @@
\relax

Plik binarny nie jest wyświetlany.

Wyświetl plik

@ -0,0 +1,106 @@
This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019/W32TeX) (preloaded format=latex 2019.12.29) 2 JAN 2020 18:08
entering extended mode
restricted \write18 enabled.
%&-line parsing enabled.
**_formulas.tex
(./_formulas.tex
LaTeX2e <2019-10-01> patch level 3
(c:/texlive/2019/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/10/25 v1.4k Standard LaTeX document class
(c:/texlive/2019/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2019/10/25 v1.4k Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
(c:/texlive/2019/texmf-dist/tex/latex/base/ifthen.sty
Package: ifthen 2014/09/29 v1.1c Standard LaTeX ifthen package (DPC)
)
(c:/texlive/2019/texmf-dist/tex/latex/graphics/epsfig.sty
Package: epsfig 2017/06/25 v1.7b (e)psfig emulation (SPQR)
(c:/texlive/2019/texmf-dist/tex/latex/graphics/graphicx.sty
Package: graphicx 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR)
(c:/texlive/2019/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks14
)
(c:/texlive/2019/texmf-dist/tex/latex/graphics/graphics.sty
Package: graphics 2019/11/01 v1.3d Standard LaTeX Graphics (DPC,SPQR)
(c:/texlive/2019/texmf-dist/tex/latex/graphics/trig.sty
Package: trig 2016/01/03 v1.10 sin cos tan (DPC)
)
(c:/texlive/2019/texmf-dist/tex/latex/graphics-cfg/graphics.cfg
File: graphics.cfg 2016/06/04 v1.11 sample graphics configuration
)
Package graphics Info: Driver file: dvips.def on input line 105.
(c:/texlive/2019/texmf-dist/tex/latex/graphics-def/dvips.def
File: dvips.def 2017/06/20 v3.1d Graphics/color driver for dvips
))
\Gin@req@height=\dimen103
\Gin@req@width=\dimen104
)
\epsfxsize=\dimen105
\epsfysize=\dimen106
)
(c:/texlive/2019/texmf-dist/tex/latex/base/inputenc.sty
Package: inputenc 2018/08/11 v1.3c Input encoding file
\inpenc@prehook=\toks15
\inpenc@posthook=\toks16
)
(c:/texlive/2019/texmf-dist/tex/latex/newunicodechar/newunicodechar.sty
Package: newunicodechar 2018/04/08 v1.2 Defining Unicode characters
)
(./_formulas.aux)
\openout1 = `_formulas.aux'.
LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 11.
LaTeX Font Info: ... okay on input line 11.
LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 11.
LaTeX Font Info: ... okay on input line 11.
LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 11.
LaTeX Font Info: ... okay on input line 11.
LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 11.
LaTeX Font Info: ... okay on input line 11.
LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 11.
LaTeX Font Info: ... okay on input line 11.
LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 11.
LaTeX Font Info: ... okay on input line 11.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <7> on input line 12.
LaTeX Font Info: External font `cmex10' loaded for size
(Font) <5> on input line 12.
[1
] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13]
[14] [15] [16] [17] [18] [19] [20] [21] [22] [23] [24] [25] [26] [27] [28]
[29] [30] [31] [32] [33] [34] [35] [36] [37] [38] [39] [40] [41] [42] [43]
[44] [45] [46] [47] [48] [49] [50] [51] [52] [53] [54] [55] [56] [57] [58]
[59] [60] [61] [62] [63] [64] [65] [66] [67] [68] [69] [70] [71] [72] [73]
[74] [75] [76] [77] [78] [79] [80] [81] [82] [83] [84] [85] [86] [87] [88]
[89] [90] [91] [92] [93] [94] [95] [96] [97] [98] [99] [100] [101] [102]
[103] [104] [105] [106] [107] [108] [109] [110] [111] [112] [113] [114]
[115] [116] [117] [118] [119] [120] [121] [122] [123] [124] [125] [126]
(./_formulas.aux) )
Here is how much of TeX's memory you used:
696 strings out of 492164
8713 string characters out of 6129101
70744 words of memory out of 5000000
5117 multiletter control sequences out of 15000+600000
3640 words of font info for 14 fonts, out of 8000000 for 9000
1141 hyphenation exceptions out of 8191
38i,6n,27p,290b,92s stack positions out of 5000i,500n,10000p,200000b,80000s
Output written on _formulas.dvi (126 pages, 17432 bytes).

Wyświetl plik

@ -0,0 +1,390 @@
\documentclass{article}
\usepackage{ifthen}
\usepackage{epsfig}
\usepackage[utf8]{inputenc}
\usepackage{newunicodechar}
\newunicodechar{}{${}^{-}$}% Superscript minus
\newunicodechar{²}{${}^{2}$}% Superscript two
\newunicodechar{³}{${}^{3}$}% Superscript three
\pagestyle{empty}
\begin{document}
\[ e = \max \left( \frac{|x(k) - y(k)| }{ |x(k)|} \right), \quad \quad |x(k)| > 0, \]
\pagebreak
\[ e = \max(|x(k) - y(k)| ), ~\qquad \quad~|x(k)| = 0, \]
\pagebreak
$ e$
\pagebreak
$ C_ord(x)$
\pagebreak
\[ C_ord(x) = 2 x C_{ord-1}(x) - C_{ord-2}(x), \]
\pagebreak
$ C_0(x) = 1 $
\pagebreak
$ C_1(x) = x$
\pagebreak
$ U_{ord}(x)$
\pagebreak
\[ U_{ord}(x) = 2 x U_{ord-1}(x) - U_{ord-2}(x), \]
\pagebreak
$ U_0(x) = 1 $
\pagebreak
$ U_1(x) = 2x$
\pagebreak
$ x = a + j b $
\pagebreak
\[ |x|^2 = x x^* = a^2 + b^2. \]
\pagebreak
\[ \textrm{Arccos}(x) = \frac{\pi}{2} - \textrm{Arcsin}(x) = \frac{\pi}{2} -j \textrm{Ln}\left( j x + \sqrt{1 - x^2} \right) \]
\pagebreak
\[ \textrm{Arcsin}(x) = j \textrm{Ln}\left( j x + \sqrt{1 - x^2} \right) \]
\pagebreak
\[ \textrm{cos}(x) = \frac{\exp(jx) + \exp(-jx)}{2} \]
\pagebreak
\[ \textrm{Ln}(x) = j \varphi + \ln(|x|), \]
\pagebreak
$\varphi$
\pagebreak
\[ \textrm{sin}(x) = \frac{\exp(jx) - \exp(-jx)}{2j} \]
\pagebreak
\[ y(k) = \sqrt{x(k)}, \qquad k = 0 \ldots n-1. \]
\pagebreak
$ c = a * b$
\pagebreak
$a$
\pagebreak
$b$
\pagebreak
$n = n_0 \times n_1 \times n_2 \times n_3 \times \ldots \times n_p \times m$
\pagebreak
$n_i = 2,3,5,7$
\pagebreak
$m $
\pagebreak
\[ H(z) = \frac{\sum_{n = 0}^{N} b_n z^{-n}} {1+{\frac{1}{a_0}}\sum_{m = 1}^{M} a_m z^{-m}}, \]
\pagebreak
$a_0$
\pagebreak
$N=M=$
\pagebreak
$s(t) = \sin(2\pi \cdot 0.05 t) + n(t)$
\pagebreak
$n(t)$
\pagebreak
$ n $
\pagebreak
$ x(m) $
\pagebreak
$ m = 0 \ldots n-1 $
\pagebreak
\[ Y(k) = \sum_{m = 0}^{n-1} x(m) \exp \left( -j \frac{2\pi}{n} m k \right), \]
\pagebreak
$ k = 0 \ldots n-1 $
\pagebreak
$x(m)$
\pagebreak
$n$
\pagebreak
$Y(k)$
\pagebreak
$ n^2 $
\pagebreak
\[ y(k) = \sum_{m = 0}^{n-1} x(m) \exp \left( j \frac{2\pi}{n} m k \right), \]
\pagebreak
$y(k)$
\pagebreak
$ u = \textrm{cd}^{-1}(w, k)$
\pagebreak
$ w $
\pagebreak
$ k $
\pagebreak
$ u = \textrm{sn}^{-1}(w, k)$
\pagebreak
$ y = \textrm{cd}(u K(k), k)$
\pagebreak
$ u $
\pagebreak
$ k_i $
\pagebreak
$ K(k) $
\pagebreak
\[ K(k) = \frac{\pi}{2} \prod_{i = 1}^{\infty}(1+k_i), \]
\pagebreak
$ k_0 = k$
\pagebreak
\[ k_i = \left( \frac{k_{i-1}} { 1+\sqrt{1-k_{i-1}^2} } \right)^2 \]
\pagebreak
$ k<1 $
\pagebreak
$ y = \textrm{sn}(u K(k), k)$
\pagebreak
\[ Y(k) = \frac{1}{N} \sum_{m = 0}^{n-1} x(m) \exp \left( j \frac{2\pi}{n} m k \right), \]
\pagebreak
$ n = 725760 $
\pagebreak
$725760 = 2 \cdot 3 \cdot 4 \cdot 5 \cdot 6 \cdot 7 \cdot 9 \cdot 16 $
\pagebreak
$ n = 172804 = 43201 \cdot 4 $
\pagebreak
$ n = 13 \cdot 17 \cdot 23 \cdot 13 = 66079 $
\pagebreak
$\sqrt{2^{31}} = 46340.95$
\pagebreak
$x_0$
\pagebreak
$x_1$
\pagebreak
$x(k) = x_0 + k \cdot dx$
\pagebreak
$dx = \frac{x_1 - x_0}{n-1}$
\pagebreak
$k = 0 \ldots n-1.$
\pagebreak
$dx = \frac{x_1 - x_0}{n}$
\pagebreak
$10^{x_0}$
\pagebreak
$10^{x_1}$
\pagebreak
$x(k) = 10^{x_0} \cdot dx^k$
\pagebreak
$dx = \sqrt[n-1]{10^{x_1 - x_0}}$
\pagebreak
$dx = \sqrt[n]{10^{x_1 - x_0}}$
\pagebreak
$ H(j \omega) $
\pagebreak
$ H(j \omega)$
\pagebreak
$ H(s) $
\pagebreak
\[ H(s) = \frac {\sum_{k = 0}^{N} b_k s^k} {\sum_{m = 0}^{N} a_m s^m}, \]
\pagebreak
$ N $
\pagebreak
$ s = j \omega $
\pagebreak
$ \omega $
\pagebreak
$H(s)$
\pagebreak
$H(z)$
\pagebreak
$ H \left(\mathrm{e}^{j\omega} \right) $
\pagebreak
$ 2\pi $
\pagebreak
$ \pi $
\pagebreak
$ -\pi $
\pagebreak
$ H \left(e^{j \omega} \right)$
\pagebreak
\[ H(z) = \frac {\sum_{k = 0}^{N} b_k z^{-k}} {\sum_{m = 0}^{N} a_m z^{-m}}, \]
\pagebreak
$N$
\pagebreak
$z = e^{j \omega} $
\pagebreak
$\omega$
\pagebreak
$ 2 \pi-$
\pagebreak
$2 \pi$
\pagebreak
$-\pi$
\pagebreak
$ \pi$
\pagebreak
$ H \left(e^{j \omega} \right) = H^* \left(e^{-j \omega} \right)$
\pagebreak
$\pi$
\pagebreak
$ -R_p $
\pagebreak
$ H(s)$
\pagebreak
$-R_p$
\pagebreak
$ R_p $
\pagebreak
$-R_s$
\pagebreak
$H(j\cdot 1) = -R_s$
\pagebreak
\[ H(s) = \frac{\sum_{n = 0}^{N_z} b_n \cdot s^n}{\sum_{m = 0}^{N_p} a_m \cdot s^m} = \frac{\prod_{n = 0}^{N_z}(s-z_n)}{\prod_{m = 0}^{N_p} (s-p_m)} \]
\pagebreak
$ F(s) $
\pagebreak
$F(s)$
\pagebreak
$Y(s) = (H \circ F)(s) = H(F(s))$
\pagebreak
\[ H(s) = \frac{\sum\limits_{m = 0}^{n} b_m s^m}{\sum\limits_{k = 0}^{n} a_k s^k}, \quad F(s) = \frac{\sum\limits_{m = 0}^{p} d_m s^m}{\sum\limits_{k = 0}^{p} c_k s^k}, \quad Y(s) = \frac{\sum\limits_{m = 0}^{n p} \beta_m s^m}{\sum\limits_{k = 0}^{n p} \alpha_k s^k} \]
\pagebreak
$Y(s) = (H \circ F)(s)$
\pagebreak
\[ s \leftarrow \frac{1 - z^{-1}}{1 - z^{-1}}. \]
\pagebreak
$\Omega$
\pagebreak
\[ \Omega = \tan(\omega / 2). \]
\pagebreak
\[ s(t) = \sum\limits_{n = 0}^{n_{\omega}-1} S(\omega_n) \exp(j\omega_n t) \]
\pagebreak
$\omega_n$
\pagebreak
$S(\omega_n)$
\pagebreak
$ I_0(x)$
\pagebreak
$ x $
\pagebreak
$[0 \ 3]$
\pagebreak
$ \textrm{sinc}(x,a) = \frac{\sin(ax)}{ax}$
\pagebreak
\[ \textrm{Si}(x) = \int_{0}^{x} \frac{\sin(x)}{x} \, dx\]
\pagebreak
$[-6\pi \ 6\pi]$
\pagebreak
$a_{ij}$
\pagebreak
$P_N(x)$
\pagebreak
$N-$
\pagebreak
\[ P_N(x) = a_0 + a_1 \cdot x + a_2 \cdot x^2 + a_3 \cdot x^3 + ... a_N \cdot x^N. \]
\pagebreak
\[ P_N(x) = a_0 + x \cdot (a_1 + x \cdot (a_2 + \cdot ( \ldots x \cdot (a_{N-1} + x\cdot a_N) \ldots ))) \]
\pagebreak
$10^{56}$
\pagebreak
\end{document}

Wyświetl plik

@ -1,126 +0,0 @@
\form#0:\[ e = \max \left( \frac{|x(k) - y(k)| }{ |x(k)|} \right), \quad \quad |x(k)| > 0, \]
\form#1:\[ e = \max(|x(k) - y(k)| ), ~\qquad \quad~|x(k)| = 0, \]
\form#2:$ e$
\form#3:$ C_ord(x)$
\form#4:\[ C_ord(x) = 2 x C_{ord-1}(x) - C_{ord-2}(x), \]
\form#5:$ C_0(x) = 1 $
\form#6:$ C_1(x) = x$
\form#7:$ U_{ord}(x)$
\form#8:\[ U_{ord}(x) = 2 x U_{ord-1}(x) - U_{ord-2}(x), \]
\form#9:$ U_0(x) = 1 $
\form#10:$ U_1(x) = 2x$
\form#11:$ x = a + j b $
\form#12:\[ |x|^2 = x x^* = a^2 + b^2. \]
\form#13:\[ \textrm{Arccos}(x) = \frac{\pi}{2} - \textrm{Arcsin}(x) = \frac{\pi}{2} -j \textrm{Ln}\left( j x + \sqrt{1 - x^2} \right) \]
\form#14:\[ \textrm{Arcsin}(x) = j \textrm{Ln}\left( j x + \sqrt{1 - x^2} \right) \]
\form#15:\[ \textrm{cos}(x) = \frac{\exp(jx) + \exp(-jx)}{2} \]
\form#16:\[ \textrm{Ln}(x) = j \varphi + \ln(|x|), \]
\form#17:$\varphi$
\form#18:\[ \textrm{sin}(x) = \frac{\exp(jx) - \exp(-jx)}{2j} \]
\form#19:\[ y(k) = \sqrt{x(k)}, \qquad k = 0 \ldots n-1. \]
\form#20:$ c = a * b$
\form#21:$a$
\form#22:$b$
\form#23:$n = n_0 \times n_1 \times n_2 \times n_3 \times \ldots \times n_p \times m$
\form#24:$n_i = 2,3,5,7$
\form#25:$m $
\form#26:\[ H(z) = \frac{\sum_{n = 0}^{N} b_n z^{-n}} {1+{\frac{1}{a_0}}\sum_{m = 1}^{M} a_m z^{-m}}, \]
\form#27:$a_0$
\form#28:$N=M=$
\form#29:$s(t) = \sin(2\pi \cdot 0.05 t) + n(t)$
\form#30:$n(t)$
\form#31:$ n $
\form#32:$ x(m) $
\form#33:$ m = 0 \ldots n-1 $
\form#34:\[ Y(k) = \sum_{m = 0}^{n-1} x(m) \exp \left( -j \frac{2\pi}{n} m k \right), \]
\form#35:$ k = 0 \ldots n-1 $
\form#36:$x(m)$
\form#37:$n$
\form#38:$Y(k)$
\form#39:$ n^2 $
\form#40:\[ y(k) = \sum_{m = 0}^{n-1} x(m) \exp \left( j \frac{2\pi}{n} m k \right), \]
\form#41:$y(k)$
\form#42:$ u = \textrm{cd}^{-1}(w, k)$
\form#43:$ w $
\form#44:$ k $
\form#45:$ u = \textrm{sn}^{-1}(w, k)$
\form#46:$ y = \textrm{cd}(u K(k), k)$
\form#47:$ u $
\form#48:$ k_i $
\form#49:$ K(k) $
\form#50:\[ K(k) = \frac{\pi}{2} \prod_{i = 1}^{\infty}(1+k_i), \]
\form#51:$ k_0 = k$
\form#52:\[ k_i = \left( \frac{k_{i-1}} { 1+\sqrt{1-k_{i-1}^2} } \right)^2 \]
\form#53:$ k<1 $
\form#54:$ y = \textrm{sn}(u K(k), k)$
\form#55:\[ Y(k) = \frac{1}{N} \sum_{m = 0}^{n-1} x(m) \exp \left( j \frac{2\pi}{n} m k \right), \]
\form#56:$ n = 725760 $
\form#57:$725760 = 2 \cdot 3 \cdot 4 \cdot 5 \cdot 6 \cdot 7 \cdot 9 \cdot 16 $
\form#58:$ n = 172804 = 43201 \cdot 4 $
\form#59:$ n = 13 \cdot 17 \cdot 23 \cdot 13 = 66079 $
\form#60:$\sqrt{2^{31}} = 46340.95$
\form#61:$x_0$
\form#62:$x_1$
\form#63:$x(k) = x_0 + k \cdot dx$
\form#64:$dx = \frac{x_1 - x_0}{n-1}$
\form#65:$k = 0 \ldots n-1.$
\form#66:$dx = \frac{x_1 - x_0}{n}$
\form#67:$10^{x_0}$
\form#68:$10^{x_1}$
\form#69:$x(k) = 10^{x_0} \cdot dx^k$
\form#70:$dx = \sqrt[n-1]{10^{x_1 - x_0}}$
\form#71:$dx = \sqrt[n]{10^{x_1 - x_0}}$
\form#72:$ H(j \omega) $
\form#73:$ H(j \omega)$
\form#74:$ H(s) $
\form#75:\[ H(s) = \frac {\sum_{k = 0}^{N} b_k s^k} {\sum_{m = 0}^{N} a_m s^m}, \]
\form#76:$ N $
\form#77:$ s = j \omega $
\form#78:$ \omega $
\form#79:$H(s)$
\form#80:$H(z)$
\form#81:$ H \left(\mathrm{e}^{j\omega} \right) $
\form#82:$ 2\pi $
\form#83:$ \pi $
\form#84:$ -\pi $
\form#85:$ H \left(e^{j \omega} \right)$
\form#86:\[ H(z) = \frac {\sum_{k = 0}^{N} b_k z^{-k}} {\sum_{m = 0}^{N} a_m z^{-m}}, \]
\form#87:$N$
\form#88:$z = e^{j \omega} $
\form#89:$\omega$
\form#90:$ 2 \pi-$
\form#91:$2 \pi$
\form#92:$-\pi$
\form#93:$ \pi$
\form#94:$ H \left(e^{j \omega} \right) = H^* \left(e^{-j \omega} \right)$
\form#95:$\pi$
\form#96:$ -R_p $
\form#97:$ H(s)$
\form#98:$-R_p$
\form#99:$ R_p $
\form#100:$-R_s$
\form#101:$H(j\cdot 1) = -R_s$
\form#102:\[ H(s) = \frac{\sum_{n = 0}^{N_z} b_n \cdot s^n}{\sum_{m = 0}^{N_p} a_m \cdot s^m} = \frac{\prod_{n = 0}^{N_z}(s-z_n)}{\prod_{m = 0}^{N_p} (s-p_m)} \]
\form#103:$ F(s) $
\form#104:$F(s)$
\form#105:$Y(s) = (H \circ F)(s) = H(F(s))$
\form#106:\[ H(s) = \frac{\sum\limits_{m = 0}^{n} b_m s^m}{\sum\limits_{k = 0}^{n} a_k s^k}, \quad F(s) = \frac{\sum\limits_{m = 0}^{p} d_m s^m}{\sum\limits_{k = 0}^{p} c_k s^k}, \quad Y(s) = \frac{\sum\limits_{m = 0}^{n p} \beta_m s^m}{\sum\limits_{k = 0}^{n p} \alpha_k s^k} \]
\form#107:$Y(s) = (H \circ F)(s)$
\form#108:\[ s \leftarrow \frac{1 - z^{-1}}{1 - z^{-1}}. \]
\form#109:$\Omega$
\form#110:\[ \Omega = \tan(\omega / 2). \]
\form#111:\[ s(t) = \sum\limits_{n = 0}^{n_{\omega}-1} S(\omega_n) \exp(j\omega_n t) \]
\form#112:$\omega_n$
\form#113:$S(\omega_n)$
\form#114:$ I_0(x)$
\form#115:$ x $
\form#116:$[0 \ 3]$
\form#117:$ \textrm{sinc}(x,a) = \frac{\sin(ax)}{ax}$
\form#118:\[ \textrm{Si}(x) = \int_{0}^{x} \frac{\sin(x)}{x} \, dx\]
\form#119:$[-6\pi \ 6\pi]$
\form#120:$a_{ij}$
\form#121:$P_N(x)$
\form#122:$N-$
\form#123:\[ P_N(x) = a_0 + a_1 \cdot x + a_2 \cdot x^2 + a_3 \cdot x^3 + ... a_N \cdot x^N. \]
\form#124:\[ P_N(x) = a_0 + x \cdot (a_1 + x \cdot (a_2 + \cdot ( \ldots x \cdot (a_{N-1} + x\cdot a_N) \ldots ))) \]
\form#125:$10^{56}$

Wyświetl plik

@ -1,4 +1,4 @@
# Doxyfile 1.8.15
# Doxyfile 1.8.17
# This file describes the settings to be used by the documentation system
# doxygen (www.doxygen.org) for a project.
@ -197,6 +197,16 @@ SHORT_NAMES = NO
JAVADOC_AUTOBRIEF = NO
# If the JAVADOC_BANNER tag is set to YES then doxygen will interpret a line
# such as
# /***************
# as being the beginning of a Javadoc-style comment "banner". If set to NO, the
# Javadoc-style will behave just like regular comments and it will not be
# interpreted by doxygen.
# The default value is: NO.
JAVADOC_BANNER = NO
# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first
# line (until the first dot) of a Qt-style comment as the brief description. If
# set to NO, the Qt-style will behave just like regular Qt-style comments (thus
@ -299,7 +309,7 @@ OPTIMIZE_OUTPUT_SLICE = NO
# parses. With this tag you can assign which parser to use for a given
# extension. Doxygen has a built-in mapping, but you can override or extend it
# using this tag. The format is ext=language, where ext is a file extension, and
# language is one of the parsers supported by doxygen: IDL, Java, Javascript,
# language is one of the parsers supported by doxygen: IDL, Java, JavaScript,
# Csharp (C#), C, C++, D, PHP, md (Markdown), Objective-C, Python, Slice,
# Fortran (fixed format Fortran: FortranFixed, free formatted Fortran:
# FortranFree, unknown formatted Fortran: Fortran. In the later case the parser
@ -329,7 +339,7 @@ MARKDOWN_SUPPORT = YES
# to that level are automatically included in the table of contents, even if
# they do not have an id attribute.
# Note: This feature currently applies only to Markdown headings.
# Minimum value: 0, maximum value: 99, default value: 0.
# Minimum value: 0, maximum value: 99, default value: 5.
# This tag requires that the tag MARKDOWN_SUPPORT is set to YES.
TOC_INCLUDE_HEADINGS = 0
@ -465,6 +475,12 @@ EXTRACT_ALL = YES
EXTRACT_PRIVATE = NO
# If the EXTRACT_PRIV_VIRTUAL tag is set to YES, documented private virtual
# methods of a class will be included in the documentation.
# The default value is: NO.
EXTRACT_PRIV_VIRTUAL = NO
# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal
# scope will be included in the documentation.
# The default value is: NO.
@ -519,8 +535,8 @@ HIDE_UNDOC_MEMBERS = NO
HIDE_UNDOC_CLASSES = NO
# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend
# (class|struct|union) declarations. If set to NO, these declarations will be
# included in the documentation.
# declarations. If set to NO, these declarations will be included in the
# documentation.
# The default value is: NO.
HIDE_FRIEND_COMPOUNDS = NO
@ -543,7 +559,7 @@ INTERNAL_DOCS = NO
# names in lower-case letters. If set to YES, upper-case letters are also
# allowed. This is useful if you have classes or files whose names only differ
# in case and if your file system supports case sensitive file names. Windows
# and Mac users are advised to set this option to NO.
# (including Cygwin) ands Mac users are advised to set this option to NO.
# The default value is: system dependent.
CASE_SENSE_NAMES = NO
@ -816,9 +832,8 @@ WARN_LOGFILE =
INPUT = ru \
../src \
../../include \
../../examples/src \
../../bin/gnuplot \
../../bin/img
../../bin/img \
../../examples/src
# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
@ -840,8 +855,10 @@ INPUT_ENCODING = UTF-8
# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp,
# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h,
# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc,
# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08,
# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf, *.qsf and *.ice.
# *.m, *.markdown, *.md, *.mm, *.dox (to be provided as doxygen C comment),
# *.doc (to be provided as doxygen C comment), *.txt (to be provided as doxygen
# C comment), *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, *.f, *.for, *.tcl, *.vhd,
# *.vhdl, *.ucf, *.qsf and *.ice.
FILE_PATTERNS = *.c \
*.cc \
@ -935,7 +952,6 @@ EXCLUDE_SYMBOLS =
# command).
EXAMPLE_PATH = ../../examples/src \
../../bin/gnuplot \
../../bin/img
# If the value of the EXAMPLE_PATH tag contains directories, you can use the
@ -1287,9 +1303,9 @@ HTML_TIMESTAMP = YES
# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML
# documentation will contain a main index with vertical navigation menus that
# are dynamically created via Javascript. If disabled, the navigation index will
# are dynamically created via JavaScript. If disabled, the navigation index will
# consists of multiple levels of tabs that are statically embedded in every HTML
# page. Disable this option to support browsers that do not have Javascript,
# page. Disable this option to support browsers that do not have JavaScript,
# like the Qt help browser.
# The default value is: YES.
# This tag requires that the tag GENERATE_HTML is set to YES.
@ -1440,7 +1456,7 @@ QCH_FILE =
# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help
# Project output. For more information please see Qt Help Project / Namespace
# (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
# (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#namespace).
# The default value is: org.doxygen.Project.
# This tag requires that the tag GENERATE_QHP is set to YES.
@ -1448,7 +1464,7 @@ QHP_NAMESPACE = org.doxygen.Project
# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt
# Help Project output. For more information please see Qt Help Project / Virtual
# Folders (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-
# Folders (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#virtual-
# folders).
# The default value is: doc.
# This tag requires that the tag GENERATE_QHP is set to YES.
@ -1457,7 +1473,7 @@ QHP_VIRTUAL_FOLDER = doc
# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom
# filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
@ -1465,7 +1481,7 @@ QHP_CUST_FILTER_NAME =
# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the
# custom filter to add. For more information please see Qt Help Project / Custom
# Filters (see: http://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# Filters (see: https://doc.qt.io/archives/qt-4.8/qthelpproject.html#custom-
# filters).
# This tag requires that the tag GENERATE_QHP is set to YES.
@ -1473,7 +1489,7 @@ QHP_CUST_FILTER_ATTRS =
# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this
# project's filter section matches. Qt Help Project / Filter Attributes (see:
# http://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
# https://doc.qt.io/archives/qt-4.8/qthelpproject.html#filter-attributes).
# This tag requires that the tag GENERATE_QHP is set to YES.
QHP_SECT_FILTER_ATTRS =
@ -1577,8 +1593,14 @@ FORMULA_FONTSIZE = 14
FORMULA_TRANSPARENT = YES
# The FORMULA_MACROFILE can contain LaTeX \newcommand and \renewcommand commands
# to create new LaTeX commands to be used in formulas as building blocks. See
# the section "Including formulas" for details.
FORMULA_MACROFILE =
# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see
# https://www.mathjax.org) which uses client side Javascript for the rendering
# https://www.mathjax.org) which uses client side JavaScript for the rendering
# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX
# installed or if you want to formulas look prettier in the HTML output. When
# enabled you may also need to install MathJax separately and configure the path
@ -1586,7 +1608,7 @@ FORMULA_TRANSPARENT = YES
# The default value is: NO.
# This tag requires that the tag GENERATE_HTML is set to YES.
USE_MATHJAX = NO
USE_MATHJAX = YES
# When MathJax is enabled you can set the default output format to be used for
# the MathJax output. See the MathJax site (see:
@ -1648,7 +1670,7 @@ MATHJAX_CODEFILE =
SEARCHENGINE = NO
# When the SERVER_BASED_SEARCH tag is enabled the search engine will be
# implemented using a web server instead of a web client using Javascript. There
# implemented using a web server instead of a web client using JavaScript. There
# are two flavors of web server based searching depending on the EXTERNAL_SEARCH
# setting. When disabled, doxygen will generate a PHP script for searching and
# an index file used by the script. When EXTERNAL_SEARCH is enabled the indexing
@ -1752,10 +1774,11 @@ LATEX_CMD_NAME = latex
MAKEINDEX_CMD_NAME = makeindex
# The LATEX_MAKEINDEX_CMD tag can be used to specify the command name to
# generate index for LaTeX.
# generate index for LaTeX. In case there is no backslash (\) as first character
# it will be automatically added in the LaTeX code.
# Note: This tag is used in the generated output file (.tex).
# See also: MAKEINDEX_CMD_NAME for the part in the Makefile / make.bat.
# The default value is: \makeindex.
# The default value is: makeindex.
# This tag requires that the tag GENERATE_LATEX is set to YES.
LATEX_MAKEINDEX_CMD = \makeindex
@ -2249,12 +2272,6 @@ EXTERNAL_GROUPS = YES
EXTERNAL_PAGES = YES
# The PERL_PATH should be the absolute path and name of the perl script
# interpreter (i.e. the result of 'which perl').
# The default file (with absolute path) is: /usr/bin/perl.
PERL_PATH = /usr/bin/perl
#---------------------------------------------------------------------------
# Configuration options related to the dot tool
#---------------------------------------------------------------------------
@ -2268,15 +2285,6 @@ PERL_PATH = /usr/bin/perl
CLASS_DIAGRAMS = NO
# You can define message sequence charts within doxygen comments using the \msc
# command. Doxygen will then run the mscgen tool (see:
# http://www.mcternan.me.uk/mscgen/)) to produce the chart and insert it in the
# documentation. The MSCGEN_PATH tag allows you to specify the directory where
# the mscgen tool resides. If left empty the tool is assumed to be found in the
# default search path.
MSCGEN_PATH =
# You can include diagrams made with dia in doxygen documentation. Doxygen will
# then run dia to produce the diagram and insert it in the documentation. The
# DIA_PATH tag allows you to specify the directory where the dia binary resides.

Wyświetl plik

@ -10,7 +10,8 @@
\ingroup ERROR_CODE_GROUP
\def ERROR_ELLIP_K
\brief Модуль эллиптического интеграла Якоби должен быть от 0 до 1.
Данная ошибка возникает при расчете эллиптических функций Якоби при неверном задании параметра эллиптического модуля.
Данная ошибка возникает при расчете эллиптических функций Якоби
при неверном задании параметра эллиптического модуля.
Функция завершает работу и возвращает данный код ошибки.
*/
@ -25,7 +26,8 @@
/*!
\ingroup ERROR_CODE_GROUP
\def ERROR_FILTER_ORD
\brief Порядок фильтра задан неверно. Порядок фильтра должен быть задан положительным целым значением.
\brief Порядок фильтра задан неверно.
Порядок фильтра должен быть задан положительным целым значением.
*/
@ -78,7 +80,8 @@
/*!
\ingroup ERROR_CODE_GROUP
\def ERROR_FOPEN
\brief Ошибка открытия файла. Файл с заданным именем не может быть открыт для записи и чтения.
\brief Ошибка открытия файла.
Файл с заданным именем не может быть открыт для записи и чтения.
*/
@ -87,7 +90,36 @@
/*!
\ingroup ERROR_CODE_GROUP
\def ERROR_FS
\brief Частота дискретизации задана неверно. Частота дискретизации должна быть положительным числом.
\brief Частота дискретизации задана неверно.
Частота дискретизации должна быть положительным числом.
*/
/*!
\ingroup ERROR_CODE_GROUP
\def ERROR_FFT_SIZE
\brief Неверно задан размер БПФ.
*/
/*!
\ingroup ERROR_CODE_GROUP
\def ERROR_GNUPLOT_CREATE
\brief Невозможно подключиться к пакету GNUPLOT.
Пожалуйста проверьте, что пакет доступен.
*/
/*!
\ingroup ERROR_CODE_GROUP
\def ERROR_GNUPLOT_TERM
\brief Неизвестный параметра вызова программы, задающий терминал GNUPLOT.\n
Данный параметр может принимать одно из следюущих значений:\n
`--noplot` построение графика не производиться;\n
`--plotwin` построение графиков производиться в отельном окне (окнах);\n
`--plotpng` построение графиков производиться в png - файл.\n
*/
@ -109,7 +141,8 @@
\def ERROR_SIZE
\brief Ошибка при передаче размера массива.
Данная ошибка возникает когда помимо указателя
на массив входных или выходных данных передается неверный размер массива (меньше или равный нулю).
на массив входных или выходных данных передается неверный
размер массива (меньше или равный нулю).
При возникновении данной ошибки,
функция завершает работу и возвращает данный код ошибки.
*/

Wyświetl plik

@ -0,0 +1,79 @@
/*! ****************************************************************************
\ingroup PLOT_GROUP
\fn int gnuplot_create(int argc, char* argv[], int w, int h, char* fn_png,
void** hplot)
\brief Создать график GNUPLOT.
Данная функция открывает пакет GNUPLOT в зависимости от передаваемых в программу
параметров `argv`. После вызова данной функции по адресу `hplot` будет записан
handle графика и появляется возможность посылать GNUPLOT команды для отображения
графиков.
\note С точки зрения системы, `hplot` является указателем на открытый файл,
в который можно записывать команды для исполнения пакетом GNUPLOT.
\param[in] argc Количество аргументов вызова программы. \n
(количество переменных `argv`). \n
Данное значение не должно быть меньше единицы,
потому что `argv[0]` хранит имя исполняемого
файла программы.\n \n
\param[in] argv Указатель на массив строк параметров исполняемого файла. \n
Размер массива `argc` строк. \n
`argv[0]` хранит имя исполняемого файла программы. \n
`argv[1]` задает формат отображения графика: \n
`--plotwin` отображать график в отдельном окне
(данный параметр используется по умолчанию);\n
`--plotpng` сохранить график в png-файл, заданный именем
`fn_png`; \n
`--noplot` график не создавать, игнорировать все команды
GNUPLOT.\n \n
\param[in] w Ширина окна графика или png-файла в пикселях. \n \n
\param[in] h Высота окна графика или png-файла в пикселях. \n \n
\param[in] fn_png Имя png-файла, в который будет сохранен график. \n
Путь сохранения графика совпадает с путем исполняемого файла
программы. \n
\param[in, out] hplot Указатель на адрес хэндла пакета GNUPLOT. \n
По данному адресу будет записан указатель
на текщий график. \n \n
\return
`RES_OK` если функция выполнена успешно. \n
В противном случае \ref ERROR_CODE_GROUP "код ошибки".\n
При возникновении ошибки по адресу `hplot` будет записан `NULL`.\n
\note Если в `argv[1]` задан параметр `--noplot`, то функция вернет `RES_OK`,
но по адресу `hplot` также будет записан `NULL`.
\n
После построения графиков необходимо закрыть хэндл GNUPLOT функцией
\ref `gnuplot_close`.
Пример построения графиков синуса и косинуса привден в следующем листинге:
\include gnuplot_script_test.c
Данная программа рассчитвает значения функций синуса и косинуса,
а также сохрянет текстовые файлы `dat/cosine.txt` и `dat/sine.txt`.\n
Сохраненные данные отображаются на трех графиках (с данными синуса, косинуса
и обоими данными):
\image html gnuplot_script_sin.png
\image html gnuplot_script_cos.png
\image html gnuplot_script_sincos.png
\author Бахурин Сергей, www.dsplib.org
**************************************************************************** */

Wyświetl plik

@ -52,6 +52,10 @@
\defgroup IN_OUT_GROUP Функции ввода - вывода данных
Функции ввода и вывода данных. Запись и считывание данных в бинарные и текстовые файлы
\defgroup PLOT_GROUP Функции построения графиков.
\defgroup ERROR_CODE_GROUP Коды ошибок при вызове функций
В данной группе приведены возможные коды ошибок, возвращаемые функциями библиотеки в процессе
работы.

Wyświetl plik

@ -3,7 +3,7 @@
\mainpage DSPL-2.0 - библиотека алгоритмов цифровой обработки сигналов.
DSPL-2.0 - свободная библиотека алгоритмов цифровой обработки сигналов,
с открытым исходным кодом, написанная на языке Си.<BR>
с открытым исходным кодом, написанная на языке Си.\n
Распространяется под лицензией
<a href = "http://www.gnu.org/licenses/lgpl.html">LGPL v3.</a>
@ -12,12 +12,12 @@ DSPL-2.0 - свободная библиотека алгоритмов цифр
Исходные коды библиотеки доступны на
<a href = "https://github.com/Dsplib/libdspl-2.0">GitHub</a>.<BR>
<a href = "https://github.com/Dsplib/libdspl-2.0">GitHub</a>.\n
Вы также можете внести свой вклад в развитие данной библиотеки. Присоединяйтесь!
Для начала работы с библиотекой необходимо ознакомиться с разделом:
\ref getting_started_toolchain <BR>
\ref getting_started_toolchain \n
<H3>
@ -26,33 +26,35 @@ DSPL-2.0 - свободная библиотека алгоритмов цифр
\ref TYPES_GROUP <BR>
\ref TYPES_GROUP \n \n
<B>Математические функции представлены следующими разделами:</B> <BR>
\ref SPEC_MATH_COMMON_GROUP <BR>
\ref SPEC_MATH_TRIG_GROUP <BR>
\ref SPEC_MATH_TRANSCEND <BR>
\ref SPEC_MATH_ELLIP_GROUP <BR>
\ref SPEC_MATH_RAND_GEN_GROUP <BR>
\ref SPEC_MATH_STAT_GROUP <BR>
\ref SPEC_MATH_LINALG_GROUP <BR><BR>
<B>Математические функции представлены следующими разделами:</B> \n
\ref SPEC_MATH_COMMON_GROUP \n
\ref SPEC_MATH_TRIG_GROUP \n
\ref SPEC_MATH_TRANSCEND \n
\ref SPEC_MATH_ELLIP_GROUP \n
\ref SPEC_MATH_RAND_GEN_GROUP \n
\ref SPEC_MATH_STAT_GROUP \n
\ref SPEC_MATH_LINALG_GROUP \n \n
<B>Алгоритмы спектрального анализа:</B><BR>
\ref DFT_GROUP <BR>
\ref WIN_GROUP <BR>
\ref HILBERT_GROUP <BR>
<B>Алгоритмы спектрального анализа:</B>\n
\ref DFT_GROUP \n
\ref WIN_GROUP \n
\ref HILBERT_GROUP \n \n
<B>Расчет и анализ аналоговых и цифровых фильтров:</B><BR>
\ref FILTER_CONV_GROUP <BR>
\ref IIR_FILTER_DESIGN_GROUP <BR>
\ref FIR_FILTER_DESIGN_GROUP <BR>
\ref FILTER_ANALYSIS_GROUP <BR>
<B>Расчет и анализ аналоговых и цифровых фильтров:</B>\n
\ref FILTER_CONV_GROUP \n
\ref IIR_FILTER_DESIGN_GROUP \n
\ref FIR_FILTER_DESIGN_GROUP \n
\ref FILTER_ANALYSIS_GROUP \n \n
<B>Прочие алгоритмы:</B><BR>
\ref RESAMPLING_GROUP <BR>
\ref IN_OUT_GROUP <BR>
<B>Прочие алгоритмы:</B>\n
\ref RESAMPLING_GROUP \n
\ref IN_OUT_GROUP \n \n
<BR>
\ref ERROR_CODE_GROUP <BR>
\ref PLOT_GROUP \n
\n
\ref ERROR_CODE_GROUP \n
*/

132
dspl/src/gnuplot.c 100644
Wyświetl plik

@ -0,0 +1,132 @@
/*
* Copyright (c) 2015-2019 Sergey Bakhurin
* Digital Signal Processing Library [http://dsplib.org]
*
* This file is part of DSPL.
*
* is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* DSPL is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Foobar. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdio.h>
#include <unistd.h>
#include "dspl.h"
#define GNUPLOT_NO 1
#define GNUPLOT_WIN 2
#define GNUPLOT_PNG 3
/*******************************************************************************
Create Gnuplot header
*******************************************************************************/
int DSPL_API gnuplot_create(int argc, char* argv[],
int w, int h, char* fn_png,
void** hplot)
{
FILE* hp;
char str[1024] = {0};
int state = 0;
int err;
if(argc>1 && !argv)
return ERROR_ARG_PARAM;
if(argc < 2)
state = GNUPLOT_WIN;
else
{
if(!strcmp(argv[1], "--noplot"))
state = GNUPLOT_NO;
if(!strcmp(argv[1], "--plotwin"))
state = GNUPLOT_WIN;
if(!strcmp(argv[1], "--plotpng"))
state = GNUPLOT_PNG;
}
switch(state)
{
case GNUPLOT_NO:
hp = NULL;
err = RES_OK;
break;
case GNUPLOT_WIN:
hp = popen("gnuplot -p", "w");
if(!hp)
return ERROR_GNUPLOT_CREATE;
memset(str, 0, 1024*sizeof(char));
sprintf(str, "set terminal wxt size %d,%d", w,h);
gnuplot_cmd(hp, str);
err = RES_OK;
break;
case GNUPLOT_PNG:
if(!fn_png)
return ERROR_GNUPLOT_FNPNG;
hp = popen("gnuplot -p", "w");
if(!hp)
return ERROR_GNUPLOT_CREATE;
memset(str, 0, 1024*sizeof(char));
sprintf(str,
"set terminal pngcairo size %d,%d enhanced font 'Verdana,8'", w,h);
gnuplot_cmd(hp, str);
memset(str, 0, 1024*sizeof(char));
sprintf(str, "set output '%s'", fn_png);
gnuplot_cmd(hp, str);
err = RES_OK;
break;
default:
err = ERROR_GNUPLOT_TERM;
hp = NULL;
}
*hplot = hp;
return err;
}
/*******************************************************************************
Write Guplot Command
*******************************************************************************/
void DSPL_API gnuplot_cmd(void* h, char* cmd)
{
if(h)
{
FILE *pf = (FILE*)h;
fprintf(pf, cmd);
fflush(pf);
fprintf(pf, "\n");
fflush(pf);
}
}
/*******************************************************************************
Close Gnuplot
*******************************************************************************/
void DSPL_API gnuplot_close(void* h)
{
if(h)
fclose((FILE*)h);
}

Wyświetl plik

@ -237,7 +237,7 @@ int DSPL_API writetxt(double* x, double* y, int n, char* fn)
{
int k;
FILE* pFile = NULL;
int res;
if(!x)
return ERROR_PTR;
if(n < 1)
@ -252,10 +252,12 @@ int DSPL_API writetxt(double* x, double* y, int n, char* fn)
if(y)
for(k = 0; k < n; k++)
fprintf(pFile, "%+.12E\t%+.12E\n", x[k], y[k]);
else
for(k = 0; k < n; k++)
for(k = 0; k < n; k++)
fprintf(pFile, "%+.12E\n", x[k]);
fclose(pFile);
return RES_OK;
}

Wyświetl plik

@ -5,24 +5,45 @@
#define N 50
/******************************************************************************
* Main function
******************************************************************************/
int main(int argc, char* argv[])
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
void* hdspl; /* DSPL handle */
void* hplot; /* GNUPLOT handle */
double x[N], y[N];
/* Load DSPL function */
hdspl = dspl_load();
/* x in [0, 3] */
linspace(0.0, 3.0, N, DSPL_SYMMETRIC, x);
bessel_i0(x, N, y);
/* Bessel I0(x) function */
bessel_i0(x, N, y);
/* Write calculated values to the dat/dat0.txt file */
writetxt(x, y, N, "dat/dat0.txt");
/* run GNUPLOT script */
gnuplot_script(argc, argv, "gnuplot/bessel_i0.plt");
dspl_free(handle); // free dspl handle
/* plotting by GNUPLOT */
gnuplot_create(argc, argv, 560, 380, "img/bessel_i0.png", &hplot);
gnuplot_cmd(hplot, "set grid");
gnuplot_cmd(hplot, "set xlabel 'x'");
gnuplot_cmd(hplot, "set key left top");
gnuplot_cmd(hplot, "set ylabel 'I_0(x)'");
gnuplot_cmd(hplot, "set yrange [0:5]");
gnuplot_cmd(hplot, "plot 'dat/dat0.txt' with lines");
gnuplot_close(hplot);
/* free dspl handle */
dspl_free(hdspl);
return 0;
}
}

Wyświetl plik

@ -8,8 +8,9 @@
int main(int argc, char* argv[])
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
void* hdspl; /* DSPL handle */
void* hplot; /* GNUPLOT handle */
hdspl = dspl_load(); // Load DSPL function
double w[N], h[N];
complex_t hz[N];
@ -49,10 +50,17 @@ int main(int argc, char* argv[])
writetxt(w,h,N,"dat/bilinear.txt");
/* run GNUPLOT script */
err = gnuplot_script(argc, argv, "gnuplot/bilinear_test.plt");
/* plotting by GNUPLOT */
gnuplot_create(argc, argv, 560, 380, "img/bilinear.png", &hplot);
gnuplot_cmd(hplot, "set grid");
gnuplot_cmd(hplot, "unset key");
gnuplot_cmd(hplot, "set xlabel 'normalized frequency'");
gnuplot_cmd(hplot, "set ylabel 'Magnitude, dB'");
gnuplot_cmd(hplot, "set yrange [-80:5]");
gnuplot_cmd(hplot, "plot 'dat/bilinear.txt' with lines");
gnuplot_close(hplot);
dspl_free(handle); // free dspl handle
dspl_free(hdspl); // free dspl handle
return err;
}

Wyświetl plik

@ -9,8 +9,11 @@
int main(int argc, char* argv[])
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
void* hdspl; /* DSPL handle */
void* hplot; /* GNUPLOT handle */
/* Load DSPL functions */
hdspl = dspl_load();
double a[ORD+1], b[ORD+1];
double Rp = 1.0;
@ -35,10 +38,28 @@ int main(int argc, char* argv[])
writetxt(w, phi, N, "dat/butter_ap_test_phi.txt");
writetxt(w, tau, N, "dat/butter_ap_test_tau.txt");
/* run GNUPLOT script */
res = gnuplot_script(argc, argv, "gnuplot/butter_ap_test.plt");
dspl_free(handle); // free dspl handle
/* plotting by GNUPLOT */
gnuplot_create(argc, argv, 920, 260, "img/butter_ap_test.png", &hplot);
gnuplot_cmd(hplot, "set logscale x");
gnuplot_cmd(hplot, "unset key");
gnuplot_cmd(hplot, "set grid");
gnuplot_cmd(hplot, "set xlabel 'frequency, rad/s'");
gnuplot_cmd(hplot, "set multiplot layout 1,3 rowsfirst");
gnuplot_cmd(hplot, "set ylabel 'Magnitude, dB'");
gnuplot_cmd(hplot, "set yrange [-100:5]");
gnuplot_cmd(hplot, "plot 'dat/butter_ap_test_mag.txt' with lines");
gnuplot_cmd(hplot, "set ylabel 'Phase response, rad'");
gnuplot_cmd(hplot, "unset yrange");
gnuplot_cmd(hplot, "plot 'dat/butter_ap_test_phi.txt' with lines");
gnuplot_cmd(hplot, "set ylabel 'Groupdelay, sec'");
gnuplot_cmd(hplot, "unset yrange");
gnuplot_cmd(hplot, "plot 'dat/butter_ap_test_tau.txt' with lines");
gnuplot_cmd(hplot, "unset multiplot");
gnuplot_close(hplot);
dspl_free(hdspl); // free dspl handle
return res;
}

Wyświetl plik

@ -3,17 +3,18 @@
#include <string.h>
#include "dspl.h"
// Порядок фильтра
/* Порядок фильтра */
#define ORD 4
// размер векторов частотной характериситки фильтра
/* размер векторов частотной характериситки фильтра */
#define N 1000
int main(int argc, char* argv[])
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
void* hdspl; /* DSPL handle */
void* hplot; /* GNUPLOT handle */
hdspl = dspl_load(); /* Load DSPL function */
double a[ORD+1], b[ORD+1]; // коэффицинеты H(s)
double Rp = 3.0; // неравномерность в полосе пропускания 3дБ
@ -43,11 +44,27 @@ int main(int argc, char* argv[])
writetxt(w, phi, N, "dat/cheby1_ap_test_phi.txt");
writetxt(w, tau, N, "dat/cheby1_ap_test_tau.txt");
/* run GNUPLOT script */
res = gnuplot_script(argc, argv, "gnuplot/cheby1_ap_test.plt");
/* plotting by GNUPLOT */
gnuplot_create(argc, argv, 920, 260, "img/cheby1_ap_test.png", &hplot);
gnuplot_cmd(hplot, "set logscale x");
gnuplot_cmd(hplot, "unset key");
gnuplot_cmd(hplot, "set grid");
gnuplot_cmd(hplot, "set xlabel 'frequency, rad/s'");
gnuplot_cmd(hplot, "set multiplot layout 1,3 rowsfirst");
gnuplot_cmd(hplot, "set ylabel 'Magnitude, dB'");
gnuplot_cmd(hplot, "set yrange [-100:5]");
gnuplot_cmd(hplot, "plot 'dat/cheby1_ap_test_mag.txt' with lines");
gnuplot_cmd(hplot, "set ylabel 'Phase response, rad'");
gnuplot_cmd(hplot, "unset yrange");
gnuplot_cmd(hplot, "plot 'dat/cheby1_ap_test_phi.txt' with lines");
gnuplot_cmd(hplot, "set ylabel 'Groupdelay, sec'");
gnuplot_cmd(hplot, "unset yrange");
gnuplot_cmd(hplot, "plot 'dat/cheby1_ap_test_tau.txt' with lines");
gnuplot_cmd(hplot, "unset multiplot");
gnuplot_close(hplot);
dspl_free(handle); // free dspl handle
dspl_free(hdspl); // free dspl handle
return res;
}

Wyświetl plik

@ -6,8 +6,8 @@
int main()
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
void* handle; /* DSPL handle */
handle = dspl_load(); /* Load DSPL functions */
complex_t z[ORD], p[ORD];
int nz, np, k;
@ -25,7 +25,7 @@ int main()
for(k = 0; k < np; k++)
printf("p[%2d] = %9.3f %9.3f j\n", k, RE(p[k]), IM(p[k]));
dspl_free(handle); // free dspl handle
dspl_free(handle); /* free dspl handle */
return 0;
}

Wyświetl plik

@ -7,8 +7,9 @@
int main(int argc, char* argv[])
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
void* hdspl; /* DSPL handle */
void* hplot; /* GNUPLOT handle */
hdspl = dspl_load(); // Load DSPL function
double x[N], y[N];
int ord;
@ -21,12 +22,21 @@ int main(int argc, char* argv[])
sprintf(fn, "dat/cheby_poly1_ord%d.txt", ord);
writetxt(x,y,N,fn);
}
/* plotting by GNUPLOT */
gnuplot_create(argc, argv, 560, 380, "img/cheby_poly1.png", &hplot);
gnuplot_cmd(hplot, "set grid");
gnuplot_cmd(hplot, "set key left top");
gnuplot_cmd(hplot, "set xlabel 'x'");
gnuplot_cmd(hplot, "set ylabel 'C_N(x)'");
gnuplot_cmd(hplot, "set yrange [-1.5:1.5]");
gnuplot_cmd(hplot, "plot 'dat/cheby_poly1_ord1.txt' with lines, \\");
gnuplot_cmd(hplot, " 'dat/cheby_poly1_ord2.txt' with lines, \\");
gnuplot_cmd(hplot, " 'dat/cheby_poly1_ord3.txt' with lines, \\");
gnuplot_cmd(hplot, " 'dat/cheby_poly1_ord4.txt' with lines");
gnuplot_close(hplot);
/* run GNUPLOT script */
gnuplot_script(argc, argv, "gnuplot/cheby_poly1.plt");
dspl_free(handle); // free dspl handle
dspl_free(hdspl); // free dspl handle
return 0;
}

Wyświetl plik

@ -7,8 +7,9 @@
int main(int argc, char* argv[])
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
void* hdspl; /* DSPL handle */
void* hplot; /* GNUPLOT handle */
hdspl = dspl_load(); // Load DSPL function
double x[N], y[N];
int ord;
@ -22,10 +23,20 @@ int main(int argc, char* argv[])
writetxt(x,y,N,fn);
}
/* run GNUPLOT script */
gnuplot_script(argc, argv, "gnuplot/cheby_poly2.plt");
/* plotting by GNUPLOT */
gnuplot_create(argc, argv, 560, 380, "img/cheby_poly2.png", &hplot);
gnuplot_cmd(hplot, "set grid");
gnuplot_cmd(hplot, "set key left top");
gnuplot_cmd(hplot, "set xlabel 'x'");
gnuplot_cmd(hplot, "set ylabel 'U_N (x)'");
gnuplot_cmd(hplot, "set yrange [-3.5:3.5]");
gnuplot_cmd(hplot, "plot 'dat/cheby_poly2_ord1.txt' with lines, \\");
gnuplot_cmd(hplot, " 'dat/cheby_poly2_ord2.txt' with lines, \\");
gnuplot_cmd(hplot, " 'dat/cheby_poly2_ord3.txt' with lines, \\");
gnuplot_cmd(hplot, " 'dat/cheby_poly2_ord4.txt' with lines");
gnuplot_close(hplot);
dspl_free(handle); // free dspl handle
dspl_free(hdspl); // free dspl handle
return 0;
}

Wyświetl plik

@ -11,7 +11,8 @@
int main(int argc, char* argv[])
{
void* handle; /* DSPL handle */
void* hdspl; /* DSPL handle */
void* hplot; /* GNUPLOT handle */
double b[ORD+1], a[ORD+1];
double t[N], s[N], n[N], sf[N];
@ -20,7 +21,7 @@ int main(int argc, char* argv[])
int err;
/* Load DSPL function */
handle = dspl_load();
hdspl = dspl_load();
/* random generator init */
random_init(&rnd, RAND_TYPE_MT19937, NULL);
@ -44,12 +45,23 @@ int main(int argc, char* argv[])
/* save input signal and filter output to the txt-files */
writetxt(t,s, N, "dat/s.txt");
writetxt(t,sf,N, "dat/sf.txt");
/* run GNUPLOT script */
err = gnuplot_script(argc, argv, "gnuplot/filter_iir.plt");
/* plotting by GNUPLOT */
gnuplot_create(argc, argv, 820, 340, "img/filter_iir_test.png", &hplot);
gnuplot_cmd(hplot, "unset key");
gnuplot_cmd(hplot, "set grid");
gnuplot_cmd(hplot, "set xlabel 'n'");
gnuplot_cmd(hplot, "set ylabel 's(n)'");
gnuplot_cmd(hplot, "set yrange [-3:3]");
gnuplot_cmd(hplot, "set multiplot layout 2,1 rowsfirst");
gnuplot_cmd(hplot, "plot 'dat/s.txt' with lines");
gnuplot_cmd(hplot, "set ylabel 's_f(n)'");
gnuplot_cmd(hplot, "plot 'dat/sf.txt' with lines");
gnuplot_cmd(hplot, "unset multiplot");
gnuplot_close(hplot);
/* free DSPL handle */
dspl_free(handle);
dspl_free(hdspl);
return err;

Wyświetl plik

@ -7,16 +7,17 @@
int main(int argc, char* argv[])
{
void* handle; /* DSPL handle */
handle = dspl_load(); /* Load DSPL function */
void* hdspl; /* DSPL handle */
void* hplot[3]; /* GNUPLOT handles */
hdspl = dspl_load(); /* Load DSPL function */
double x[N];
double s[N]; /* s(x) = sin(x) */
double c[N]; /* c(x) = cos(x) */
int n;
int err;
/* x vector from -4*pi to 4*pi */
linspace(-4.0 * M_PI, 4 * M_PI, N , DSPL_SYMMETRIC, x);
for(n = 0; n < N; n++)
@ -29,13 +30,37 @@ int main(int argc, char* argv[])
writetxt(x, s, N, "dat/sine.txt");
writetxt(x, c, N, "dat/cosine.txt");
/* GNUPLOT script gnuplot/gnuplot_script.plt */
err = gnuplot_script(argc, argv, "gnuplot/gnuplot_script.plt");
/* Print output */
/* plotting by GNUPLOT */
/* Create window 0 */
err = gnuplot_create(argc, argv, 560, 280, "img/gnuplot_script_sin.png", hplot);
printf("GNUPLOT err = %d\n", err);
gnuplot_cmd(hplot[0], "set grid");
gnuplot_cmd(hplot[0], "set xlabel 'x'");
gnuplot_cmd(hplot[0], "set ylabel 'sin(x)'");
gnuplot_cmd(hplot[0], "plot 'dat/sine.txt' with lines title 'sin(x)'");
gnuplot_close(hplot[0]);
dspl_free(handle); /* free dspl handle */
/* Create window 1 */
err = gnuplot_create(argc, argv, 560, 280, "img/gnuplot_script_cos.png", hplot+1);
printf("GNUPLOT err = %d\n", err);
gnuplot_cmd(hplot[1], "set grid");
gnuplot_cmd(hplot[1], "set xlabel 'x'");
gnuplot_cmd(hplot[1], "set ylabel 'cos(x)'");
gnuplot_cmd(hplot[1], "plot 'dat/cosine.txt' with lines title 'cos(x)'");
gnuplot_close(hplot[1]);
/* Create window 2 */
err = gnuplot_create(argc, argv, 560, 280, "img/gnuplot_script_sincos.png", hplot+2);
printf("GNUPLOT err = %d\n", err);
gnuplot_cmd(hplot[2], "set grid");
gnuplot_cmd(hplot[2], "set xlabel 'x'");
gnuplot_cmd(hplot[2], "set ylabel 'sin(x), cos(x)'");
gnuplot_cmd(hplot[2], "plot 'dat/sine.txt' with lines title 'sin(x)', \\");
gnuplot_cmd(hplot[2], " 'dat/cosine.txt' with lines title 'cos(x)");
gnuplot_close(hplot[2]);
dspl_free(hdspl); /* free dspl handle */
return 0;
}

Wyświetl plik

@ -12,8 +12,9 @@
int main(int argc, char* argv[])
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
void* hdspl; /* DSPL handle */
void* hplot; /* GNUPLOT handle */
hdspl = dspl_load(); // Load DSPL function
double a[ORD+1], b[ORD+1]; // H(s) coefficients
double rs = 60.0; // Bandstop suppression equals 60 dB
@ -52,9 +53,26 @@ int main(int argc, char* argv[])
writetxt(w, phi, N, "dat/iir_bstop_phi.txt");
writetxt(w, tau, N, "dat/iir_bstop_tau.txt");
gnuplot_script(argc, argv, "gnuplot/iir_bstop.plt");
/* plotting by GNUPLOT */
gnuplot_create(argc, argv, 920, 260, "img/iir_bstop.png", &hplot);
gnuplot_cmd(hplot, "unset key");
gnuplot_cmd(hplot, "set grid");
gnuplot_cmd(hplot, "set xlabel 'normalized frequency'");
gnuplot_cmd(hplot, "set multiplot layout 1,3 rowsfirst");
gnuplot_cmd(hplot, "set ylabel 'Magnitude, dB'");
gnuplot_cmd(hplot, "set yrange [-100:5]");
gnuplot_cmd(hplot, "plot 'dat/iir_bstop_mag.txt' with lines");
gnuplot_cmd(hplot, "set ylabel 'Phase response, rad'");
gnuplot_cmd(hplot, "unset yrange");
gnuplot_cmd(hplot, "plot 'dat/iir_bstop_phi.txt' with lines");
gnuplot_cmd(hplot, "set ylabel 'Groupdelay, samples'");
gnuplot_cmd(hplot, "unset yrange");
gnuplot_cmd(hplot, "plot 'dat/iir_bstop_tau.txt' with lines");
gnuplot_cmd(hplot, "unset multiplot");
gnuplot_close(hplot);
dspl_free(handle); // free dspl handle
dspl_free(hdspl); // free dspl handle
// run GNUPLOT script
return 0;

Wyświetl plik

@ -12,9 +12,10 @@
int main(int argc, char* argv[])
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
void* hdspl; /* DSPL handle */
void* hplot; /* GNUPLOT handle */
hdspl = dspl_load(); // Load DSPL function
double a[ORD+1], b[ORD+1]; // коэффициенты H(s)
double rs = 60.0; // неравномерность в полосе пропускания 3дБ
double rp = 1.0;
@ -46,12 +47,27 @@ int main(int argc, char* argv[])
writetxt(w, phi, N, "dat/iir_lpf_phi.txt");
writetxt(w, tau, N, "dat/iir_lpf_tau.txt");
gnuplot_script(argc, argv, "gnuplot/iir_lpf.plt");
/* plotting by GNUPLOT */
gnuplot_create(argc, argv, 920, 260, "img/iir_lpf.png", &hplot);
gnuplot_cmd(hplot, "unset key");
gnuplot_cmd(hplot, "set grid");
gnuplot_cmd(hplot, "set xlabel 'normalized frequency'");
gnuplot_cmd(hplot, "set multiplot layout 1,3 rowsfirst");
gnuplot_cmd(hplot, "set ylabel 'Magnitude, dB'");
gnuplot_cmd(hplot, "set yrange [-100:5]");
gnuplot_cmd(hplot, "plot 'dat/iir_lpf_mag.txt' with lines");
gnuplot_cmd(hplot, "set ylabel 'Phase response, rad'");
gnuplot_cmd(hplot, "unset yrange");
gnuplot_cmd(hplot, "plot 'dat/iir_lpf_phi.txt' with lines");
gnuplot_cmd(hplot, "set ylabel 'Groupdelay, samples'");
gnuplot_cmd(hplot, "unset yrange");
gnuplot_cmd(hplot, "plot 'dat/iir_lpf_tau.txt' with lines");
gnuplot_cmd(hplot, "unset multiplot");
gnuplot_close(hplot);
dspl_free(handle); // free dspl handle
// выполнить скрипт GNUPLOT для построения графиков
// по рассчитанным данным
dspl_free(hdspl); // free dspl handle
return 0;
}

Wyświetl plik

@ -68,8 +68,9 @@ void freq_resp_write2txt(double* b, double* a, int ord, int n, char* fn)
******************************************************************************/
int main(int argc, char* argv[])
{
void* handle; /* DSPL handle */
handle = dspl_load(); /* Load DSPL function */
void* hdspl; /* DSPL handle */
void* hplot; /* GNUPLOT handle */
hdspl = dspl_load(); /* Load DSPL functions */
/* Transfer function H(z) coeff. vectors */
double a[MAX_ORD+1], b[MAX_ORD+1];
@ -147,11 +148,40 @@ int main(int argc, char* argv[])
freq_resp_write2txt(b, a, BSF_ORD, N, "dat/iir_ellip_bsf.txt");
/*--------------------------------------------------------------------------*/
gnuplot_script(argc, argv, "gnuplot/iir_test.plt");
/* plotting by GNUPLOT */
gnuplot_create(argc, argv, 920, 840, "img/iir_test.png", &hplot);
gnuplot_cmd(hplot, "unset key");
gnuplot_cmd(hplot, "set grid");
gnuplot_cmd(hplot, "set xlabel 'normalized frequency'");
gnuplot_cmd(hplot, "set ylabel 'Magnitude, dB'");
gnuplot_cmd(hplot, "set yrange [-100:5]");
gnuplot_cmd(hplot, "set xtics 0,1");
gnuplot_cmd(hplot, "set xtics add ('0.3' 0.3)");
gnuplot_cmd(hplot, "set xtics add ('0.7' 0.7)");
gnuplot_cmd(hplot, "set xtics add ('1' 1)");
gnuplot_cmd(hplot, "set multiplot layout 4,4 rowsfirst");
gnuplot_cmd(hplot, "plot 'dat/iir_butter_lpf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_butter_hpf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_butter_bpf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_butter_bsf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_cheby1_lpf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_cheby1_hpf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_cheby1_bpf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_cheby1_bsf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_cheby2_lpf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_cheby2_hpf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_cheby2_bpf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_cheby2_bsf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_ellip_lpf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_ellip_hpf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_ellip_bpf.txt' with lines");
gnuplot_cmd(hplot, "plot 'dat/iir_ellip_bsf.txt' with lines");
gnuplot_cmd(hplot, "unset multiplot");
gnuplot_close(hplot);
/* free dspl handle */
dspl_free(handle);
dspl_free(hdspl);
return 0;
}

Wyświetl plik

@ -8,8 +8,9 @@
int main(int argc, char* argv[])
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
void* hdspl; /* DSPL handle */
void* hplot; /* GNUPLOT handle */
hdspl = dspl_load(); /* Load DSPL function */
double x[N], y[N];
@ -23,9 +24,19 @@ int main(int argc, char* argv[])
sinc(x, N, 2.0*M_PI, y);
writetxt(x, y, N, "dat/sinc_test_2pi.txt");
gnuplot_script(argc, argv, "gnuplot/sinc_test.plt");
/* plotting by GNUPLOT */
gnuplot_create(argc, argv, 560, 280, "img/sinc_test.png", &hplot);
gnuplot_cmd(hplot, "set grid");
gnuplot_cmd(hplot, "set xlabel 'x'");
gnuplot_cmd(hplot, "set ylabel 'sinc(x,a)'");
gnuplot_cmd(hplot, "set yrange [-0.25:1.1]");
gnuplot_cmd(hplot, "plot 'dat/sinc_test_1.0.txt' with lines title 'a = 1.0'");
gnuplot_cmd(hplot, "replot 'dat/sinc_test_pi.txt' with lines title 'a = pi'");
gnuplot_cmd(hplot, "replot 'dat/sinc_test_2pi.txt' with lines title 'a = 2pi'");
gnuplot_close(hplot);
dspl_free(handle); // free dspl handle
dspl_free(hdspl); // free dspl handle
return 0;
}

Wyświetl plik

@ -7,8 +7,9 @@
int main(int argc, char* argv[])
{
void* handle; // DSPL handle
handle = dspl_load(); // Load DSPL function
void* hdspl; /* DSPL handle */
void* hplot; /* GNUPLOT handle */
hdspl = dspl_load(); /* Load DSPL function */
double x[N], y[N];
@ -20,9 +21,19 @@ int main(int argc, char* argv[])
sinc(x, N, 1.0, y);
writetxt(x, y, N, "dat/dat1.txt");
gnuplot_script(argc, argv, "gnuplot/sine_int.plt");
/* plotting by GNUPLOT */
gnuplot_create(argc, argv, 560, 280, "img/sine_int.png", &hplot);
gnuplot_cmd(hplot, "set grid");
gnuplot_cmd(hplot, "set xlabel 'x'");
gnuplot_cmd(hplot, "set lmargin at screen 0.10");
gnuplot_cmd(hplot, "set key left top");
gnuplot_cmd(hplot, "set ylabel 'Si(x), sinc(x)'");
gnuplot_cmd(hplot, "set yrange [-2:2]");
gnuplot_cmd(hplot, "plot 'dat/dat0.txt' with lines title 'Si(x)', \\");
gnuplot_cmd(hplot, " 'dat/dat1.txt' with lines title 'sinc(x)'");
gnuplot_close(hplot);
dspl_free(handle); // free dspl handle
dspl_free(hdspl); // free dspl handle
return 0;
}

Wyświetl plik

@ -1,54 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dspl.h"
#define ORD 6
#define N 2000
int main(int argc, char* argv[])
{
void* handle; /* DSPL handle */
double b[ORD+1], a[ORD+1];
double t[N], s[N], n[N], sf[N];
random_t rnd;
int k;
int err;
/* Load DSPL function */
handle = dspl_load();
/* random generator init */
random_init(&rnd, RAND_TYPE_MT19937, NULL);
/* fill time vector */
linspace(0, N, N, DSPL_PERIODIC, t);
/* generate noise */
randn(n, N, 0, 1.0, &rnd);
/* input signal s = sin(2*pi*t) + n(t) */
for(k = 0; k < N; k++)
s[k] = sin(M_2PI*0.02*t[k]) + n[k];
/* IIR filter coefficients calculation */
iir(1.0, 70.0, ORD, 0.06, 0.0, DSPL_FILTER_ELLIP | DSPL_FILTER_LPF, b, a);
/* input signal filtration */
filter_iir(b, a, ORD, s, N, sf);
/* save input signal and filter output to the txt-files */
writetxt(t,s, N, "dat/s.txt");
writetxt(t,sf,N, "dat/sf.txt");
/* run GNUPLOT script */
err = gnuplot_script(argc, argv, "gnuplot/filter_iir.plt");
/* free DSPL handle */
dspl_free(handle);
return err;
}

Wyświetl plik

@ -1,16 +1 @@
# depslib dependency file v1.0
1572801111 source:f:\dsplib.org\libdspl-2.0\examples\src\test.c
<stdio.h>
<stdlib.h>
<string.h>
"dspl.h"
1572200729 f:\dsplib.org\libdspl-2.0\include\dspl.h
<math.h>
1572196728 source:f:\dsplib.org\libdspl-2.0\include\dspl.c
<windows.h>
<dlfcn.h>
<stdio.h>
"dspl.h"

Wyświetl plik

@ -106,6 +106,9 @@ p_freqs_cmplx freqs_cmplx ;
p_freqs2time freqs2time ;
p_freqz freqz ;
p_gnuplot_close gnuplot_close ;
p_gnuplot_cmd gnuplot_cmd ;
p_gnuplot_create gnuplot_create ;
p_gnuplot_script gnuplot_script ;
p_goertzel goertzel ;
p_goertzel_cmplx goertzel_cmplx ;
@ -298,6 +301,9 @@ void* dspl_load()
LOAD_FUNC(freqs_cmplx);
LOAD_FUNC(freqs2time);
LOAD_FUNC(gnuplot_close);
LOAD_FUNC(gnuplot_cmd);
LOAD_FUNC(gnuplot_create);
LOAD_FUNC(gnuplot_script);
LOAD_FUNC(goertzel);
LOAD_FUNC(goertzel_cmplx);

Wyświetl plik

@ -95,6 +95,7 @@ typedef struct
/* Error codes */
/* A 0x01xxxxxx*/
#define ERROR_ARG_PARAM 0x01180716
/* B 0x02xxxxxx*/
/* C 0x03xxxxxx*/
/* D 0x04xxxxxx*/
@ -120,6 +121,8 @@ typedef struct
#define ERROR_FREAD_SIZE 0x06180501
#define ERROR_FWRITE_SIZE 0x06231820
/* G 0x07xxxxxx*/
#define ERROR_GNUPLOT_CREATE 0x07161203
#define ERROR_GNUPLOT_FNPNG 0x07161206
#define ERROR_GNUPLOT_TERM 0x07161220
/* H 0x08xxxxxx*/
/* I 0x09xxxxxx*/
@ -221,6 +224,9 @@ typedef struct
#define DSPL_VERIF_FAILED 1
#define DSPL_VERIF_SUCCESS 0
#define PLOT_HOLD 0x00000001
#ifdef __cplusplus
extern "C" {
#endif
@ -626,6 +632,18 @@ DECLARE_FUNC(int, freqz, double*
COMMA int
COMMA complex_t*);
/*----------------------------------------------------------------------------*/
DECLARE_FUNC(void, gnuplot_close, void* h);
/*----------------------------------------------------------------------------*/
DECLARE_FUNC(void, gnuplot_cmd, void* h
COMMA char* cmd);
/*----------------------------------------------------------------------------*/
DECLARE_FUNC(int, gnuplot_create, int argc
COMMA char* argv[]
COMMA int w
COMMA int h
COMMA char* fn_png
COMMA void** hplot);
/*----------------------------------------------------------------------------*/
DECLARE_FUNC(int, gnuplot_script, int argc
COMMA char* argv[]
COMMA char* fn);