From 9539b5efb5ccf665a1cc4b8e814e96460b22e0ab Mon Sep 17 00:00:00 2001 From: Abhinav Dronamraju Date: Tue, 28 Nov 2017 14:53:58 +0530 Subject: New functions and help files generated --- help/en_US/arch_test.xml | 73 +++++++++++++++++++++ help/en_US/detrend1.xml | 51 ++++++++++++++ help/en_US/master_help.xml | 4 ++ help/en_US/periodogram.xml | 42 +++++++++++- help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS | Bin 13071 -> 13367 bytes .../scilab_en_US_help/JavaHelpSearch/DOCS.TAB | Bin 1735 -> 1769 bytes .../en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS | 14 ++-- .../scilab_en_US_help/JavaHelpSearch/POSITIONS | Bin 56223 -> 57620 bytes help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA | 2 +- help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP | Bin 26624 -> 28672 bytes help/en_US/scilab_en_US_help/jhelpmap.jhm | 2 + help/en_US/scilab_en_US_help/jhelptoc.xml | 2 + jar/scilab_en_US_help.jar | Bin 386404 -> 391962 bytes macros/ar_psd.sci | 17 +++++ macros/arch_test.sci | 46 +++++++++++++ macros/bilinear.sci | 27 ++++++++ macros/cohere.sci | 11 ++++ macros/detrend1.sci | 11 ++++ macros/lib | Bin 6552 -> 6648 bytes macros/names | 4 ++ macros/periodogram.sci | 46 ++++++++++--- 21 files changed, 333 insertions(+), 19 deletions(-) create mode 100644 help/en_US/arch_test.xml create mode 100644 help/en_US/detrend1.xml create mode 100644 macros/ar_psd.sci create mode 100644 macros/arch_test.sci create mode 100644 macros/bilinear.sci create mode 100644 macros/cohere.sci diff --git a/help/en_US/arch_test.xml b/help/en_US/arch_test.xml new file mode 100644 index 0000000..aa57ff0 --- /dev/null +++ b/help/en_US/arch_test.xml @@ -0,0 +1,73 @@ + + + + + + + + arch_test + perform a Lagrange Multiplier (LM) test of thenull hypothesis of no conditional heteroscedascity against the alternative of CH(P) + + + + + Calling Sequence + + arch_test(Y,X,P) + PVAL = arch_test(Y,X,P) + [PVAL, LM]= arch_test(Y,X,P) + + + + + Parameters + + P: + Degrees of freedom + PVAL: + PVAL is the p-value (1 minus the CDF of this distribution at LM) of the test + + + + + Description + +perform a Lagrange Multiplier (LM) test of thenull hypothesis of no conditional heteroscedascity against the alternative of CH(P). + + +I.e., the model is + + +y(t) = b(1) * x(t,1) + ... + b(k) * x(t,k) + e(t), + + +given Y up to t-1 and X up to t, e(t) is N(0, h(t)) with + + +h(t) = v + a(1) * e(t-1)^2 + ... + a(p) *e(t-p)^2, and the null is a(1) == ... == a(p) == 0. + + +If the second argument is a scalar integer, k,perform the sametest in a linear autoregression model of orderk, i.e., with + + +[1, y(t-1), ..., y(t-K)] as the t-th row of X. + + +Under the null, LM approximatel has a chisquare distribution with P degrees of freedom and PVAL is the p-value (1 minus the CDF of this distribution at LM) of the test. + + +If no output argument is given, the p-value is displayed. + + + diff --git a/help/en_US/detrend1.xml b/help/en_US/detrend1.xml new file mode 100644 index 0000000..783d922 --- /dev/null +++ b/help/en_US/detrend1.xml @@ -0,0 +1,51 @@ + + + + + + + + detrend1 + This function removes the best fit of a polynomial of order P from the data X + + + + + Calling Sequence + + detrend1(X,P) + + + + + Parameters + + X: + Input vecor or matrix. + P: + The order of polnomial + + + + + Description + +If X is a vector, 'detrend1(X, P)' removes the best fit of apolynomial of order P from the data X.If X is a matrix, 'detrend1(X, P)' does the same for each column in X. + + +The second argument P is optional. If it is not specified, a value of 1 is assumed. This corresponds to removing a linear trend. +The order of the polynomial can also be given as a string, in which case P must be either "constant" (corresponds to 'P=0') or "linear"(corresponds to 'P=1') + + + diff --git a/help/en_US/master_help.xml b/help/en_US/master_help.xml index 29bb0db..402f8b6 100644 --- a/help/en_US/master_help.xml +++ b/help/en_US/master_help.xml @@ -5,6 +5,7 @@ + @@ -47,6 +48,7 @@ + @@ -259,6 +261,7 @@ &acc27042e738d175d1131be40ac8443e4; &a00c7c9f2a0021ff13869dce3b90df38c; &a2801dc954ec6ac2e1c314367aab7316b; +&a1495e32bc54c2e2975785e8e2e4521bd; &aa86636858e7127f17b93747fc8f3ec30; &a2804cc9a113729444d60d8cf3c14b554; &a78af20f681c48f8ec298b379b34418b7; @@ -301,6 +304,7 @@ &a012dc78292d46d1a6bfdd411607796ae; &a4c9381ac38659e2e9ccdf89e9aec08f9; &a732f6e560fa62dcfe2137f94ce0b812b; +&aead61bf67b6895372794be69a80b5ab9; &a8e9030fad0ea16388695b20a07e04334; &a3ffbb42a185eaf6b62029b6efc883d6b; &ac93a3534190eae2db767de3935ad4fbc; diff --git a/help/en_US/periodogram.xml b/help/en_US/periodogram.xml index 8b5b2ed..5ad8738 100644 --- a/help/en_US/periodogram.xml +++ b/help/en_US/periodogram.xml @@ -17,7 +17,47 @@ periodogram - funcprot(0); + Return the periodogram (Power Spectral Density) of X + + + Calling Sequence + + [PXX, W] = periodogram (X) + [PXX, W] = periodogram (X, WIN) + [PXX, W] = periodogram (X, WIN, NFFT) + [PXX, W] = periodogram (X, WIN, NFFT, FS) + [PXX, W] = periodogram (..., "RANGE") + + + + + Parameters + + X: + data vector. If X is real-valued a one-sided spectrum is estimated. If X is complex-valued, or "RANGE" specifies "twosided", the full spectrum is estimated. + WIN: + window weight data. If window is empty or unspecified a default rectangular window is used. Otherwise, the window is applied to the signal ('X .* WIN') before computing th periodogram. The window data must be a vector of the same length as X. + NFFT: + number of frequency bins. The default is 256 or the next higher power of 2 greater than the length of X ('max (256,2.^nextpow2 (length (x)))'). If NFFT is greater than the length of the input then X will be zero-padded to the length of NFFT. + FS: + sampling rate. The default is 1. + RANGE: + range of spectrum. "onesided" computes spectrum from [0..nfft/2+1]."twosided" computes spectrum from [0..nfft-1]. + + + + + Description + +The optional second output W are the normalized angular frequencies. For a one-sided calculation W is in the range [0, pi]. If NFFT is even and [0, pi) if NFFT is odd. Similarly, for a two-sided calculation W is in the range [0, 2*pi] or [0, 2*pi)depending on NFFT. + + +If a sampling frequency is specified, FS, then the output frequencies F will be in the range [0, FS/2] or [0, FS/2) for one-sided calculations. For two-sided calculations the range will be [0, FS). + + +When called with no outputs the periodogram is immediately plotted in the current figure window. + + diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS index 3105019..2e55114 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS and b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS differ diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB index 16c3c1b..ac87aca 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB and b/help/en_US/scilab_en_US_help/JavaHelpSearch/DOCS.TAB differ diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS index 0fd7aff..ae19610 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/OFFSETS @@ -1,7 +1,7 @@ -j !(hC(p,AlZs挭t9rGA&ݔxXHʌTM<52TJQ; 0@VCE(CF=#3o3Qg0S[c;b1Y޸e(ƲchVeGE1PQ#'e[rj;VMH'!ni3 -%+ Q欙}wUٗ8܅ Ԙ -MgǏ6H͕*T5&1e2TvKS*e`U;bnVD**|! -#BуyV)`wΘÖuy2yWl4KréPywF-E*E ZbMlAr{T?˝:z(FȊ24`HR9"m%P,RtRI ΢G)W1K -4I9Ch̩>Vd-5ޱ|31 F8^X 4Coٿx$3c{w~qDEk]Si KGon}Rh84R;Y;+*bYkS}K_lN(~lR~oB<;tioUCpKdkOHBĜ{!W _g'ZdHf+[%Vjv/e>Yի8]}i'pV>+3a -ݷNFe[6YKIJ1-5 -o#[I. PTH9`k֜u/\=Jp!eI4e9^8)R2-O LeDq$#Ih,PQi(H ь,4eL3rء{*Vw#J1Ś9G5oF,QGQhci2T1b3d k[rj;VMH'!ni3 + T,9F˚eWj`c$Q`I6}T%tV0ԘKMd_˕SدYLIїu<9/[TRUM?#|T]k(HK= F Z +83^,E/>bdVDa72_v &/K~MC~xMd㨨=5i3÷ɱ9SxNr.u*"Ե"*lс# Kq^4:22ٴaCIJW'˝ +c|R1q Q{☜ +4I9Ch̩>Vd-5ޱ|32]F_U 66)9JWwnt}Ͽ`GfL w̯IeX7,ҚL#+翘*ұʷ* $f<'?4;^ZWnh7!mZ&45,XV"KI{G7mDj^mQGq +ߋUZ; zn{uk,TX rNo6j"KֳA1-7u5y+p\EI3.RH94R}A$.w_K \ No newline at end of file diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS index 5d4fac0..4544947 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS and b/help/en_US/scilab_en_US_help/JavaHelpSearch/POSITIONS differ diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA index e6c083a..7d65376 100644 --- a/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA +++ b/help/en_US/scilab_en_US_help/JavaHelpSearch/SCHEMA @@ -1,2 +1,2 @@ JavaSearch 1.0 -TMAP bs=2048 rt=1 fl=-1 id1=2335 id2=1 +TMAP bs=2048 rt=1 fl=-1 id1=2382 id2=1 diff --git a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP index ea3dfe8..6337674 100644 Binary files a/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP and b/help/en_US/scilab_en_US_help/JavaHelpSearch/TMAP differ diff --git a/help/en_US/scilab_en_US_help/jhelpmap.jhm b/help/en_US/scilab_en_US_help/jhelpmap.jhm index ac7ff93..4e2930e 100644 --- a/help/en_US/scilab_en_US_help/jhelpmap.jhm +++ b/help/en_US/scilab_en_US_help/jhelpmap.jhm @@ -7,6 +7,7 @@ + @@ -49,6 +50,7 @@ + diff --git a/help/en_US/scilab_en_US_help/jhelptoc.xml b/help/en_US/scilab_en_US_help/jhelptoc.xml index dda12cb..1b4fbc8 100644 --- a/help/en_US/scilab_en_US_help/jhelptoc.xml +++ b/help/en_US/scilab_en_US_help/jhelptoc.xml @@ -7,6 +7,7 @@ + @@ -49,6 +50,7 @@ + diff --git a/jar/scilab_en_US_help.jar b/jar/scilab_en_US_help.jar index fe7030d..f54e2b5 100644 Binary files a/jar/scilab_en_US_help.jar and b/jar/scilab_en_US_help.jar differ diff --git a/macros/ar_psd.sci b/macros/ar_psd.sci new file mode 100644 index 0000000..d60e3c4 --- /dev/null +++ b/macros/ar_psd.sci @@ -0,0 +1,17 @@ +function [P, F]= ar_psd(A, varargin) + funcprot(0); + rhs= argn(2); + if(rhs <2 | rhs>5) + error("Wrong number of input arguments"); + end + select(rhs) + case 2 then + [P,F]= callOctave("ar_psd", A, varargin(1)); + case 3 then + [P,F]= callOctave("ar_psd", A, varargin(1), varargin(2)); + case 4 then + [P,F]= callOctave("ar_psd", A, varargin(1), varargin(2), varargin(3)); + case 5 then + [P,F]= callOctave("ar_psd", A, varargin(1), varargin(2), varargin(3), varargin(4)); + end +endfunction diff --git a/macros/arch_test.sci b/macros/arch_test.sci new file mode 100644 index 0000000..3c53fc5 --- /dev/null +++ b/macros/arch_test.sci @@ -0,0 +1,46 @@ +function [PVAL, LM]= arch_test(Y,X,P) +// perform a Lagrange Multiplier (LM) test of thenull hypothesis of no conditional heteroscedascity against the alternative of CH(P) +//Calling Sequence +//arch_test(Y,X,P) +//PVAL = arch_test(Y,X,P) +//[PVAL, LM]= arch_test(Y,X,P) +//Parameters +//P: Degrees of freedom +//PVAL:PVAL is the p-value (1 minus the CDF of this distribution at LM) of the test +//Description +//perform a Lagrange Multiplier (LM) test of thenull hypothesis of no conditional heteroscedascity against the alternative of CH(P). +// +//I.e., the model is +// +// y(t) = b(1) * x(t,1) + ... + b(k) * x(t,k) + e(t), +// +//given Y up to t-1 and X up to t, e(t) is N(0, h(t)) with +// +// h(t) = v + a(1) * e(t-1)^2 + ... + a(p) *e(t-p)^2, and the null is a(1) == ... == a(p) == 0. +// +//If the second argument is a scalar integer, k,perform the sametest in a linear autoregression model of orderk, i.e., with +// +// [1, y(t-1), ..., y(t-K)] as the t-th row of X. +// +// Under the null, LM approximatel has a chisquare distribution with P degrees of freedom and PVAL is the p-value (1 minus the CDF of this distribution at LM) of the test. +// +// If no output argument is given, the p-value is displayed. + funcprot(0) + rhs= argn(2); + lhs= argn(1); + if(rhs<3 | rhs>3) + error("Wrong number of input arguments"); + end + if(lhs<1 | lhs>2) + error("Wrong number of output arguments"); + end + select(rhs) + case 3 then + select(lhs) + case 1 then + PVAL= callOctave("arch_test", Y, X, P); + case 2 then + [PVAL,LM]= callOctave("arch_test", Y, X, P); + end + end +endfunction \ No newline at end of file diff --git a/macros/bilinear.sci b/macros/bilinear.sci new file mode 100644 index 0000000..d58dd2a --- /dev/null +++ b/macros/bilinear.sci @@ -0,0 +1,27 @@ +function [Zb, Za, Zg]= bilinear(Sb,varargin) + funcprot(0); + lhs= argn(1); + rhs= argn(2); + if(rhs < 3 | rhs > 4) + error("Wrong number of input arguments"); + end + if(lhs < 2 | lhs > 3) + error("Wrong number of output arguments"); + end + select(rhs) + case 3 then + select(lhs) + case 2 then + [Zb, Za]= callOctave("bilinear", Sb, varargin(1), varargin(2)); + case 3 then + [Zb, Za, Zg]= callOctave("bilinear", Sb, varargin(1), varargin(2)); + end + case 4 then + select(lhs) + case 2 then + [Zb, Za]= callOctave("bilinear", Sb, varargin(1), varargin(2), varargin(3)); + case 3 then + [Zb, Za, Zg]= callOctave("bilinear", Sb, varargin(1), varargin(2), varargin(3)); + end + end +endfunction \ No newline at end of file diff --git a/macros/cohere.sci b/macros/cohere.sci new file mode 100644 index 0000000..ad964a3 --- /dev/null +++ b/macros/cohere.sci @@ -0,0 +1,11 @@ +function [Pxx,freqs] = cohere(x,y,Nfft,Fs,win,overlap,ran,plot_type,detrends) + rhs= argn(2); + lhs= argn(1); + if(rhs < 10 | rhs > 10) + error("Wrong number of input arguments"); + end + select(rhs) + case 10 then + [Pxx,freqs] = callOctave("cohere",x,y,Nfft,Fs,win,overlap,ran,plot_type,detrends); + end +endfunction \ No newline at end of file diff --git a/macros/detrend1.sci b/macros/detrend1.sci index b9929f4..52ac26f 100644 --- a/macros/detrend1.sci +++ b/macros/detrend1.sci @@ -1,4 +1,15 @@ function y = detrend1(x, varargin) +//This function removes the best fit of a polynomial of order P from the data X +//Calling Sequence +//detrend1(X,P) +//Parameters +//X: Input vecor or matrix. +//P: The order of polnomial +//Description +//If X is a vector, 'detrend1(X, P)' removes the best fit of apolynomial of order P from the data X.If X is a matrix, 'detrend1(X, P)' does the same for each column in X. +// +//The second argument P is optional. If it is not specified, a value of 1 is assumed. This corresponds to removing a linear trend. +//The order of the polynomial can also be given as a string, in which case P must be either "constant" (corresponds to 'P=0') or "linear"(corresponds to 'P=1') rhs= argn(2); if(rhs<1 | rhs> 2) error("Wrong number of input arguments"); diff --git a/macros/lib b/macros/lib index 643f8e5..4ca8135 100644 Binary files a/macros/lib and b/macros/lib differ diff --git a/macros/names b/macros/names index af57307..b437c07 100644 --- a/macros/names +++ b/macros/names @@ -1,7 +1,9 @@ ac2poly ac2rc arParEst +ar_psd arburg +arch_test arcov armcov aryule @@ -10,6 +12,7 @@ barthannwin bartlett besselap besself +bilinear bitrevorder blackman blackmanharris @@ -35,6 +38,7 @@ check chirp clustersegment cmorwavf +cohere convmtx corrmtx cplxreal diff --git a/macros/periodogram.sci b/macros/periodogram.sci index 33e15af..ca8995e 100755 --- a/macros/periodogram.sci +++ b/macros/periodogram.sci @@ -1,20 +1,46 @@ function [d,n]=periodogram(a,b,c,d,e) +//Return the periodogram (Power Spectral Density) of X +//Calling Sequence +// [PXX, W] = periodogram (X) +// [PXX, W] = periodogram (X, WIN) +// [PXX, W] = periodogram (X, WIN, NFFT) +// [PXX, W] = periodogram (X, WIN, NFFT, FS) +// [PXX, W] = periodogram (..., "RANGE") +//Parameters +// X:data vector. If X is real-valued a one-sided spectrum is estimated. If X is complex-valued, or "RANGE" specifies "twosided", the full spectrum is estimated. +//WIN: window weight data. If window is empty or unspecified a default rectangular window is used. Otherwise, the window is applied to the signal ('X .* WIN') before computing th periodogram. The window data must be a vector of the same length as X. +//NFFT:number of frequency bins. The default is 256 or the next higher power of 2 greater than the length of X ('max (256,2.^nextpow2 (length (x)))'). If NFFT is greater than the length of the input then X will be zero-padded to the length of NFFT. +//FS:sampling rate. The default is 1. +//RANGE:range of spectrum. "onesided" computes spectrum from [0..nfft/2+1]."twosided" computes spectrum from [0..nfft-1]. +//Description +//The optional second output W are the normalized angular frequencies. For a one-sided calculation W is in the range [0, pi]. If NFFT is even and [0, pi) if NFFT is odd. Similarly, for a two-sided calculation W is in the range [0, 2*pi] or [0, 2*pi)depending on NFFT. +// +//If a sampling frequency is specified, FS, then the output frequencies F will be in the range [0, FS/2] or [0, FS/2) for one-sided calculations. For two-sided calculations the range will be [0, FS). +// +//When called with no outputs the periodogram is immediately plotted in the current figure window. funcprot(0); - [nargout,nargin]=argn(); - select nargin + lhs= argn(1); + rhs= argn(2); + if(rhs<1 | rhs>5) + error("Wrong number of input arguments"); + end + if(lhs>2 | lhs< 2) + error("Wrong number of output arguments"); + end + select(rhs) case 1 then - [d,n]=callOctave('periodogram',a); + [d,n]= callOctave('periodogram',a); case 2 then - [d,n]=callOctave('periodogram',a,b); + [d,n]= callOctave('periodogram',a,b); + case 3 then - [d,n]=callOctave('periodogram',a,b,c); + [d,n]= callOctave('periodogram',a,b,c); + case 4 then - [d,n]=callOctave('periodogram',a,b,c,d); + [d,n]= callOctave('periodogram',a,b,c,d); + case 5 then - [d,n]=callOctave('periodogram',a,b,c,d,e); - else - error("Incorrect no. of Input Arguments"); + [d,n]= callOctave('periodogram',a,b,c,d,e); end - endfunction -- cgit