least significant bit process
조회 수: 8 (최근 30일)
이전 댓글 표시
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);
댓글 수: 0
답변 (1개)
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
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 Exchange에서 Data Type Conversion에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!