SAMPLING THEORY. Representing continuous signals with discrete numbers

Similar documents
Topic 2. Signal Processing Review. (Some slides are adapted from Bryan Pardo s course slides on Machine Perception of Music)

Biomedical Signals. Signals and Images in Medicine Dr Nabeel Anwar

Interpolation Error in Waveform Table Lookup

Outline. Discrete time signals. Impulse sampling z-transform Frequency response Stability INF4420. Jørgen Andreas Michaelsen Spring / 37 2 / 37

Lecture Schedule: Week Date Lecture Title

Sampling and Reconstruction

ENGR 210 Lab 12: Sampling and Aliasing

ME scope Application Note 01 The FFT, Leakage, and Windowing

6 Sampling. Sampling. The principles of sampling, especially the benefits of coherent sampling

The Discrete Fourier Transform. Claudia Feregrino-Uribe, Alicia Morales-Reyes Original material: Dr. René Cumplido

Signals A Preliminary Discussion EE442 Analog & Digital Communication Systems Lecture 2

Laboratory Assignment 5 Amplitude Modulation

Chapter 2: Digitization of Sound

The Fast Fourier Transform

Spectrum Analysis: The FFT Display

Sampling and Reconstruction of Analog Signals

Islamic University of Gaza. Faculty of Engineering Electrical Engineering Department Spring-2011

Continuous vs. Discrete signals. Sampling. Analog to Digital Conversion. CMPT 368: Lecture 4 Fundamentals of Digital Audio, Discrete-Time Signals

ECE 556 BASICS OF DIGITAL SPEECH PROCESSING. Assıst.Prof.Dr. Selma ÖZAYDIN Spring Term-2017 Lecture 2

Data Communication. Chapter 3 Data Transmission

Structure of Speech. Physical acoustics Time-domain representation Frequency domain representation Sound shaping

Laboratory Assignment 4. Fourier Sound Synthesis

CT111 Introduction to Communication Systems Lecture 9: Digital Communications

Digital Processing of Continuous-Time Signals

Data and Computer Communications Chapter 3 Data Transmission

Chapter 5 Window Functions. periodic with a period of N (number of samples). This is observed in table (3.1).

Hideo Okawara s Mixed Signal Lecture Series. DSP-Based Testing Fundamentals 6 Spectrum Analysis -- FFT

Chapter 3 Data Transmission COSC 3213 Summer 2003

Lecture 2: SIGNALS. 1 st semester By: Elham Sunbu

Digital Processing of

Data Acquisition Systems. Signal DAQ System The Answer?

Computer Graphics (Fall 2011) Outline. CS 184 Guest Lecture: Sampling and Reconstruction Ravi Ramamoorthi

Fourier Signal Analysis

Fourier transforms, SIM

URBANA-CHAMPAIGN. CS 498PS Audio Computing Lab. Audio DSP basics. Paris Smaragdis. paris.cs.illinois.

Digital Signal Processing

Instruction Manual for Concept Simulators. Signals and Systems. M. J. Roberts

EC 554 Data Communications

Sampling and Signal Processing

E40M Sound and Music. M. Horowitz, J. Plummer, R. Howe 1

Department of Electronic Engineering NED University of Engineering & Technology. LABORATORY WORKBOOK For the Course SIGNALS & SYSTEMS (TC-202)

EE 215 Semester Project SPECTRAL ANALYSIS USING FOURIER TRANSFORM

Part 2: Fourier transforms. Key to understanding NMR, X-ray crystallography, and all forms of microscopy

E40M Sound and Music. M. Horowitz, J. Plummer, R. Howe 1

Fourier Transform Pairs

EECE 301 Signals & Systems Prof. Mark Fowler

CMPT 318: Lecture 4 Fundamentals of Digital Audio, Discrete-Time Signals

PROBLEM SET 6. Note: This version is preliminary in that it does not yet have instructions for uploading the MATLAB problems.

Notes on Fourier transforms

Fourier Theory & Practice, Part I: Theory (HP Product Note )

Complex Sounds. Reading: Yost Ch. 4

Multirate Signal Processing Lecture 7, Sampling Gerald Schuller, TU Ilmenau

The Fundamentals of FFT-Based Signal Analysis and Measurement Michael Cerna and Audrey F. Harvey

DIGITAL SIGNAL PROCESSING CCC-INAOE AUTUMN 2015

Introduction to signals and systems

Problems from the 3 rd edition

Orthonormal bases and tilings of the time-frequency plane for music processing Juan M. Vuletich *

Harmonic Analysis. Purpose of Time Series Analysis. What Does Each Harmonic Mean? Part 3: Time Series I

Chapter 4. Digital Audio Representation CS 3570

Discrete Fourier Transform (DFT)

Exercise Problems: Information Theory and Coding

2) How fast can we implement these in a system

Pulse Code Modulation (PCM)

FFT analysis in practice

Lab 3 SPECTRUM ANALYSIS OF THE PERIODIC RECTANGULAR AND TRIANGULAR SIGNALS 3.A. OBJECTIVES 3.B. THEORY

Acoustics, signals & systems for audiology. Week 4. Signals through Systems

Chapter 2: Signal Representation

Signals and Systems. Lecture 13 Wednesday 6 th December 2017 DR TANIA STATHAKI

EEE 309 Communication Theory

Music 270a: Fundamentals of Digital Audio and Discrete-Time Signals

YEDITEPE UNIVERSITY ENGINEERING FACULTY COMMUNICATION SYSTEMS LABORATORY EE 354 COMMUNICATION SYSTEMS

Understanding Digital Signal Processing

Outline. Introduction to Biosignal Processing. Overview of Signals. Measurement Systems. -Filtering -Acquisition Systems (Quantisation and Sampling)

Modulation. Digital Data Transmission. COMP476 Networked Computer Systems. Analog and Digital Signals. Analog and Digital Examples.

6.02 Practice Problems: Modulation & Demodulation

What is Sound? Simple Harmonic Motion -- a Pendulum

Topic 6. The Digital Fourier Transform. (Based, in part, on The Scientist and Engineer's Guide to Digital Signal Processing by Steven Smith)

Chapter 7. Introduction. Analog Signal and Discrete Time Series. Sampling, Digital Devices, and Data Acquisition

Data Communications and Networks

EE 311 February 13 and 15, 2019 Lecture 10

Terminology (1) Chapter 3. Terminology (3) Terminology (2) Transmitter Receiver Medium. Data Transmission. Simplex. Direct link.

Introduction to Wavelet Transform. Chapter 7 Instructor: Hossein Pourghassem

ME 365 EXPERIMENT 8 FREQUENCY ANALYSIS

The Case for Oversampling

EE228 Applications of Course Concepts. DePiero

Spectrum Analysis - Elektronikpraktikum

FFT Analyzer. Gianfranco Miele, Ph.D

Advanced Digital Signal Processing Part 2: Digital Processing of Continuous-Time Signals

PART II Practical problems in the spectral analysis of speech signals

When and How to Use FFT

Reading: Johnson Ch , Ch.5.5 (today); Liljencrants & Lindblom; Stevens (Tues) reminder: no class on Thursday.

Review of Lecture 2. Data and Signals - Theoretical Concepts. Review of Lecture 2. Review of Lecture 2. Review of Lecture 2. Review of Lecture 2

EEE 309 Communication Theory

DFT: Discrete Fourier Transform & Linear Signal Processing

Fourier Transform. Any signal can be expressed as a linear combination of a bunch of sine gratings of different frequency Amplitude Phase

System Identification & Parameter Estimation

Summary Last Lecture

Frequency Domain Representation of Signals

Design of FIR Filters

Signals and Systems Using MATLAB

Transcription:

SAMPLING THEORY Representing continuous signals with discrete numbers Roger B. Dannenberg Professor of Computer Science, Art, and Music Carnegie Mellon University ICM Week 3 Copyright 2002-2013 by Roger B. Dannenberg 1 From analog to digital (and back) 010110 010100 011000 011011 000111 100100 011000 000010 101100 111010 000101 011010 111011 011100 000100 2 1

Analog to Digital Conversion Digital to Analog Conversion A to D 010110 010100 011000 011011 000111 D to A 3 Approach Intuition Frequency Domain (Fourier Transform) Sampling Theory Practical Results 4 2

The World is Analog 5 Continuous or Discrete? 6 3

Discrete Amplitude (Y axis) 7 Discrete Time (X axis) 8 4

Digitizing a continuous function (or signal) 9 Questions? How do we convert analog to/from digital? What sample rate should we use? Why does it matter? How many bits per sample should we use? Why does it matter? Interpolation: How can we interpolate samples to recover the sampled signal? What s the effect of rounding to the nearest integer sample value? 10 5

Introduction to the Spectrum 11 Introduction to the Spectrum (2) 12 6

Phase 13 Frequency 14 7

Amplitude 15 Sinusoidal Partials A sin(ωt +φ) Amplitude A Frequency ω Phase φ 16 8

Fourier Transform Our goal is to transform a function-of-time representation of a signal to a function-offrequency representation Express the time function as an (infinite) sum of sinusoids. Express the infinite sum as a function from frequency to amplitude I.e. for each frequency, what is the amplitude of the sinusoid of that frequency within this infinite sum? 17 Fourier Transform: Cartesian Coordinates Real part: R(ω) = f (t)cosωt dt Imaginary part: X(ω) = f (t)sinωt dt 18 9

What About Phase? Remember at each frequency, we said there is one sinusoidal component: A is amplitude ω is frequency φ is phase The Fourier analysis computes two amplitudes: R(ω) and X(ω) Trig identities tell us there is no conflict: A sin(ωt +φ) A = R 2 + X 2 φ = arctan(x / R) A(ω) = R 2 (ω)+ X 2 (ω) φ(ω) = arctan(x(ω) / R(ω)) 19 From Cartesian to Complex R is real or cosine part X is imaginary or sine part Use F(ω) = R(ω)+ j X(ω) 20 10

Fourier Transform (Complex Form) R(ω) = + j X(ω) = j = F(ω) = f (t)cosωt dt f (t)sinωt dt f (t)e jωt dt 21 Orthogonal Basis Functions W N E Horizontal and vertical axes are independent or orthogonal in the 2-dimensional plane, sinusoids are orthogonal in the infinite-dimensional space of continuous signals. S Just as every point in the plane is a unique linear combination of the unit E and N vectors, every signal is a unique linear combination of sinusoids. 22 11

The Frequency Domain Graphic! Equalizer! Spectral! Analyzer 23 The Frequency Domain (2) 100-200 hz 200-400 hz 400-800 hz 800-1.6k hz 1.6-3.2k hz Spectrum?? 24 12

The Amplitude Spectrum Amplitude Frequency 440hz 25 Amplitude Spectrum of a Real Signal 26 13

Representations (Real, Imaginary) or (Amplitude, Phase)? Power ~ Amplitude 2 We generally cannot hear phase Measure a stationary signal after Δt: Amplitude spectrum is unchanged, but phase changes by Given (amplitude, phase) It s hard to plot both Usually, we ignore the phase Δt ω 27 Time vs Frequency What happens to time when you transform to the frequency domain? Note that time is integrated out NO TIME REMAINS F(ω) = The Fourier Transform of a signal is not a function of time!!!!! (Later, we ll look at short-time transforms e.g. what you see on a time-varying spectral display which are time varying.) f (t)e jωt dt 28 14

PERFECT SAMPLING From continuous signals to discrete samples and back again 29 Sampling Time Domain What happens when you sample a signal? In time domain, multiplication by a pulse train: time time = time 30 15

Sampling Frequency Domain What happens when you sample a signal? In frequency domain, the spectrum is copied and shifted (!) BEFORE: AFTER: Sample Rate Frequency Frequency 31 An Aside Why copied and shifted? We re glossing over some details Multiplication in the time domain is equivalent to convolution in the frequency domain. The transform of a pulse train is a pulse train(!) Convolution with a pulse train copies and shifts the spectrum. See text for more detail. Take linear systems for derivation and proof. 32 16

Aliasing: Time Domain View Are there other aliases? At 16kHz SR, Sine tones at: 1000 Hz 3010 Hz 5020 Hz 7030 Hz 9040 Hz 11060 Hz 13070 Hz 15080 Hz 33 Aliasing: Frequency Domain View Before Sampling Amplitude Frequency 34 17

Frequency Domain View (2) After Sampling Amplitude Frequency Sample Rate 35 A Signal With Higher Frequency Components Before Sampling Amplitude Frequency 36 18

A Signal With Higher Frequency Components After Sampling Amplitude Frequency Sample Rate Foldover at Nyquist Frequency 37 Bandwidth What sample rate should we use? Why does it matter? 38 19

Bandwidth 39 Sampling Without Aliasing S/H A/D How do we convert analog to/from digital? Prefilter Sample and Hold Analog to Digital Prefilter removes all frequencies above 1/2 sampling rate (the Nyquist Frequency) 40 20

Sampling Without Aliasing S/H A/D Prefilter Sample and Hold Analog to Digital Prefilter removes all frequencies above 1/2 sampling rate (the Nyquist Frequency) 41 Conversion to Analog D/A S/H Digital to Analog Sample and Hold Reconstruction Filter Reconstruction filter removes all frequencies above 1/2 sampling rate (the Nyquist Frequency) 42 21

What Does a Sample Mean? 43 What Does a Sample Mean? (2) sinc(x) = sin(x) x Note: The time axis (x) is scaled so that the zeros of sinc(x) fall exactly on the times of other samples. 44 22

What Does a Sample Mean? (3) 45 Why sinc function? An impulse has infinite bandwidth. If you perfectly cut the bandwidth down to half the sample rate (the Nyquist frequency), you get a sinc function! When you reconstruct the signal, replacing impulses with sinc functions, you get the entire continuous band limited signal. Samples uniquely determined by signal, signal uniquely determined by samples. Bijective (for Klaus ) AMAZING. 46 23

Interpolation/Reconstruction Convolve with a sinc function In other words, form the superposition of sinc functions shifted by the sample times and scaled by the sample values. How can we interpolate samples to recover the sampled signal? Requires infinite lookahead and infinite computation! But sinc decays as 1/time, so good approximations are expensive but at least possible. 47 Interpolation/Reconstruction Convolve with a sinc function In other words, form the superposition of sinc functions shifted by the sample times and scaled by the sample values. Requires infinite lookahead and infinite computation! But sinc decays as 1/time, so good approximations are expensive but at least possible. 48 24

IMPERFECT SAMPLING What is the impact of errors and rounding? 49 How to Describe Noise Since absolute levels rarely exist, measure RATIO of Signal to Noise. Since signal level is variable, measure MAXIMUM Signal to Noise. Units: db = decibel 10dB = 10 power 20dB = 100 power = 10 amplitude 6dB = 2 amplitude 50 25

Quantization Noise Signal" " Quantization Error" To simplify analysis, assume quantization error is uniformly randomly distributed in [-0.5, +0.5]! 51 Quantization Examples Sine Tone Cello 16-bit 8-bit 4-bit 2-bit 52 26

Quantization Noise, M bits/sample Rounding effects can be approximated by adding white noise (uniform random samples) of maximum amplitude of ½ least significant bit. What s the effect of rounding to the nearest SNR(dB) integer sample = 6.02M value? + 1.76 (about 6dB/bit) 53 Quantization Noise, M bits/sample Rounding effects can be approximated by adding white noise (uniform random samples) of maximum amplitude of ½ least significant bit. SNR(dB) = 6.02M + 1.76 (about 6dB/bit) 54 27

Noise How many bits per sample should we use? Why does it matter? 55 Noise 56 28

Can Discrete Samples Really Capture a Continuous Signal? DISCRETE SAMPLES CAN CAPTURE A CONTINUOUS BAND-LIMITED SIGNAL WITHOUT LOSS Band-limited signal no lost frequencies! To the extent you can do perfect sampling no noise! 57 Summary Theoretical result: discrete samples can capture all information in a band-limited signal! Practical result 1: sampling limits bandwidth to 1/2 sampling rate (the Nyquist frequency) Practical result 2: sampling adds quantization noise; SNR is about 6dB per bit What s a decibel? 58 29

DITHER AND OVERSAMPLING Additional techniques for practical digital audio 59 Dither Sometimes rounding error is correlated to signal. Add analog noise prior to quantization to decorrelate rounding. Typically, noise has peak-to-peak amplitude of one quantization step. 60 30

Heavily Quantized, Undithered Sinusoid 61 Sinusoid With Dithering No dither Dither 62 31

Oversampling Reconstruction filters are hard to build with analog components Idea: digitally reconstruct signal at high sample rate Result: simpler to build analog filter 63 Oversampling (2) Amplitude Nyquist Rate" Nyquist Rate" Freq. 64 32

THE FREQUENCY DOMAIN An alternative to waveforms (the time domain) 65 The Frequency Domain Examples of Simple Spectra Fourier Transform vs Short-Term Fourier Transform DFT Discrete Fourier Transform FFT Fast Fourier Transform Windowing 66 33

Formal Definition R(ω) = X(ω) = F(ω) = f (t)cosωt dt f (t)sinωt dt f (t)e jωt dt 67 Simple Spectra Examples Sinusoid Noise Tone with harmonics 68 34

More Examples Narrow Band Noise Impulse 69 Negative Frequencies Recall that FT is defined for negative as well as positive frequencies. What does this mean? cos(ωt) = cos(-ωt), sin(ωt) = -sin(-ωt) For FT of real signals, Imaginary part has odd symmetry: X(ω) = -X(- ω) The real part has even symmetry: R(ω) = R(- ω) Therefore, the negative frequencies contain redundant information. That s why we ve mostly ignored them. 70 35

Fourier Transform vs Short-Term Transform In practice, we can t do an infinite integral, so do a finite integral: the short term FT (STFT) b F(ω) = f (t)e jωt dt a In general, the interesting properties of true FT hold for STFT, but with annoying artifacts 71 Discrete Fourier Transform Since we work with samples rather than continuous data, We need a discrete version of FT: DFT DFT is essentially just like FT, except band limited and computable I m glossing over many derivations, proofs, and details here. 72 36

Fast Fourier Transform Replacing integral with a sum, you would think computing R(ω) would be an O(n 2 ) problem b F k = n=a f n e j2πkn/n Interestingly, there is an O(n log n) algorithm, the Fast Fourier Transform, or FFT 73 Windowing Typically, you can reduce the artifacts of the STFT by windowing: Different windows optimize different criteria: Hamming, Hanning, Blackman, etc. 74 37

More Examples Using Audacity 75 AMPLITUDE MODULATION Synthesis techniques based on signal multiplication 76 38

Amplitude Modulation Amplitude modulation is simply multiplication (MULT in Nyquist) Amplitude modulation (multiplication) in the time domain corresponds to convolution in the spectral domain (!) For each sinusoid in the modulator, the modulated signal is shifted up and down by the frequency of the sinusoid. 77 AM specta Assuming the modulated signal is a sinusoid: Otherwise: Modulation Frequency: 220Hz Carrier: 880Hz 78 39

Ring Modulation Ring Modulation is named after the ring modulator, an analog approach to signal multiplication. See code_3.htm for AM examples 79 Constant Offset What is the difference between: lfo(6) And 2 + lfo(6)? 80 40

Summary Dithering sometimes used to avoid quantization artifacts Oversampling is standard technique to move (some) filtering to the digital domain Amplitude Modulation by a sinusoid shifts the spectrum up and down by the frequency of the modulator 81 41