Presentation on theme: "Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby"— Presentation transcript:
Lecture 17 Analog Music Storage Digital Signals Digital Music Storage Instructor: David Kirkby (firstname.lastname@example.org)
Physics of Music, Lecture 17, D. Kirkby2 Miscellaneous Normal office hours this week: Wed 10-11am, 3-4pm. I will be travelling Fri-Wed. Office hours will be Wed (Dec 11) 3-5pm during exam week. The final exam will be 90 mins, held in class on Fri Dec 13. The final exam format will be similar to the midterm: multiple choice questions (bring a Scantron again!) Free-form questions We will do some review questions in class on Thursday.
Physics of Music, Lecture 17, D. Kirkby3 Analog Signals An analog sound signal can be represented as a curve of amplitude versus time: amplitude time Ideally, both time and amplitude can vary continuously over any range.
Physics of Music, Lecture 17, D. Kirkby4 Analog Sound Storage The first sound recordings were made by Thomas Edisons tinfoil phonograph in 1877 (a productive period: the telephone was invented in 1876 and the electric light bulb in 1878!). Edisons invention was later perfected into the Berliner and Victor gramophones.
Physics of Music, Lecture 17, D. Kirkby5 Stereo LP Records Stereo records pressed in vinyl consist of small grooves whose walls are carved in the shape of the signal to be recorded: A diamond-tipped stylus follows these grooves to recreate the recorded sound. How does a single groove record stereo sound?
Physics of Music, Lecture 17, D. Kirkby6 Magnetic Tape Another method of storing signals is magnetically. Magnetic audio tape consists of a thin plastic tape (135m long for 90 mins) coated in a magnetic powder. Individual particles in the coating behave like tiny magnets. The fraction of particles whose magnets line up encodes the signals amplitude. This fraction is read by a magnet with a small (~4 m) gap as the tape moves (~5cm/s) by.
Physics of Music, Lecture 17, D. Kirkby7 Cassette tape actually encodes four parallel tracks of information: Side A left channel Side A right channel Side B left channel Similar techniques of magnetic storage are used in video tapes, and computer hard discs & floppy discs.
Physics of Music, Lecture 17, D. Kirkby8 Digital Signals Digital signals replace the continuous amplitude and time variables with their discrete (or quantized) equivalents: What are the advantages and limitations of converting an analog signal into a digital form? amplitude time
Physics of Music, Lecture 17, D. Kirkby9 Digital Signals are Immune to Noise The main advantage of a digital signal over the corresponding analog signal is it can usually be stored (eg, on a CD) or transmitted (eg, over the internet) without being corrupted by the addition of any noise. This means that the stored or transmitted digital copy is an exact replica of the original digital signal. Analog signals are not immune to noise, so that making a copy of a copy of a … copy results in a final copy that is significantly degraded from the original source version. Analogy: broken telephone game with full-sentence or yes/no answers.
Physics of Music, Lecture 17, D. Kirkby10 Here is an example of a CD-quality digital sample that we will use for audio tests. Can you predict what you will hear based on the samples spectrograph?
Physics of Music, Lecture 17, D. Kirkby11 Limitations of Time Sampling The main limitation of only recording the signals amplitude at regularly-spaced intervals is that some wiggles between samples are lost. These wiggles correspond to high-frequency components of the original signal so that only frequencies f < 1/(2T) can be accurately represented by the digital signal (Nyquist Sampling Theorem). amplitude time
Physics of Music, Lecture 17, D. Kirkby12 Aliasing Listen to these digital recordings with different sampling rates: 44.1 kHz (CD quality) 8 kHz (typical phone line quality) 2 kHz Note that frequencies above the cutoff frequency (2/T) do not disappear, but instead are mirrored at lower frequencies below the cutoff! This effect is called aliasing. time frequency 2/T
Physics of Music, Lecture 17, D. Kirkby13 Here are the spectrograms of the 44kHz and 2kHz sounds:
Physics of Music, Lecture 17, D. Kirkby14 Filtering and Phase Distortion The solution to the aliasing problem is to remove high frequencies from the original analog signal, before converting it to a digital signal: 44.1 kHz (CD quality) 8 kHz (typical phone line quality) 2 kHz Low-Pass Filter Analog-to- Digital Converter The filtering can introduce a new type of problem (phase distortion) for frequencies near the cutoff frequency. These effects are not audible for sampling rates above ~40kHz (DAT: 48kHz, DVD-Audio: up to 192 kHz)
Physics of Music, Lecture 17, D. Kirkby15 Here are the spectrograms of the 2kHz sample with and without 1kHz low-pass filtering: with LP filter without LP filter
Physics of Music, Lecture 17, D. Kirkby16 Limitations of Amplitude Sampling Amplitude sampling means that there is a smallest possible change that can be represented. In practice, amplitude sampling also means that there is a minimum/maximum amplitude that can be represented. amplitude time
Physics of Music, Lecture 17, D. Kirkby17 Binary Amplitude Levels The most common way of digitally encoding amplitude levels is with Pulse Code Modulation (PCM). PCM signals are encoded in binary with a certain number B of bits. This means that some range of amplitudes (-A LIM,+A LIM ) is covered by 2 B discrete levels: B = 4 gives 16 levels B = 8 gives 256 levels B = 16 gives 65536 levels Amplitude changes of less than 2A LIM / 2 B are too small too encode. Amplitudes beyond -A LIM or +A LIM are too large too encode.
Physics of Music, Lecture 17, D. Kirkby18 Quantization Error The difference between the true amplitude and the digital amplitude value for each sample is called the quantization error. Quantization error is more noticeable for quiet signals than for loud signals. Listen to these digital recordings (at 44.1kHz) using: 16-bit (65536 levels, CD quality) 8-bit (256 levels, typical telephone quality) 4-bit (16 levels) Dithering and companding are two techniques for minimizing the effects of quantization error.
Physics of Music, Lecture 17, D. Kirkby19 Compare these spectrograms for 16-bit, 8-bit and 4-bit amplitude digitization:
Physics of Music, Lecture 17, D. Kirkby20 Clipping Amplitudes outside of the range (-A LIM,+A LIM ) are clipped: amplitude time -A LIM +A LIM Clipping affects loud signals more than quiet signals. Listen to these examples of clipped sounds: some clipping more clipping
Physics of Music, Lecture 17, D. Kirkby21 Compare these spectrograms with different amounts of clipping:
Physics of Music, Lecture 17, D. Kirkby22 Sampling Rate and Levels Tradeoff The amount of space S (in bytes) needed to store eight seconds of music (or any other sound) recorded at a sampling rate R (in Hz) and with 2 B levels is: S = R x B For example, 8 secs of CD-quality music (R=44.1 kHz, B = 16) takes up ~0.7 Mbytes. The same amount of telephone- quality music (R=8 kHz, B=8) takes up ~64 kbytes. Compare these digital recordings that each take the same amount of space (32 kbytes / 8 secs, 20x less than CD): 2 kHz sampling rate, 16-bit amplitude levels 4 kHz sampling rate, 8-bit amplitude levels 8 kHz sampling rate, 4-bit amplitude levels
Physics of Music, Lecture 17, D. Kirkby23 Compare these spectrograms with different rate-levels tradeoffs (but all the same size, ~20x smaller than CD): 2 kHz, 16 bit 4 kHz, 8 bit 8 kHz, 4 bit