Edge Rewrite
// HTMLRewriter · presentation

This page was redesigned at the edge.

Cloudflare fetched the original article and streamed it through HTMLRewriter to apply an entirely new visual system without rebuilding the source page.

// request.cf · coarse context

A page that knows where it met you.

Only coarse request metadata is shown. This demo does not display or persist visitor IP addresses.

Country
US
Cloudflare location
CMH
Connection
HTTP/2
Language
Not provided

Ray ID: a21c10b27ba84440

Jump to content

// Workers AI · dad joke modeWhat did A-law algorithm say? It had a byte to say.

From Wikipedia, the free encyclopedia
Comparison of A-law (blue) and μ-law (red) compression on an input signal (green). Both axes use logarithmic scale in decibels.
Plot of F(x) for A-Law for A = 87.6

An A-law algorithm is a standard companding algorithm, used in European eight-bit PCM digital communications systems to optimize, i.e. modify, the dynamic range of an analog signal for digitizing. It is one of the two companding algorithms in the G.711 standard from ITU-T, the other being the similar μ-law, used in North America and Japan.

For a given input , the equation for A-law encoding is as follows:

where is the compression parameter. In Europe, .

A-law expansion is given by the inverse function:

The reason for this encoding is that the wide dynamic range of speech does not lend itself well to efficient linear digital encoding. A-law encoding effectively reduces the dynamic range of the signal, thereby increasing the coding efficiency and resulting in a signal-to-distortion ratio that is superior to that obtained by linear encoding for a given number of bits.

Comparison to μ-law

[edit]

The μ-law algorithm provides a slightly larger dynamic range than the A-law at the cost of worse proportional distortion for small signals. By convention, A-law is used for an international connection if at least one country uses it.

See also

[edit]
[edit]