You are on page 1of 19

GROUP DISCUSSION

PHM 505
TOPIC- AUDIO COMPRESSION
(Signal Processing)

Submitted to : Submitted by:


Prof.Sandeep Paul Shatdharsanam Uttam kumar
Shobhit kumar
WHAT IS
COMPRESSION ?
Compression is a reduction in the number of bits needed to represent
data.

Compressing data can save storage capacity, speed file transfer, and
decrease costs for storage hardware and network bandwidth.

Compression is performed by a program that uses a formula or


algorithm to determine how to shrink the size of the data.
COMPRESSION

AUDIO COMPRSSION
1 Audio data compression
• Lossless Audio Compression.
• Lossy Audio Compression.
2 Audio level compression
AUDIO COMPRESSION

 Audio compression is a form of data compression designed to


reduce the size of audio data files.
 Audio compression can mean Two things:
• Audio data compression
• Audio level compression
AUDIO DATA COMPRESSION
 Audio data compression in which the amount of data in a
recorded waveform is reduced for transmission.
 This is used in MP3 encoding, internet radio, and the like.
Audio Data Compression can be either:
• Lossless Audio Compression.
• Lossy Audio Compression.
AUDIO DATA COMPRESSION
 Lossless Audio Compression
■ Removes redundant data
■ Resulting signal is same as original - perfect
reconstruction
 Lossy Audio Encoding
■ Removes irrelevant data
■ Resulting signal is similar to original
AUDIO LEVEL COMPRESSION
 Audio Level Compression Is also Called as Dynamic
Range Compression.
 Audio level compression in which the dynamic range
(difference between loud and quiet) of an audio waveform
is reduced.
 This is used in guitar effects racks, recording studios, etc.
 Types of Dynamic Rage Compression:
• Downward compression
• Upward compression
AUDIO LEVEL COMPRESSION
• Downward compression reduces loud sounds over a
certain threshold while quiet sounds remain unaffected.
• • Upward compression increases the loudness of sounds
below a certain threshold while leaving louder sounds
unaffected.
ADVANTAGES OF AUDIO COMPRESSION

 Faster transmission time.


 Reduced transmission costs.
 Smaller size.
 Reduced bandwidth due to Smaller Size
DISADVANTAGES OF AUDIO COMPRESSION

• Compression can only be used if both the transmitting and


receiving modems support the same compression
procedure.
• Needs processing both for encoding and decoding.
• if a lossy compression method is used, the quality is
reduced.
• Lossless compression methods exist and they achieve
about 50% reduction in size.
These three step to use audio compression

• Sampling: Reducing the sample rate of the audio signal.


• Filtering: Applying filters to eliminate certain frequency
ranges.
• Quantization: Reducing the bit depth or precision of the
audio signal.
Sampling
Sampling involves capturing snapshots of a continuous
signal at specific intervals in time. In the context of audio,
this means measuring the amplitude of the sound wave at
regular time intervals to create a discrete representation of
the original continuous audio signal.
Filtering
Filtering out certain sound frequencies and reducing the bit rate
would typically fall under the category of lossy compression. By
removing parts of the audio data, especially those less perceptible
to human hearing or by reducing the precision of certain elements,
it achieves higher compression rates at the cost of some loss in
audio quality. MATLAB offers tools to manipulate audio signals,
enabling you to implement such compression techniques by
filtering out specific frequencies and reducing the bit rate.
Quantization
• Quantization is the process of reducing the number of distinct values in a
continuous set of values. In the context of audio, it involves reducing the
precision or bit depth of the samples used to represent the audio signal.
• For example, in an 8-bit audio system, the amplitude of the audio signal
is represented using 256 (2^8) discrete levels. Quantization reduces the
resolution by assigning each sample to the nearest available level,
effectively reducing the accuracy of the representation.
• Higher bit depths provide more accurate representation but also require
more storage space or bandwidth. By reducing the bit depth through
quantization, you can achieve compression, although this reduction in
precision may lead to a loss in audio quality, especially in subtle details
and dynamic range.
Difference between quantization and sampling

Quantization and sampling are both fundamental


concepts in signal processing, particularly in digitizing
analog signals like audio.
• Sampling: Sampling involves capturing snapshots of
a continuous signal at specific intervals in time. In the
context of audio, this means measuring the amplitude
of the sound wave at regular time intervals to create a
discrete representation of the original continuous
audio signal.
• Quantization: Quantization occurs after sampling. It involves
assigning discrete values to the continuous amplitude levels
obtained from sampling. In audio, this is akin to converting the
amplitude of each sample to a specific digital value. This process
reduces the precision or bit depth of each sample by rounding or
assigning it to the nearest available value in a limited set of
possible values.
In summary, sampling involves capturing the signal at regular
intervals in time, while quantization involves converting the
continuously varying amplitude levels obtained from sampling
into discrete digital values. Both are crucial steps in the analog-to-
digital conversion process but serve different purposes in creating
a digital representation of analog signals like audio.
Matlab Code:
• % Read the audio file
• [input_audio, Fs] = audioread('input_audio.wav');

• % Display the original audio waveform


• subplot(2,2,1);
• plot(input_audio);
• title('Original Audio');

• % Sampling (reduce the sample rate by a factor of 2)


• downsampled_audio = downsample(input_audio, 2);

• % Display the downsampled audio waveform


• subplot(2,2,2);
• plot(downsampled_audio);
• title('Downsampled Audio');

• % Filtering (low-pass filter to remove high frequencies)


• cutoff_frequency = 4000; % Define cutoff frequency in Hz
• normalized_cutoff = cutoff_frequency / (Fs/2); % Normalize cutoff frequency
• filter_order = 8; % Filter order
• [b, a] = butter(filter_order, normalized_cutoff, 'low'); % Design the filter
• filtered_audio = filter(b, a, downsampled_audio);
• % Display the filtered audio waveform
• subplot(2,2,3);
• plot(filtered_audio);
• title('Filtered Audio');

• % Quantization (reduce bit depth to 8 bits)


• quantized_audio = uint8((filtered_audio + 1) * 127); % Scale and convert to uint8

• % Display the quantized audio waveform


• subplot(2,2,4);
• plot(quantized_audio);
• title('Quantized Audio');

• % Save the compressed audio as a new file


• audiowrite('compressed_audio.wav', quantized_audio, Fs/2); % Save at the reduced sample rate

• % Play the original and compressed audio


• sound(input_audio, Fs); % Play original audio
• pause(length(input_audio)/Fs); % Pause between sounds
• sound(quantized_audio, Fs/2); % Play compressed audio at the reduced sample rate
Plots obtained

You might also like