Analog Signals Continuous-Time Signals Discrete-Time, Digital Signals

Analog Signals Continuous-Time Signals Discrete-Time, Digital Signals

Analog Signals Music 171: Fundamentals of Digital Audio • Tamara Smyth, [email protected] A signal, of which a sinusoid is only one example, is Department of Music, a set, or sequence of numbers. University of California, San Diego (UCSD) • The term “analog” refers to the fact that it is October 15, 2019 “analogous” of the signal it represents. • A “real-world” signal is captured using a microphone which has a diaphragm that is pushed back and forth according to the compression and rarefaction of the sounding pressure waveform. Figure 1: The electrical signal used to represent the pressure variations of a sound wave is an analog signal. • The microphone transforms this displacement into a time-varying voltage—an analog electrical signal. 1 Music 171: Fundamentals of Digital Audio 2 Continuous-Time Signals Discrete-Time, Digital Signals • Analog signals are continuous in time. • When analog signals are brought into a computer, they must be made discrete (finite and countable). • A continuous-time signal is an infinite and uncountable sequence of numbers, as are the possible • A discrete-time signal is a finite sequence of values each number can have. numbers, with finite possible values for each number. – – between a start and end time, there are infinite number values are limited by how many bits are possible values for time t and the waveform’s used to represent them (bit depth); instantaneous amplitude x(t). – can be stored on a digital storage medium. • A continuous signal cannot be stored, or processed, in a computer since it would require infinite data. • Analog signals must be discretized (digitized) to produce a finite set of numbers for computer use. • Sampling: the process of taking individual values of a continuous-time signal (at regular time intervals). Music 171: Fundamentals of Digital Audio 3 Music 171: Fundamentals of Digital Audio 4 Analog to Digital Conversion Sampling • The process by which an analog signal is digitized is • Sampling: process of taking values (samples) of the called analog-to-digital or “a-to-d” conversion analog waveform at regularly spaced time intervals. • analog-to-digital converter (ADC): the device x(t) x[n] = x(nTs) that discretizes (digitizes) an analog signal. ADC • The ADC must accomplish two (2) tasks: 1. sampling: Ts = 1/fs – taking values (samples) at regular time intervals; Figure 2: The ideal analog-to-digital converter. 2. quantization: – assign a number to the value (using limited computer bits). • Sampling Rate: number of samples taken per second (Hz); – fs = 48 kHz (professional studio) – fs = 44.1 kHz (CD) – fs = 32 kHz (broadcasting) • Sampling Period: time interval (in seconds) between samples: Ts =1/fs seconds. Music 171: Fundamentals of Digital Audio 5 Music 171: Fundamentals of Digital Audio 6 Sampled Sinusoids Question 1 • Sampling corresponds to transforming the continuous • If the following sinusoid was sampled at fs = 16 Hz, time variable t into a set of discrete times that are – what is the duration of the signal shown? integer n multiples of the sampling period Ts: 1 t −→ nTs. 0.8 • Integer n corresponds to the index in the sequence. 0.6 • Continuous sinusoid: 0.4 0.2 x(t)= A sin(ωt + φ). 0 • Discrete sinusoid −0.2 −0.4 x(n)= A sin(ωnTs + φ), −0.6 a sequence of numbers that may be indexed by n. −0.8 −1 0 5 10 15 20 25 Sample Index • What would the duration be if fs = 32? Music 171: Fundamentals of Digital Audio 7 Music 171: Fundamentals of Digital Audio 8 • Answer 1 If fs = 32, the duration is shorter: 24 3 24 × T = = = .75 s. s 32 4 • If fs = 16, what is the duration shown? 1 0.8 0.6 0.4 0.2 0 −0.2 −0.4 −0.6 −0.8 −1 0 5 10 15 20 25 Sample Index • The sampling period (time between samples) is Ts =1/16 s. Since 24 samples are shown, the duration is 24 3 24 × T = = =1.5 s. s 16 2 Music 171: Fundamentals of Digital Audio 9 Music 171: Fundamentals of Digital Audio 10 Question 2 Answer 2 (Method 1) • If the following sinusoid was sampled at fs = 16 Hz, • If fs = 16, what is the frequency of the sinusoid? – what is the frequency of the sinusoid? 1 0.8 1 0.6 0.8 0.4 0.6 0.2 0.4 0 0.2 −0.2 0 −0.4 −0.2 −0.6 −0.4 −0.8 −0.6 −1 −0.8 0 5 10 15 20 25 Sample Index −1 0 5 10 15 20 25 Sample Index • Method 1: – 16 samples corresponds to 1 second, – there are 2 cycles in 1 second (after 16 samples), – the frequency is 2 Hz. Music 171: Fundamentals of Digital Audio 11 Music 171: Fundamentals of Digital Audio 12 • Answer 2 (Method 2) If fs = 32, then the frequency is higher: 1 32 f = = =4 Hz. T 8 • If fs = 16, what is the frequency of the sinusoid? 1 0.8 0.6 0.4 0.2 0 −0.2 −0.4 −0.6 −0.8 −1 0 5 10 15 20 25 Sample Index • Method 2: the period of the sinusoid is 8 1 T =8 × T = = , s 16 2 and the frequency is 1 1 f = = =2 Hz. T 2 Music 171: Fundamentals of Digital Audio 13 Music 171: Fundamentals of Digital Audio 14 Sampling and Reconstruction Importance of Knowing Sampling Rate • Once x(t) is sampled to produce x(n), time scale • If the signal is digitized and reconstructed using the information is lost. same sampling rate, the frequency and duration will • x(n) may represent a number of possible waveforms. be preserved. • If reconstruction is done using a different sampling Continuous 2-Hz Sinusoid 1 rate, the time interval between samples 0.5 changes resulting in a change in 0 -0.5 – overall signal duration, -1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 – time to complete one cycle (period) and thus Time (s) 2-Hz Sinusoid Sampled at 32 Hz 1 sounding frequency. 0.5 0 -0.5 -1 0 5 10 15 20 25 30 Sample index 2-Hz Sinusoid Sampled at 32 Hz and Reconstructed at 16 Hz 1 0.5 0 -0.5 -1 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Time (s) • Reconstructing at half the sampling rate (Fs/2) will double the time between samples (2/Fs), making the sinusoid twice as long and halving the frequency. Music 171: Fundamentals of Digital Audio 15 Music 171: Fundamentals of Digital Audio 16 Question 3 Answer 3 • A 220-Hz sinusoid is sampled at fs1 = 44100. It is • then played on an audio system having a different If a 220-Hz sinusoid sampled at fs1 = 44100 Hz is played back at fs2 = 22050 Hz (fs1/2), then the sampling rate of fs2 = 22050 Hz. – – At what frequency will the sinusoid sound? period between the samples will be twice as long: 1 1 2 2 Ts2 = = = = , fs2 22050 44100 fs1 – and the period of oscillation will double: 2 2 T2 =2T1 = = s, f1 220 – and the corresponding frequency will be halved (sound an octave lower): 1 220 f2 = = = 110 Hz. T2 2 Music 171: Fundamentals of Digital Audio 17 Music 171: Fundamentals of Digital Audio 18 Sampling in Practice II Question 4 • In the Beatles track “In My Life” (1:28) there is a • What is the sampling rate and frequency of the Baroque-style piano solo composed and played by following sinusoid? George Martin: 1 – piano solo 0.8 Problem: George Martin’s couldn’t play fast enough! 0.6 Solution: 0.4 0.2 – play an octave lower and at half tempo 0 – record at 1/2 sampling rate (or “speed” if analog), −0.2 – play back at twice the rate at which it was −0.4 recorded. −0.6 Effect: The distortion creates a sort of harpsichord −0.8 sound at the regular tempo and pitch. Why? −1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 • Listen to how the original sound regains a piano Time (s) quality when played at 1/2 the sampling rate: – piano solo at 1/2 sampling rate • Note: Beatles recordings were actually analog, but the same principles apply! Music 171: Fundamentals of Digital Audio 19 Music 171: Fundamentals of Digital Audio 20 Answer 4 Implications of Sampling • Is a sampled sequence only an approximation of the • Give the sinusoid’s sampling rate and frequency. original? 1 • perfectly 0.8 Is it possible to reconstruct a sampled signal? 0.6 • 0.4 Will anything less than an infinite sampling rate 0.2 introduce error? 0 • How frequently must we sample in order to −0.2 “faithfully” reproduce an analog waveform? −0.4 −0.6 −0.8 −1 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 Time (s) • The period is 2 seconds (or, there is 1/2 cycle after 1 second) and the frequency is 1/2 Hz. • The sinusoid has 8 samples in 1 second and thus the sampling rate is fs =8 Hz. • The period has 16 samples and is thus 16 × 1/8=2 seconds long. The frequency is thus .5 Hz. Music 171: Fundamentals of Digital Audio 21 Music 171: Fundamentals of Digital Audio 22 Nyquist Sampling Theorem Digital Audio System • The Nyquist Sampling Theorem states that: A bandlimited continuous-time signal can be x(t) low−pass low−pass x(nTs) filter ADCCOMPUTER DAC filter sampled and perfectly reconstructed from its samples if the waveform is sampled over twice as fast as it’s highest frequency component.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    9 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us