There's nothing up by sleeves, nothing in my head ...

By the end of today, you should:

understand differences between analog and digital signals

understand sampling rate, bit resolution, bit rate and calculating file size

think about the basics of Copyright law

Our ears interact with an analog world of sound waves, but music and other sounds are all being done digitally now. Why? How?

- Analog signals always
*degrade*with time, distance and other factors. - With an analog signal, you can't be entirely sure of what the original sound was supposed to be out of the literally infinite number of possibilities.
- Digital signals are only transmitting one of
*two*possible values (zero and one). Each is a*bit*. - Therefore, when the receiver gets a degraded signal, it can make
an informed guess about which of the two possibilities was actually
transmitted. This allows the signal to be
*cleaned-up*.

Sound travels faster in:

vacuum

water

air

speed doesn't depend on the medium

A little yappy dog's barking is:

Low amplitude, low pitch

Low amplitude, high pitch

High amplitude, low pitch

High amplitude, high pitch

Analog signals are superior to digital signals.

True

False

There is no difference between the two.

Digital signals are superior to analog because

Errors can be avoided

Errors can be detected

Errors can be corrected

Signals can be compressed

When will the parity bit **NOT** be able to detect an error:

When there is an odd number of bits in the transmission.

When there is an even number of bits in the transmission.

When the number of changed bits is even.

When the number of changed bits is odd.

Assume that the even parity bit indicates that there has been an error in transmission, what is our best option?

There is nothing we can do about it, noise is part of every transmission.

We can use the parity bit to identify the error and fix it.

We can use error correction algorithms to reconstruct the original signal.

We will have to request for the signal to be retransmitted.

Test yourself with this Online tone generator or this hearing test.

Have I convinced you? Good. So, how do we do it? How do we represent sound digitally?

- Imagine drawing the analog signal on graph paper. Make two
crucial decisions:
- The
*resolution*on the vertical axis, and - the
*resolution*on the horizonal axis.

- The
*Sample*the analog signal at each vertical line (each moment in time), rounding it off at the nearest horizontal line. Write this down as a number.- The sequence of numbers is then the
*digitized*signal. - The resolution of the vertical axis (how close together the
horizontal lines are) determines the
*number of bits per sample*. Usually, this is some nice round number like 8, 16 or 32 bits per sample. - The resolution of the horizontal axis (how close together the
vertical lines are) determines the
*sampling rate*. - The product of these two gives the
*bit-rate*. - The greater the bit rate, the better the receiver
can
*reconstruct*the original signal. - The Nyquist theorem tells us how high the sampling rate has to be in order to capture sounds up to a given maximum frequency (pitch).

The bit resolution is:

The sampling rate.

A multiple of the fundamental frequency.

The number of bits to represent frequency values.

The number of bits to represent amplitude values.

If the whales can produce sound in the range 10 Hz - 30 KHz, at what frequency we would have to sample to produce a digital recording?

15 KHz

20 KHz

30 KHz

45 Khz

60 KHz

Compute the bit rate in bits per second and the approximate file size in KB given the following information:

- Pitches up to 50KHz
- 16 bit resolution
- 10 seconds of sound

You might get the following:

Sampling rate is 100 KHz (double)

Bit rate is 100,000 * 16 bits or 1,600,000 bits per second

File size is 10 * 1,600,000 / (8 * 1000) = 10 * 200 = 2000 KB

Knowing that the **bit rate** is the number of bits to represent one second of digital sound,
write jQuery/Javascript code that will perform the calculations for the form shown below.

The statements for reading the content from the fields is already given, you need to write two functions that take paremeters and return values and invoke them. Read comments in the execution box.

<form> <p>Bit Resolution: <input name="resolution"></p> <p>Sampling Rate: <input name="sampling"></p> <p>Time (in seconds): <input name="seconds"></p> <p>The Bit Rate is: <span id="bitrate"></span></p> <p>The File Size is: <span id="filesize"></span></p> </form>

Your solution might look like this:

function calculate_bitrate(bRes, sRate){ return bRes * sRate; } $("#bitrate").text(calculate_bitrate(bitRes, sampling)); function calculate_filesize(bRes, sRate, seconds){ var bitrate = calculate_bitrate(bRes, sRate); return bitrate * seconds / (8*1000); // convert in KB } $("#filesize").text(calculate_filesize(bitRes, sampling, seconds));

We hope that after these activities you can:

- understand digital signals and how they are transmitted
- sampling for conversion between analog and digital signals
- think of copyright law and fair use

Will be posted later, visit again after .