Question: What processes give rise to the lossy nature of JPEG/MPEG video compression?

Answer:

Lossy steps:

Colour space subsampling in IQ or UV components.

Quantization reduces bits needed for DCT components.

Question:

(A) In MPEG audio compression, what is frequency masking?

Answer:

When an audio signal consists of multiple frequencies the sensitivity of the ear changes with the relative amplitude of the signals. If the frequencies are close and the amplitude of one is less than the other close frequency then the second frequency may not be heard.

(B) Briefly describe the cause of frequency masking in the human auditory system?

Answer:

Frequency Masking:

Stereocilia in inner ear get excited as fluid pressure waves flow over them.

Stereocilia of different length and tightness on Basilar membrane so resonate in sympathy to different frequencies of fluid waves (banks of stereocilia at each frequency band).

Stereocilia already excited by a frequency cannot be further excited by a lower amplitude near frequency wave.

(C) In MPEG audio compression, what is temporal masking?

Answer:

After the ear hears a loud sound, consisting of multiple frequencies, it takes a further short while before it can hear a quieter sound close in frequency.

(D) Briefly describe the cause of temporal masking in the human auditory system?

Answer:

(Like frequency masking) Stereocilia in inner ear get excited as fluid pressure waves flow over them and respond to different frequencies.

Stereocilia already excited by a certain frequency will take a while to return to rest state, as inner ear is a closed fluid chamber and pressure waves will eventually dampen down.

Similar to frequency masking Stereocilia in a ’dampening state’ may not respond to a a lower amplitude near frequency wave.

(E) Briefly describe, using a suitable diagram if necessary, the MPEG-1 audio compression algorithm, outlining how frequency masking and temporal masking are encoded.

Answer:

MPEG audio compression basically works by:

Dividing the audio signal up into a set of frequency subbands (Filtering)

Use filter banks to achieve this.

Subbands approximate critical bands.

Each band quantised according to the audibility of quantization noise.

Frequency masking and temporal masking are encoded by:

Frequency Masking: MPEG Audio encodes this by quantising each filter bank with adaptive values from neighbouring bands energy, defined by a look up table.

Temporal Masking: Not so easy to model as frequency masking. MP3 achieves this with a 50% overlap between successive transform windows gives window sizes of 36 or 12 and applies basic frequency masking as above.

Question: Construct coding tree for ROADROADIES by Shannon-Fano Algorithm and calculate the entropy. Get the Compression Ratio also for the same.

Answer:Shannon-Fano Algorithm:

Sort the symbols according to the frequency count of their occurrences.

Recursively divide the symbols into two parts, each with approximately the same number of counts, until all the parts contain only 1 symbol.

Below are the letters with their occurrence counts.[occurrence counts should be in descending form]

Since the heap contains only one node, the algorithm stops here.Traverse the tree formed starting from the root. Maintain an auxiliary array. While moving to the left child, write 0 to the array. While moving to the right child, write 1 to the array

The codes are as follows:

Symbol
code

C 0

B 10

D 11

A 10

E 1100

G 1101

F 111

Average number of bits needed for each character: Entropy:

2.6282 average number of bits are required to represent each symbol.Question:
Suppose eight characters have a distribution A:(1), B:(1), C:(1), D:(2), E:(3), F:(5), G:(5), H:(10). Draw a Huffman tree for this distribution.

Solution:

Question:
Perform run length encoding for the following and calculate compression ratio AC0000AAAAB00000000A0AAA00000.

Solution:Run length encoding

Before Encoding : AC0000AAAAB00000000A0AAA00000

After Encoding : 1A1C404A1B801A103A50

Compression Ratio

Compression Ratio = Total number of bits before encoding/Total number of bits after encoding

Compression Ratio = 29/20 = 1.45

Question:
Answer the following

a. Why is the display order and encoding order of MPEG frames different ? Given the display order of frames, find the coding order. I(1) B(2) B(3) P(4) B(5) B(6) P(7) B(8) B(9) P(10) I(11)
b. State the difference between frequency masking and temporal masking in MPEG audio. How are these two encoded in MPEG audio?
c. If the block size for a 2D DCT transform is 8 X8, and we use only the DC components to create a thumbnail image, what fraction of the original pixels would we be using?

Solution:

a.
P and B frames are much more complicated, since they depend on other frames. So we have to buffer a previous frame and a future frame to decode P and B frames. The name "future frame" indicates that the frame should be displayed after the current frame. However, it is actually encoded before the current frame. So the display order of frames in a MPEG sequence is different from the decoding order. Coding order : I(1)P(4)B(2)B(3)P(7)B(5)B(6)P(10)B(7)B(8)I(11)

b.frequency masking:
When an audio signal consists of multiple frequencies the sensitivity of the ear changes with the relative amplitude of the signals. If the frequencies are close and the amplitude of one is less than the other close frequency then the second frequency may not be heard.

temporal masking:

After the ear hears a loud sound, consisting of multiple frequencies, it takes a further short while before it can hear a quieter sound close in frequency. MPEG Audio encodes frequency masking by quantizing each filter bank with adaptive values from neighboring bands, defined by a look up table.

Achieved with a 50% overlap between successive transform windows and then applying frequency masking

About WaseianAt WASEIAN group, our affection to all the WASEians who have landed here for up-skilling themselves. We come up with various knowledge assistances with the wide range of Tutorials, Quizzes, Project tasks and Coursework as well.