0% found this document useful (0 votes)
3 views8 pages

Data Representation

Uploaded by

wangyb061103
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views8 pages

Data Representation

Uploaded by

wangyb061103
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 8

Computers work in binary.

All data must be converted into binary in

order for a computer to process it. Sound is no exception. To do

this, sound is captured - usually by a microphone - and then

converted into a digital signal.

An analogue-to-digital converter will capture


a sound wave at regular time intervals.
This recording is known as a sample.

For example, a sound wave like this can be


sampled at each time sample point:

The sound recorded at each sample point is


converted to its nearest numeric equivalent:

Sam
1 2 3 4 5 6 7 8 9 10
ple

Den
8 3 7 6 9 7 2 6 6 6
ary

Bina 10 00 01 01 10 01 00 01 01 01
ry 00 11 11 10 01 11 10 10 10 10

This data is then stored in a file for later use.


Sample rate
Sample rate is the number of samples
recorded in any given period of time.
The higher the sample rate, the closer
the recorded signal is to the original.
Sample rate is measured in hertz.

If the samples recorded above were plotted


on a graph, the resulting representation of
the sound wave would not be too accurate:

A sound wave plotted from 10 samples


However, if the sample rate is doubled - twice
as many samples in the same time period -
the resulting representation would be closer:

A sound wave plotted from 20 samples


However, the higher the sample rate, the
larger the resulting file. As a result, sound
files are often a compromise between quality
and size of file. An audio file is usually
recorded at 44.1 kilohertz. This is high
enough for good sound quality while keeping
file size down to sensible levels.

Bit depth
Bit depth refers to the number
of bits used to record each sample. Just
as with images, the higher the bit depth,
the more accurately a sound can be
recorded, but the larger the file size.
Typical bit depths are 16 bit and 24 bit.

Bit rate
Bit rate is simply a measure of how
much data is processed for each second
of sound. Bit rate is calculated by:

Sample rate × bit depth

As with sample rate, the higher the bit rate,


the better quality of the recorded sound.

~Bit depth refers to the number of bits used to record each sample. Bit rate is a
measure of how much data is processed for each second of sound.
Compression

Modern computers often generate files of


very large sizes. For example, audio files
often run to megabytes, while high definition
video can be gigabytes in size. Such files
require lots of storage space, and, because of
their size, are difficult to transmit. These
problems can be overcome by
using compression.

There are two types of compression that


can be applied to files:

 lossy compression

 lossless compression

Lossy compression
With lossy compression, some data is
removed and discarded, thereby(从而)
reducing the overall amount of data and
the size of the file.

An image can be compressed by reducing


its colour depth. This reduces the range of
colours that the image contains. In practice
this results in an averaging of shades of
colours. For example, a very light shade of
green could be averaged with a not so light
shade - the very light shade might be
discarded, and the pixels affected by it re-
coloured with the darker shade.

Similarly, an audio file can be compressed by


reducing the bit depth of the samples. MP3
is a lossy audio file format.

Various lossy standards exist:

 the JPEG file format works on this


principle, which is why JPEG files
tend to be smaller in size
 the MPEG file format compresses
audio and video, making it more
suitable for streaming media

 >MP3 is a lossy format for audio,


including music

Lossless compression
There are some files that we would not
want to lose data from. For example:

 text files

 spreadsheets

 financial records

 emails

With lossless compression, files are reduced


in size without the loss of data. However,
lossless compression does not usually
achieve the same file size reduction as lossy
compression.

Various lossless standards exist:


 PDF allows lossless compression of
text documents

 GIF is a lossless image file format

One method of lossless compression is run


length encoding (RLE). RLE looks at the data
in a file for consecutive runs of the same
data. These runs are stored as one item of
data, instead of many.

Consider this row in a bitmap image:

The data for this is 00 00 00 11 11 11 11 00


00 00, which is ten data values of two
characters each, giving 20 characters in
total. RLE looks for the runs of each data, and
records what the data is and how many times
in succession it occurs. These values are
stored instead of the original data.

So:

00000011111111000000 (20 characters)


becomes:
608160 (6 characters)

You might also like