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

标签 matlab binary-data nonlinear-functions quantization

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

description

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

设,分区数M=2,符号空间={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.

关于Matlab : Unable to get unique rationals when implementing a formula for binary to real number conversion Part1,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30583163/

相关文章:

c# - MATLAB NET.ASSEMBLY 与 C#

arrays - 在Matlab中将矩阵中的元素i,j设置为i^j

python-2.7 - 在 python scikit-learn 中,RBF 内核的性能比 SVM 中的线性性能差得多

arrays - 如何从矩阵中获取 ndgrid?

perl - 在 Perl 中将二进制数据拆分为字节数组

java - 如何使用POST上传二进制数据

c++ - 从二进制文件中读取 Int

shell - 执行shell脚本后退出applescript应用程序

matlab - 逻辑图绘图不正确(Matlab)

matlab - || 的操作数and && 运算符必须可转换为逻辑标量值