least significant bit process

7 ビュー (過去 30 日間)
Internazionale
Internazionale 2013 年 3 月 17 日
i have matrix A, let we say, A=rand(1,256). A contains important coefficient. Because A is decimal like 0.xxxx, so i make B=A*10000. i make this for i can process dec2bin because i don't know how to convert decimal number to biner. after i get B, C=dec2bin(B,18).
i got 256 binary value of C. i want process LSB every value of C, every bits in c(1,1) until C(1,256) @18 bits must change the least significant bit of F.
example, C(1,1) = 001101010101010111 embedded into least bits of F, from F(1,1) until F(1,18) and until the whole C
A=rand(1,256);
B=A*10000;
C=dec2bin(B,18);
D=rand(1,5000);
E=F*10000;
F=dec2bin(E,18);

回答 (1 件)

Walter Roberson
Walter Roberson 2013 年 3 月 17 日
B = fix(A * 10000);
lsb = mod(B,2);
changed_B = B - lsb + newlsb;
where newlsb is the values (0 or 1) of the new bits.
  2 件のコメント
Internazionale
Internazionale 2013 年 3 月 17 日
sir, i think you're wrong with my question. read my example.
Walter Roberson
Walter Roberson 2013 年 3 月 17 日
B is not going to have 18 bits worth of integer information per location. The maximum value for any B entry is going to be 1 * 10000, and that will have about 13.28771238 bits of integer information.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeData Type Conversion についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by