Question: Using Matlab 3.5. Suppose a data source produces a series of characters drawn from a set of M distinct symbols. If symbol k is produced
Using Matlab

3.5. Suppose a data source produces a series of characters drawn from a set of M distinct symbols. If symbol k is produced with probability pk, the first-order entropy of the source is defined as k-1 Essentially Hi is the number of bits needed per symbol to encode a long mes- sage; that is, it measures the amount of information content, and therefore the potential success of compression strategies. The value Hi -0 corre- sponds to the case of only one symbol being produced-no information- while if all M symbols have equal probability, then H1 -log2 M. Write a function [H,M) entropy (v) that computes entropy for a vector v. The probabilities should be computed empirically by finding the unique entries (using unique), then counting the occurrences of each symbol and dividing by the length of v. Try your function on some built-in image data by entering load clown, v -X(:)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
