Matlab:在实现二进制到实数转换的公式时无法获得唯一有理数第 1 部分

Matlab : Unable to get unique rationals when implementing a formula for binary to real number conversion Part1

存在一个非线性动力系统x_n = f(x_n,eta),其函数形式为x[n+1] = 2*x[n] mod 1。这是一个称为锯齿图或伯努利图的混沌动力系统。我在实现方程式(4)和方程式(5)给出的逆映射的两种表示时遇到了困难。以下是问题的简单描述。

其中序列(s[n+k])_k=1 to N-1是状态的符号描述x[n].这个描述来自下面描述的单位区间的划分。

设,分区数M = 2,符号space = {0,1},符号赋值规则为

 s[n+1] = 1 if x[n] >= 0.5, otherwise s[n+1] = 0

本文作者:

Linear, Random Representations of Chaos

对于 Eq(5),我在求逆后没有得到相同的时间序列,在进行二进制到实数转换后几乎没有值不同。有人可以告诉我正确的程序吗?

我尝试为方程 (4) 和 (5) 实现双射映射,但它不起作用。

Eq(5) 的代码 - 我将二值化为两种方式。 x 包含实数; s 是每个实数的 0/1 二进制等价物; y 是将 s 转换为实数后的答案。 s1 是 x 的 +1/-1 二进制等价物; b 是转换为实数后的答案。在 +1/-1 的情况下,当我从符号表示转换为实数时,我将 -1 切换为 0,然后应用 Eq(5) 中的公式。从回答中可以看出,yb转换后与x不一样。当原始实数都是无符号有理数时,我也会得到 b 的负实数!!我怎样才能正确实施以使它们相同?

N  =10;
x(1) = 0.1;
for i =1 : N
       x(i+1) = mod(x(i)*2, 1);
end
    y = x;
 s = (y>=0.5);  %generate 0/1 logicals


for n = 1: N        
y(n) = 0.5*s(n+1) + 0.5*y(n+1);   
end

b=x;

 s1 = 2*(b>=0.5)-1; %Generate +1/-1



    for k =1: N
   if s1(k)== -1
       s1(k) = 0;
   end
b(k) = 0.5*s1(k+1) + 0.5*b(k+1);   
 end

设,x =

 0.100000000000000  0.200000000000000   0.400000000000000   0.800000000000000   0.600000000000000   0.200000000000000   0.400000000000000   0.800000000000001   0.600000000000001   0.200000000000003   0.400000000000006

y =

0.100000000000000   0.200000000000000   0.900000000000000   0.800000000000000   0.100000000000000   0.200000000000000   0.900000000000000   0.800000000000001   0.100000000000001   0.200000000000003   0.400000000000006

b =

-0.400000000000000  0.700000000000000   0.900000000000000   -0.200000000000000  -0.400000000000000  0.700000000000000   0.900000000000000   -0.199999999999999  -0.399999999999999  -0.299999999999997  0.400000000000006

你这段代码完全错误,你改了s(k)却用了s(k+1),说明改了s(k)没有任何效果!

 for k =1: N
    if s1(k)== -1
       s1(k) = 0;
    end
 b(k) = 0.5*s1(k+1) + 0.5*b(k+1);   
 end

真正的一个是:

  for k =1: N+1
    if s1(k)== -1
       s1(k) = 0;
    end
  end
  for k =1: N
      b(k) = 0.5*s1(k+1) + 0.5*b(k+1);
  end

y =

第 1 至 10 列

0.1000    0.2000    0.9000    0.8000    0.1000    0.2000    0.9000    0.8000    0.1000    0.2000

第 11 列

0.4000

b =

第 1 至 10 列

0.1000    0.2000    0.9000    0.8000    0.1000    0.2000    0.9000    0.8000    0.1000    0.2000

第 11 栏

0.4000

x= 0.1 0.2 0.4 0.8

1)b=x => b=0.1 0.2 0.4 0.8

2)s1= 2(b>=0.5)-1 =>s1= -1 -1 -1 1

3)loop on s1=> s1= 0 0 0 1

4)b(3)=0.5*s(4)+0.5(b4)=0.5+0.4=0.9

so code is correct, but your formula is in correct! and one another thing, >step 3 and 4 cancel out each other, i mean result of step 3 and 4 together is (b>0.5), and as a conclusion! its obvious from your formula that if x(i)>0.5 and x(i-1)<0.5 then b(i-1) cannot be equal to x(i-1)

because b(i-1)=0.5*X(i)+0.5*((x(i)>0.5))

and if we assume x(i)>0.5 we could write:

b(i-1)=0.5*X(i)+0.5*1

and we know x(i)=mod(2x(i-1),1)=2*x(i-1) {because x(i-1)<0.5 so 2*x(i-1)<1}

so we have

b(i-1)=0.5*2*X(i-1)+0.5*1=X(i-1)+0.5 => b(i-1)>0.5, but x(i-1)<0.5!!!!!

so your formula is wrong.