diff options
author | prashantsinalkar | 2018-02-03 11:01:52 +0530 |
---|---|---|
committer | prashantsinalkar | 2018-02-03 11:01:52 +0530 |
commit | 7bc77cb1ed33745c720952c92b3b2747c5cbf2df (patch) | |
tree | 449d555969bfd7befe906877abab098c6e63a0e8 /2048/DEPENDENCIES/spec1.sci | |
parent | d1e070fe2d77c8e7f6ba4b0c57b1b42e26349059 (diff) | |
download | Scilab-TBC-Uploads-master.tar.gz Scilab-TBC-Uploads-master.tar.bz2 Scilab-TBC-Uploads-master.zip |
Diffstat (limited to '2048/DEPENDENCIES/spec1.sci')
-rw-r--r-- | 2048/DEPENDENCIES/spec1.sci | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/2048/DEPENDENCIES/spec1.sci b/2048/DEPENDENCIES/spec1.sci new file mode 100644 index 000000000..c749f9695 --- /dev/null +++ b/2048/DEPENDENCIES/spec1.sci @@ -0,0 +1,23 @@ +// Function to implement spectral factorization, as discussed in sec. 13.1.
+// 13.2
+
+function [r,b,rbbr] = spec1(A,dA,B,dB,rho)
+AA = rho * convol(A,flip(A));
+BB = convol(B,flip(B));
+diff1 = dA - dB;
+dBB = 2*dB;
+for i = 1:diff1
+ [BB,dBB] = polmul(BB,dBB,[0 1],1);
+end
+[rbbr,drbbr] = poladd(AA,2*dA,BB,dBB);
+rts = roots(rbbr); // roots in descending order of magnitude
+rts = flip(rts);
+rtsin = rts(dA+1:2*dA);
+b = 1;
+for i = 1:dA,
+ b = convol(b,[1 -rtsin(i)]);
+end
+br = flip(b);
+bbr = convol(b,br);
+r = rbbr(1) / bbr(1);
+endfunction;
|