Week 5 – Nyquist-Shannon ESE 250 – S’12 Kod & DeHon 1 ESE250: Digital Audio Basics Week 5 Feb. 9, 2012 Nyquist-Shannon Theorem.

Slides:



Advertisements
Similar presentations
Digital Kommunikationselektronik TNE027 Lecture 5 1 Fourier Transforms Discrete Fourier Transform (DFT) Algorithms Fast Fourier Transform (FFT) Algorithms.
Advertisements

Digital Signal Processing
Digital Representation of Audio Information Kevin D. Donohue Electrical Engineering University of Kentucky.
SIMS-201 Characteristics of Audio Signals Sampling of Audio Signals Introduction to Audio Information.
IT-101 Section 001 Lecture #8 Introduction to Information Technology.
Week 6 – Psychoacoustics ESE 250 S’13 DeHon Kadric Kod Wilson-Shah 1 ESE250: Digital Audio Basics Week 6 February 19, 2013 Human Psychoacoustics.
CEN352, Dr. Ghulam Muhammad King Saud University
Advanced Computer Graphics (Spring 2006) COMS 4162, Lecture 3: Sampling and Reconstruction Ravi Ramamoorthi
1 Digitisation Conversion of a continuous electrical signal to a digitally sampled signal Analog-to-Digital Converter (ADC) Sampling rate/frequency, e.g.
Fourier Theory and its Application to Vision
Continuous-Time Signal Analysis: The Fourier Transform
Chapter 4 Digital Transmission
Lecture 4: Sampling [2] XILIANG LUO 2014/10. Periodic Sampling  A continuous time signal is sampled periodically to obtain a discrete- time signal as:
EE313 Linear Systems and Signals Fall 2010 Initial conversion of content to PowerPoint by Dr. Wade C. Schwartzkopf Prof. Brian L. Evans Dept. of Electrical.
First semester King Saud University College of Applied studies and Community Service 1301CT.
11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou.
Chapter 4: Sampling of Continuous-Time Signals
FT Representation of DT Signals:
… Representation of a CT Signal Using Impulse Functions
Formatting and Baseband Modulation
Dr Martin Hendry, Dept of Physics and Astronomy University of Glasgow, UK Astronomical Data Analysis I 11 lectures, beginning autumn 2008.
Lecture 41 Practical sampling and reconstruction.
EE421, Fall 1998 Michigan Technological University Timothy J. Schulz 08-Sept, 98EE421, Lecture 11 Digital Signal Processing (DSP) Systems l Digital processing.
Computer Based Data Acquisition Basics. Outline Basics of data acquisition Analog to Digital Conversion –Quantization –Aliasing.
LE 460 L Acoustics and Experimental Phonetics L-13
Digital Audio What do we mean by “digital”? How do we produce, process, and playback? Why is physics important? What are the limitations and possibilities?
Ni.com Data Analysis: Time and Frequency Domain. ni.com Typical Data Acquisition System.
DTFT And Fourier Transform
GCT731 Fall 2014 Topics in Music Technology - Music Information Retrieval Overview of MIR Systems Audio and Music Representations (Part 1) 1.
Lecture 1 Signals in the Time and Frequency Domains
CSC361/661 Digital Media Spring 2002
Week 7 Psychoacoustic Compression1ESE 250 – S’12 Kod & DeHon ESE250: Digital Audio Basics Week 7 February 23, 2012 Psychoacoustic Compression.
Digital Signal Processing
ESE 250: Digital Audio Basics Week 4 February 5, 2013 The Frequency Domain 1ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah.
Chapter #5 Pulse Modulation
ESE 250 – S'12 Kod & DeHon 1 ESE250: Digital Audio Basics Week 4 February 2, 2012 Time-Frequency.
ECE 4710: Lecture #6 1 Bandlimited Signals  Bandlimited waveforms have non-zero spectral components only within a finite frequency range  Waveform is.
Notice  HW problems for Z-transform at available on the course website  due this Friday (9/26/2014) 
1 Introduction to Information Technology LECTURE 6 AUDIO AS INFORMATION IT 101 – Section 3 Spring, 2005.
Prof. Brian L. Evans Dept. of Electrical and Computer Engineering The University of Texas at Austin Lecture 4 EE 345S Real-Time.
Image Processing Basics. What are images? An image is a 2-d rectilinear array of pixels.
Leo Lam © Signals and Systems EE235 Leo Lam.
1 Digital Signal Processing Lecture 3 – 4 By Dileep kumar
revision Transfer function. Frequency Response
Leo Lam © Signals and Systems EE235. Leo Lam © Fourier Transform Q: What did the Fourier transform of the arbitrary signal say to.
Sampling and Aliasing.
Multimedia Sound. What is Sound? Sound, sound wave, acoustics Sound is a continuous wave that travels through a medium Sound wave: energy causes disturbance.
Continuous-time Signal Sampling
1 What is Multimedia? Multimedia can have a many definitions Multimedia means that computer information can be represented through media types: – Text.
Fundamentals of Multimedia Chapter 6 Basics of Digital Audio Ze-Nian Li and Mark S. Drew 건국대학교 인터넷미디어공학부 임 창 훈.
ΨΗΦΙΑΚΟΣ ΕΛΕΓΧΟΣ (22Δ802) Β΄ ΕΞΑΜΗΝΟ Καθηγητής Πέτρος Π. Γρουμπός  Ώρες Γραφείου: Τετάρτη Πέμπτη Παρασκευή 11:00- 12:00 Γραφείο: 1.
Chapter 2 Ideal Sampling and Nyquist Theorem
Digital Signal Processing
Lecture 1.4. Sampling. Kotelnikov-Nyquist Theorem.
Fourier Analysis Patrice Koehl Department of Biological Sciences National University of Singapore
Chapter 8 Mohamed Bingabr
Chapter 3 Sampling.
Lecture Signals with limited frequency range
Sampling rate conversion by a rational factor
EE Audio Signals and Systems
I. Previously on IET.
Chapter 2 Signal Sampling and Quantization
لجنة الهندسة الكهربائية
Digital Control Systems Waseem Gulsher
Chapter 2 Ideal Sampling and Nyquist Theorem
CEN352, Dr. Ghulam Muhammad King Saud University
Lec.6:Discrete Fourier Transform and Signal Spectrum
Sampling and Aliasing.
ELEN E4810: Digital Signal Processing Topic 11: Continuous Signals
DIGITAL CONTROL SYSTEM WEEK 3 NUMERICAL APPROXIMATION
Presentation transcript:

Week 5 – Nyquist-Shannon ESE 250 – S’12 Kod & DeHon 1 ESE250: Digital Audio Basics Week 5 Feb. 9, 2012 Nyquist-Shannon Theorem

2 Course Map Numbers correspond to course weeks 2, Today ESE 250 – S’12 Kod & DeHon Week 5 – Nyquist-Shannon

Where are we ? Week 2  Received signal is sampled & quantized  q = PCM[ r ] Week 3  Quantized Signal is Coded  c =code[ q ] Week 4  Sampled signal first transformed into frequency domain  Q = DFT[ q ] Week 5  signal oversampled & low pass filtered  Q = LPF[ DFT(q+n) ] Week 6  Transformed signal analyzed  Using human psychoaoustic models Week 7  Acoustically Interesting signal is “perceptually coded”  C = MP3[ Q] Over Sample DFT LPF DecodeProduce r(t)r(t) p(t)p(t) q + n C Perceptual Coding Store / Transmit Q + N Q Week 4 Week 6 Week 5Week 3 [Painter & Spanias. Proc.IEEE, 88(4):451–512, 2000] Week 5 – Nyquist-Shannon ESE 250 – S’12 Kod & DeHon 3

Reconstruction Acquisition Side  we’ve convinced ourselves  to sample,  then process,  then store and transmit  discretely sampled values On the other end?  how should the stored sound be produced?  ? send strings of sampled spl levels o off to the sound card o at what rate?  ? Interpolate o with what family of interpolants? Week 4: harmonic reconstruction  Gets better with more terms  But need more samples to compute them  and error seems unpredictable This week: general reconstruction  introduce further assumptions about signal o to guarantee exact finite reconstruction o with appropriate basis functions  introduce another processing step  to achieve those assumptions Generic Digital Signal Processor Sample r(t)r(t) q Code c Store/ Transmit DecodeProduce p(t)p(t) Week 5 – Nyquist-Shannon 4 ESE 250 – S’12 Kod & DeHon

Week 5 – Nyquist-Shannon ESE 250 – S’12 Kod & DeHon 5 Shannon’s Theorem M. Unser. Proc. IEEE, 88(4):569–587, 2000 Questions: are the real functions countable after all? what is “frequency content”? b0(t)b0(t) Hypothesis  given a (sufficiently “nice”) real function, r(t)  whose frequency content does not exceed  M = 2  f M Conclusion  There is a set of “sampling” basis functions (we’ll not discuss) B S = { …, b -2 (t), b -1 (t), b 0 (t), b 1 (t), b 2 (t), … }  which can exactly reconstruct the function r(t) = … + r -2 b -2 (t) + r -1 b -1 (t) + r 0 b 0 (t) + r 1 b 1 (t) + r 2 b 2 (t) + …  from samples r k = r(k T M )  taken at sampling intervals T M =  /  M = 1 / (2 f M )  called the “Nyquist” rate

Trial Application to Our Setting Psychoacoustic measurements  introduced in next (week 6) lecture  show human audition is bandlimited  at frequency  A = 2  f A for f A = 22 kHz Naïve Processing Strategy  sample received signal, r(t)  at intervals T A =  /  A = 1 /2 f A = [ 44 ¢ 10 3 ] -1 sec  reconstruct exactly as needed r(t) = … + r -2 b -2 (t) + r -1 b -1 (t) + r 0 b 0 (t) + r 1 b 1 (t) + r 2 b 2 (t) + …  from samples r = {…, r -2, r -1, r 0, r 1, r 2, … }  where r k = r(k T A ) Why bother with DFT at all?? Week 5 – Nyquist-Shannon 6 ESE 250 – S’12 Kod & DeHon

Poking the Trial Balloon In reality we receive a “mixed” signal  r(t) = q(t) + n(t)  q(t) q(t) o signal component of auditory interest o has bandwidth f A = 22 kHz  n(t) n(t) o noise (uninteresting information ) o has (typically) high frequency content  impurities associated with transmission and recording  background sounds We only get to sample  the received signal, r(t),  not the desired signal, q(t) !! Week 5 – Nyquist-Shannon 7 ESE 250 – S’12 Kod & DeHon

In class experiment:  assume a nominal band limit  at frequency  N = 2  f N for f N = 5/4 Hz [samples/sec]  Question: what is the Nyquist sample rate? o T N = 1/(2 f N ) = 2/5 sec [sample/sec ] -1 In this experiment, assume that  q(t) ´ 0 o signal component of auditory interest o satisfies bandwidth requirement of f N = 5/4 Hz  n(t) = Cos[9/5  N t] o noise (uninteresting information ) o has “high” frequency content o i.e., it is above (by 9/5) the presumed Nyquist rate Class will sample r(t) = q(t) + n(t)  over “window” - T 0 /2 < t < T 0 /2 for T 0 = 4 [sec]  at the presumed Nyquist rate  Questions: o what is the number of Nyquist samples?  n S ¢ T N = T 0  Number of samples: n S = 2 f N T 0 = 10 o what are the Nyquist sample times? t 2 {-2,-(8/5),-(6/5),-(4/5),-(2/5),0,2/5,4/5,6/5,8/5,2} q(t)q(t) n(t)n(t) r(t) = q(t) + n(t) Bursting the Trial Balloon Week 5 – Nyquist-Shannon 8 ESE 250 – S’12 Kod & DeHon

Bursting the Trial Balloon Class will sample r(t) = q(t) + n(t)  over “window” - T 0 /2 < t < T 0 /2 for T 0 = 4  at the presumed Nyquist rate o Number of samples: n S = 2 f N T 0 = 10 o Sample instants: t 2 {-2,-(8/5),-(6/5),-(4/5),- (2/5),0,2/5,4/5,6/5,8/5,2} and get an “aliased” version of the noise!  r(t) looks like a sampled version of  n(t) = Cos[1/5  N t] Week 5 – Nyquist-Shannon 9 ESE 250 – S’12 Kod & DeHon

Aliasing Widely familiar phenomenon  Wikipedia aliasing article Wikipedia aliasing article  “wagon wheel” effect “wagon wheel” effect  Wikipedia Nyquist-Shannon Theorem Wikipedia Nyquist-Shannon Theorem “Folding:”  another general manifestation of aliasing  premise: r(t) = q(t) + n(t) o we expect q(t) with bandwidth less than  N = 2  f N o but turns out that n(t) is some “ superharmonic residue”  n(t) = cos[ m  N (1+  ) t ]  where 0 <  <1  outcome: sample at “Nyquist rate” T N = 1/(2 f N ) o r k = r( k T N ) = q(k T N ) + n(k T N ) o where the noise n( k T N ) = cos[m  N (1+  ) k T N ] = cos[mk  (1+  ) ] = cos[ mk  ¢  cos[mk  ] - sin[ mk  ¢  sin[mk  ] = 1 ¢ cos[mk  ] - 0 ¢ sin[mk  ] = cos[   N k T N ] o “folds over” to act as if it were a low-band tone of frequency  f N Week 5 – Nyquist-Shannon 10 ESE 250 – S’12 Kod & DeHon

Anti-Aliasing Given the “mixed” signal  r(t) = q(t) + n(t)  q(t) – auditory signal with bandwidth f A = 22 kHz  n(t) – high frequency noise We require some “anti-aliasing” pre-process  that “smooths away” the noise  which will otherwise appear in the samples o r = {…, r -2, r -1, r 0, r 1, r 2, … } o where r k = r(k T A ) o and T A =  /  A = 1 /2 f A = [ 44 ¢ 10 3 ] -1 sec Question: how to do this? Week 5 – Nyquist-Shannon 11 ESE 250 – S’12 Kod & DeHon

Week 5 – Nyquist-Shannon ESE 250 – S’12 Kod & DeHon 12 Interlude: Visual Aliasing Wolfram: Drawing a Line on Digital Display Berkeley Course Demo Typography

Back to Shannon (new today) Hypothesis  given a (sufficiently “nice”) real function, r(t)  whose frequency content does not exceed  M = 2  f M Conclusion  There is a set of “sampling” basis functions (we’ll not show) B S = { …, b -2 (t), b -1 (t), b 0 (t), b 1 (t), b 2 (t), … }  which can exactly reconstruct the function r(t) = … + r -2 b -2 (t) + r -1 b -1 (t) + r 0 b 0 (t) + r 1 b 1 (t) + r 2 b 2 (t) + …  from samples r k = r(k T M )  taken at sampling intervals T M =  /  M = 1 /(2 f M )  called the “Nyquist” rate M. Unser. Proc. IEEE, 88(4):569–587, 2000 Questions: are the real functions countable after all? what is “frequency content”? what are the “basis functions” ? Week 5 – Nyquist-Shannon 13 ESE 250 – S’12 Kod & DeHon

Week 5 – Nyquist-Shannon ESE 250 – S’12 Kod & DeHon 14 Fourier’s Theorem (review) Hypothesis  given a (sufficiently “nice”) real function, r(t)  which is periodic with period T 0 r(t) = r(t + T 0 ) Conclusion  the set of “harmonic” basis functions B H = { …, h -2 (t), h -1 (t), h 0 (t), h 1 (t), h 2 (t), … }  at frequency  0 = 2  f 0 for f 0 = 1/T 0  defined by h k (t) = cos k  0 t (k>0) h k (t) = 1 (k>0) h k (t) = sin k  0 t (k<0)  can exactly reconstruct the function r(t) = … + R -2 h -2 (t) + R -1 h -1 (t) + R 0 h 0 (t) + R 1 h 1 (t) + R 2 h 2 (t) + … M. Unser. Proc. IEEE, 88(4):569–587, 2000 Question: are the real functions countable after all?

Clipping a Non-Periodic Function If  we are willing  to restrict attention  to a specific observation window -T 0 /2 · t · T 0 /2 Then  Fourier’s Theorem yields  exact reconstruction  of the periodic extension  of any function Answer: apparently, “periodic” (or, more practically, finite time) real functions are countable after all! - T 0 /2T 0 /2T0T0 -T 0 - T 0 /2T 0 /2T0T0 -T 0 Week 5 – Nyquist-Shannon 15 ESE 250 – S’12 Kod & DeHon

Fourier + Shannon Fourier: period T 0 ) exact harmonic reconstruction  at frequency  0 = 2  f 0 for f 0 = 1/T 0  r(t) = … + R -2 h -2 (t) + R -1 h -1 (t) + R 0 h 0 (t) + R 1 h 1 (t) + R 2 h 2 (t) + … Shannon: bandwidth  M ) exact “sampled” reconstruction  at frequency  M = 2  f M for f M = 1/(2T M )  r(t) = … + r -2 b -2 (t) + r -1 b -1 (t) + r -0 b 0 (t) + r 1 b 1 (t) + r 2 b 2 (t) + … clipped frequency forces finite harmonic series clipped time forces finite samples Week 5 – Nyquist-Shannon 16 ESE 250 – S’12 Kod & DeHon

Fourier + Shannon:  period T 0 & bandwidth  M = 2  f M ) finite exact harmonic reconstruction  with n M = Round[T 0 / T M ] samples  at “Maximal Rate” T M = 1 /(2 f M ) Algebra:  k  0 >  M ) R -k sin k  0 t ´ R k cos k  0 t ´ 0 (otherwise high frequency) ) R -k = R k = 0 (sin & cos never identically zero)  k > n M ) r (t) = R -n M h -n M (t) + … + R -2 h -2 (t) + R -1 h -1 (t) + R 0 h 0 (t) + R 1 h 1 (t) + R 2 h 2 (t) + … + R n M h n M (t) Now we’re ready to solve the anti-aliasing problem Fourier + Shannon ) Finite Series Week 5 – Nyquist-Shannon 17 ESE 250 – S’12 Kod & DeHon

Now postulate:  New signal, q(t), satisfying o period T 0 o psychoacoustic bandwidth  A = 2  f A for f A = 22 kHz o bounded by maximal bandwidth  A <  M  sampled with o n A = Round[T 0 / T A ] samples o at “Auditory Nyquist Rate” T A = 1 /(2 f A ) Fourier + Shannon:  period T 0 & bandwidth  A ) finite exact harmonic reconstruction q(t) = Q -n A h -n A (t) + … + Q -2 h -2 (t) + Q -1 h -1 (t) + Q 0 h 0 (t) + Q 1 h 1 (t) + Q 2 h 2 (t) + … + Q n A h n A (t)  vector representation: o Q = (Q -n A, …, Q -2, Q -1, Q 0, Q 1, Q 2, …, Q n A ) Shannon + Fourier  bandwidth  A & period T 0 ) finite exact “sampled” reconstruction o q(t) = q -n A b -n A (t) + … + q -2 b -2 (t) + q -1 b -1 (t) + q -0 b 0 (t) + q 1 b 1 (t) + q 2 b 2 (t) + … + q n A b n A (t)  vector representation: o q = (q -n A, …, q -2, q -1, q 0, q 1, q 2, …, q n A ) Question: what is the relationship between the representations  frequency domain, Q  time domain, q Answer: Q = DFT(q) Psychoacoustics meets Nyquist Week 5 – Nyquist-Shannon 18 ESE 250 – S’12 Kod & DeHon

Q+N = DFT(q) + DFT(n) = DFT(q+n) Assume we receive mixed signal  r(t) = q(t) + n(t)  q(t) q(t) o signal component of interest o has period T 0 & bandwidth  A  n(t) n(t) o noise (uninteresting information ) o has (for now) only high frequency content, , i.e., satisfies:  A <  ·  M Problem: how to remove noise? Frequency Domain approach  Take the received time-sampled representation, r = q + n r = (r -n M, …, r -2, r -1, r 0, r 1, r 2, …, r n M ) = (q -n M + n -n M, …, q -2 + n -2, q -1 + n -1, q 0 + n 0, q 1 + n 1, q 2 + n 2, …, q n M + n -n M )  Compute frequency domain representation o R = DFT(r) = DFT(q+n) = DFT(q)+ DFT(n) = Q + N o R = (R -n M, …, R -2, R -1, R 0, R 1, R 2, …, R n M ) = (Q -n M + N -n M, …, Q -2 + N -2, Q -1 + N -1, Q 0 + N 0, Q 1 + N 1, Q 2 + N 2, …, Q n M + N -n M )  Recall the meaning of this representation: for h k (t) = trig[k  0 t] and trig 2 {cos, sin} we have r(t) = (Q -n M + N -n M ) h -n M (t) + … + (Q -n A + N -n A ) h -n A (t) + … + (Q -n M + N -n M ) h -2 (t) + (Q -n M + N -n M ) h -1 (t) + (Q -n M + N -n M ) h 0 (t) + (Q -n M + N -n M ) h 1 (t) + (Q -n M + N -n M ) h 2 (t) + … + (Q -n A + N -n A ) h n A (t) + … + (Q -n M + N -n M ) h n M (t)  Now apply assumptions about frequency content! Week 5 – Nyquist-Shannon 19 ESE 250 – S’12 Kod & DeHon

R = DFT(r), r = DFT -1 (R ) Compute frequency domain representation  R = (R -n M, …, R -2, R -1, R 0, R 1, R 2, …, R n M ) = (Q -n M + N -n M, …, Q -2 + N -2, Q -1 + N -1, Q 0 + N 0, Q 1 + N 1, Q 2 + N 2, …, Q n M + N -n M ) Now introduce assumptions about frequency content:  k > n A =  A /  0 ) Q k = 0  k < n A =  A /  0 ) N k = 0 Interpret in entries of R = (Q -n M + N -n M, …, Q -2 + N -2, Q -1 + N -1, Q 0 + N 0, Q 1 + N 1, Q 2 + N 2, …, Q n M + N -n M ) = (0 + N -n M, …, Q n A + N -n A, …, Q , Q , Q 0 + 0, Q 1 + 0, Q 2 + 0, …, Q n A + N -n M, …, 0 + N -n M ) = (0,…, 0, Q n A …, Q -2, Q -1, Q 0, Q 1, Q 2, …, Q n A,,, 0,…, 0 ) + (N -n M,…, N -n A, 0, …, 0, 0, 0, 0, 0, …, 0, N n A,…, N n M ) Implement Algorithmically  Zero out the “higher integer” entries of S = ZERO n A (R)  Obtain the inverse transform, s = DFT -1 (S) Conclude that s = q Week 5 – Nyquist-Shannon 20 ESE 250 – S’12 Kod & DeHon

Visualizing a Low Frequency Subspace Low Frequency Signal  Corrupted by  High frequency noise Week 5 – Nyquist-Shannon ESE 250 – S’12 Kod & DeHon 21 h0(t)h0(t) h1(t)h1(t) h -1 (t)

Oversampled Pre-Filter Anti-aliasing  requires“oversampling” o n M = Round[T 0 / T M ] samples o at “Maximal Rate” T M = 1 /(2 f M ) o Where f M represents our best estimate of o the highest noise frequency  but how should we model o “noise” o and its likely bandwidth? Analog pre-processing  physical electro-mechanical world o traditionally piezo-electric microphone o increasingly MEMS  Has its own limited bandwidth Electronics need merely  sample up to  the microphone “cut off” frequency Low-Pass Filter FilterTransform r Q q ADXL001 Accelerometer Pre-Sampling r Low-Pass Week 5 – Nyquist-Shannon 22 ESE 250 – S’12 Kod & DeHon

Week 5 – Nyquist-Shannon ESE 250 – S’12 Kod & DeHon 23 To Read Further Tutorial on Shannon’s Theorem M. Unser. Sampling - 50 years after shannon. Proceedings of the IEEE, 88(4):569–587, 2000

Week 5 – Nyquist-Shannon ESE 250 – S’12 Kod & DeHon 24 ESE250: Digital Audio Basics Week 5 Feb. 9, 2012 Nyquist-Shannon Theorem