| Products & Services | Solutions | Academia | Support | User Community | Company |
| Download Product Updates | | | Get Pricing | | | Trial Software |
| Documentation → Communications Toolbox |
| Contents | Index |
| Learn more about Communications Toolbox |
dseq = arithdeco(code,counts,len)
dseq = arithdeco(code,counts,len) decodes the binary arithmetic code in the vector code to recover the corresponding sequence of len symbols. The vector counts represents the source's statistics by listing the number of times each symbol of the source's alphabet occurs in a test data set. This function assumes that the data in code was produced by the arithenco function.
This example is similar to the example on the arithenco reference page, except that it uses arithdeco to recover the original sequence.
counts = [99 1]; % A one occurs 99% of the time. len = 1000; seq = randsrc(1,len,[1 2; .99 .01]); % Random sequence code = arithenco(seq,counts); dseq = arithdeco(code,counts,length(seq)); % Decode. isequal(seq,dseq) % Check that dseq matches the original seq.
The output is
ans =
1
This function uses the algorithm described in [1].
[1] Sayood, Khalid, Introduction to Data Compression, San Francisco, Morgan Kaufmann, 2000.
![]() | ammod | arithenco | ![]() |

Learn how to apply early verification to your development process through these technical resources.
How much time do you spend on testing to ensure implementation meets system-level requirements?
| © 1984-2009- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |