I am working on a personal project and I am having some conceptual level questions on arithmetic encoding.
- Let's take a scenario where I have an array of sensors and the data collected is transmitted over the internet to Alice. Naturally to decrease transmission cost I would want to transmit data in compressed form. But the data source is non stationary in nature and I have read that we use Adaptive Arithmetic Encoding in such scenario. But I can do this trick that, collect sensor data in a fixed size buffer and when buffer is full then use Normal Arithmetic Encoding and send the encoded sequence over the internet. So my question is why would I want to use Adaptive Arithmetic Encoding in this scenario and what advantage will it serve me? If the above stated scenario is not applicable please explain using other example.
- Have I understood both the concepts correctly? (By checking algorithms of both and please point out mistakes if any)
Arithmetic Encoding
start
statistical_model = collect_stats(data) //we need to perform single pass over data to collect stats
for each symbol in data:
probability_distribution = statistical_model(symbol) //calculate conditional probability distribution for the current symbol given previous n symbols
current_state = artimetic_encoding(probability_distribution, previous_state)
return current_state
end
Adaptive Arithmetic Encoding
start
statistical_model = init() // initialize the model in such a way which is known to both encoder and decoder (for example: zero initialization)
for each symbol in data:
probability_distribution = statistical_model(symbol) //calculate conditional probability distribution for the current symbol given previous n symbols
current_state = adaptive_artimetic_encoding(probability_distribution, previous_state)
update_model(statistical_model, symbol)
return current_state
end