ESE 250: Digital Audio Basics Week 4 February 5, 2013 The Frequency Domain 1ESE 250 - Spring'13 DeHon, Kod, Kadric, Wilson-Shah.

Slides:



Advertisements
Similar presentations
DCSP-12 Jianfeng Feng
Advertisements

Computer Vision Lecture 7: The Fourier Transform
Time Series II.
Fourier Transforms and Their Use in Data Compression
Time-Frequency Analysis Analyzing sounds as a sequence of frames
Digital Kommunikationselektronik TNE027 Lecture 5 1 Fourier Transforms Discrete Fourier Transform (DFT) Algorithms Fast Fourier Transform (FFT) Algorithms.
Lecture 7: Basis Functions & Fourier Series
Lecture 15 Orthogonal Functions Fourier Series. LGA mean daily temperature time series is there a global warming signal?
Transform Techniques Mark Stamp Transform Techniques.
3.1 Chapter 3 Data and Signals Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
Note To be transmitted, data must be transformed to electromagnetic signals.
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.
President UniversityErwin SitompulSMI 7/1 Dr.-Ing. Erwin Sitompul President University Lecture 7 System Modeling and Identification
School of Computing Science Simon Fraser University
Physics 434 Module 4-FFT - T. Burnett 1 Physics 434 Module 4 week 2: the FFT Explore Fourier Analysis and the FFT.
Computer Graphics Recitation 6. 2 Motivation – Image compression What linear combination of 8x8 basis signals produces an 8x8 block in the image?
Computer Graphics Recitation 7. 2 Motivation – Image compression What linear combination of 8x8 basis signals produces an 8x8 block in the image?
Digital Voice Communication Link EE 413 – TEAM 2 April 21 st, 2005.
SWE 423: Multimedia Systems Chapter 7: Data Compression (3)
Deconstructing periodic driving voltages (or any functions) into their sinusoidal components: It's easy to build a periodic functions by choosing coefficients.
SWE 423: Multimedia Systems Chapter 7: Data Compression (5)
Time and Frequency Representation
Unit 7 Fourier, DFT, and FFT 1. Time and Frequency Representation The most common representation of signals and waveforms is in the time domain Most signal.
Discrete Time Periodic Signals A discrete time signal x[n] is periodic with period N if and only if for all n. Definition: Meaning: a periodic signal keeps.
CELLULAR COMMUNICATIONS DSP Intro. Signals: quantization and sampling.
CH#3 Fourier Series and Transform
Basics of Signal Processing. frequency = 1/T  speed of sound × T, where T is a period sine wave period (frequency) amplitude phase.
Frequency Domain Representation of Sinusoids: Continuous Time Consider a sinusoid in continuous time: Frequency Domain Representation: magnitude phase.
LE 460 L Acoustics and Experimental Phonetics L-13
DTFT And Fourier Transform
1 Chapter 8 The Discrete Fourier Transform 2 Introduction  In Chapters 2 and 3 we discussed the representation of sequences and LTI systems in terms.
Week 5 – Nyquist-Shannon ESE 250 – S’12 Kod & DeHon 1 ESE250: Digital Audio Basics Week 5 Feb. 9, 2012 Nyquist-Shannon Theorem.
Lecture 1 Signals in the Time and Frequency Domains
Basics of Signal Processing. SIGNALSOURCE RECEIVER describe waves in terms of their significant features understand the way the waves originate effect.
Motivation Music as a combination of sounds at different frequencies
FOURIER SERIES §Jean-Baptiste Fourier (France, ) proved that almost any period function can be represented as the sum of sinusoids with integrally.
Fourier series. The frequency domain It is sometimes preferable to work in the frequency domain rather than time –Some mathematical operations are easier.
Lecture 2 Signals and Systems (I)
Image Enhancement in the Frequency Domain Spring 2006, Jen-Chang Liu.
EE210 Digital Electronics Class Lecture 2 March 20, 2008.
ESE 250 – S'12 Kod & DeHon 1 ESE250: Digital Audio Basics Week 4 February 2, 2012 Time-Frequency.
Aristotle University of Thessaloniki – Department of Geodesy and Surveying A. DermanisSignals and Spectral Methods in Geoinformatics A. Dermanis Signals.
October 29, 2013Computer Vision Lecture 13: Fourier Transform II 1 The Fourier Transform In the previous lecture, we discussed the Hough transform. There.
Fourier series: Eigenfunction Approach
Pre-Class Music Paul Lansky Six Fantasies on a Poem by Thomas Campion.
Fourier Series Fourier Transform Discrete Fourier Transform ISAT 300 Instrumentation and Measurement Spring 2000.
Marwan Al-Namari 1 Digital Representations. Bits and Bytes Devices can only be in one of two states 0 or 1, yes or no, on or off, … Bit: a unit of data.
COMP135/COMP535 Digital Multimedia, 2nd edition Nigel Chapman & Jenny Chapman Chapter 2 Lecture 2 – Digital Representations.
Encoding How is information represented?. Way of looking at techniques Data Medium Digital Analog Digital Analog NRZ Manchester Differential Manchester.
Fourier Transform.
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 건국대학교 인터넷미디어공학부 임 창 훈.
CH#3 Fourier Series and Transform 1 st semester King Saud University College of Applied studies and Community Service 1301CT By: Nour Alhariqi.
Math for CS Fourier Transforms
Fourier Analysis Patrice Koehl Department of Biological Sciences National University of Singapore
Digital Image Processing Lecture 8: Fourier Transform Prof. Charlene Tsai.
Chapter 4 Dynamical Behavior of Processes Homework 6 Construct an s-Function model of the interacting tank-in-series system and compare its simulation.
Chapter 4 Dynamical Behavior of Processes Homework 6 Construct an s-Function model of the interacting tank-in-series system and compare its simulation.
CS 591 S1 – Computational Audio – Spring 2017
Multimedia Systems and Applications
Sampling rate conversion by a rational factor
CSI-447: Multimedia Systems
Dr. Nikos Desypris, Oct Lecture 3
CHAPTER 3 DATA AND SIGNAL
UNIT II Analysis of Continuous Time signal
Digital Control Systems Waseem Gulsher
ESE532: System-on-a-Chip Architecture
Signals and Spectral Methods
Presentation transcript:

ESE 250: Digital Audio Basics Week 4 February 5, 2013 The Frequency Domain 1ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Course Map 2ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Musical Representation With this compact notation – Could communicate a sound to pianist – Much more compact than 44KHz time-sample amplitudes (fewer bits to represent) – Represent frequencies 3ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Physics review Consider a sound signal that varies as a sine wave in time: What is the relationship between and ? – rad/s, Hz 4ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Time-domain Digital representation Week2: Quantization in TIME and VALUE Question: Other ways to represent this signal? 5ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Another-domain representation? Consider a sound signal that varies as a sine wave in time: Note that a sine wave is periodic, this implies redundancy that we could exploit to better compress it (week3 – compression) At least we could save memory by representing only one period. But can we do even better? Question: What information do we need to represent the signal? – Amplitude, frequency, phase Question: How much memory to store each of these? 6ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Another-domain representation? Remember week 2 lab: Inputs: – Amplitude: 1 – Frequency: various values, 220Hz, etc… – Phase: 0 – Sampling rate: 48,000 kHz Output: Periodic sine function sampled in time, with 48,000 samples for 1 second of sound Question: Why did we need to create the large LVM files? Why not just store the little information we started with? 7ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Storage advantage Assume each of amplitude, frequency and phase are stored as 16bit integers. How much memory to store the sine in lab2? – Only storing the info above? – With an LVM file containing 48,000 samples? Percent savings? 8ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Frequency-domain T = π, A = 3: s(t) = A*sin(2π*f*t) = 3*sin(2*t) 9ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Frequency-domain Of course, not all signals are this simple For example, consider s(t) = sin(2t) + sin(t)/2 Question: What will the frequency representation look like? 10ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Frequency-domain How about the time-domain? – Plot sin(2t) – Plot sin(t)/2 – Sum: sin(2t)+ sin(t)/2 Notice how it was easier to plot the frequency domain representation 11

Frequency-domain Another example What function is this? 12ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Frequency-domain So far, we have seen how a signal written as a sum of sines of different frequencies can have a frequency domain representation. Each sine component is more or less important depending on its coefficient But can any arbitrary signal be represented as a sum of sines? – No. But the idea has potential, let’s explore it! 13ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

More background Fourier series: – Any periodic signal can be represented as a sum of simple periodic functions: sin and cos sin(nt) and cos(nt) For n = 1, 2, 3, … These are called the harmonics of the signal 14 Jean Baptiste Joseph Fourier, wikipedia ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Fourier Series – more formally Given a (well-behaved) periodic function f(t), we can always write it as: Where: These two equations give us the and coefficients of the Fourier series based on the input function. These coefficients form the frequency domain representation We will not prove the equations If you’re interested: Office Hours, ESE 325, Math 312, … 15ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Fourier Series – Why does it work? The cos(nx) and sin(nx) functions form an orthogonal basis: they allow us to represent any periodic signal by taking a linear combination of the basis components without interfering with one another 16

Orthogonal basis Choose a basis Order the vectors in it All vectors in the space can be represented as sequences of coordinates, or ordered coefficients of the basis vectors Example: 3D space – Basis: [i j k] – Linear combination: xi + yj + zk – Coordinate representation: [x y z] Example: Quadratic polynomials – Basis: [x 2 x 1] – Linear combination: ax 2 + bx + c – Coordinate representation: [a b c] 17ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Fourier Series Consider the xy-plane: We can address a point by its two coordinates (x,y) The blue point is located at (10, 3) In Fourier series, we have a basis with infinite dimension, so we sum up over an infinite number of harmonics Harmonics are 1, cos(t), cos(2t), cos(3t), …, sin(t), sin(2t), … ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Example of another orthogonal basis Although we have an infinite number of basis elements, we don’t need to use all of them The components with the largest coefficients are the most significant The more components we add, the closer to the function we get. i.e.: As, Examples follow 19ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Fourier Series – Sawtooth wave 20 (falstad.com/fourier/)

ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah Fourier Series – Sawtooth wave 21 (falstad.com/fourier/)

Interlude 22ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

23 Where Are We Heading After Today? Week 2 – Received signal is discrete-time-stamped quantized – q = PCM[ r ] = quant L [Sample T s [r] ] Week 3 – Quantized Signal is Coded – c =code[ q ] Week 4 – Sampled signal not coded directly First linearly transformed into frequency domain – Q = DFT[ q ] [Painter & Spanias. Proc.IEEE, 88(4):451–512, 2000] q SampleCode Store/ Transmit DecodeProduce r(t)r(t)p(t)p(t) Generic Digital Signal Processor q c c Q Psychoacoustic Audio Coder ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

What now? In the first half of the lecture we have introduced the idea of frequency domain In the second half of the lecture, we will see how to extend the idea of Fourier Series to the class of signals we are interested in: Not necessarily periodic and quantized 24ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Frequency-domain Fourier Series deal with periodic signals Are all signals periodic? Is your favorite mp3 song periodic? What do we do with these? 25ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Frequency-domain Certainly, we could loop a song and make the signal periodic, but this is not a good solution Mathematicians have extended the notion of Fourier Series into that of Fourier Transforms by making the period of the signal go to infinity: 26ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Discrete Fourier Transforms Fourier Transforms are nice, but we want to store and process our signals with computers We therefore extend Fourier Transforms into Discrete Fourier Transforms, or DFT The signal is now discrete: The signal contains N samples: Remember Euler’s formula: 27ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah The frequency domain signal also has N-1 elements: The time domain signal can be reconstructed from

Discrete Fourier Transforms A DFT transforms N samples of a signal in time domain into a (periodic) frequency representation with N samples So we don’t have to deal with real signals anymore We work with sampled signals (quantized in time), and the frequency representation we get is also quantized in time! 28ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah (sepwww.stanford.edu/oldsep/hale/FftLab.html)

Discrete Fourier Transforms A smaller sampling period -> More points to represent the signal larger N -> More harmonics used in DFT N harmonics -> Smaller error compared to actual analog signal we capture/produce DFTs are extensively used in practice, since computers can handle them 29ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Discrete Fourier Transform exercise Complete the table below using the DFT equation shown above 30ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah (The bottom is redundant because the DFT of a real signal is symmetrical) 7 samples -> 7 harmonics

31 Approximate Reconstruction – Always achievable A signal sampled in time can be approximated arbitrarily closely from the time-sampled values With a DFT, each sample gives us knowledge of one harmonic Each harmonic is a component used in the reconstruction of the signal The more harmonics we use, the better the reconstruction Approximating the Sampled Signal { Cos[0t], Sin[1t], Cos[1t], Sin[2t], Cos[2t], Sin[3t], Cos[3t] } ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

32 Usually Computed, Not “Solved” 7 Samples; 7 Harmonics 11 Samples 15 Samples; 15 Harmonics ; 11 Harmonics DFT ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

ESE 250 – Spring’10 DeHon & Koditschek33 Yet Another Sampled (Real) Signal t v Measured Data: Sampled Signal:

34 Approximate Reconstruction – although always achievable – may require a lot of samples – to get good performance Sometimes time is better than frequency Some Signals Dislike Some Harmonics 15 Samples & Harmonics 21 Samples & Harmonics 31 Samples & Harmonics ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Saving resources However, N can get very large e.g., with a sampling rate of 48,000Hz How big is N for a 4min song? How many operations does this translate to? – To compute one frequency component? – To compute all N frequency components? This is not practical. Instead, we use a window of values to which we apply the transform – Typical size: …, 512, 1024, 2048, … 35ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

A Window Operation In the example below, we traverse the signal but only look at 64 samples at a time 36ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah Time Freq (sepwww.stanford.edu/oldsep/hale/FftLab.html)

A Window Operation The following shows a DFT (on the right) applied to a sinusoidal signal (on the left). The DFT is only applied to part of the signal, the window, which is shown in the middle When we increase the window size, the information of the DFT is more accurate 37ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah 8-point DFT ( 16-point DFT32-point DFT

Moonlight Sonata in Time and Frequency 38ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Big ideas A signal in time-domain can also be represented in the frequency domain. – X(f) = Transform(x(t)) This representation may be more efficient: – For storage – For signal processing – For understanding the wave (e.g. can cut-off some frequencies) We go from a signal represented by values in time to one represented by coefficients of harmonics Fourier Series, for continuous periodic signals FT: Fourier Transform, for continuous signals DFT: Discrete Fourier Transform, for discrete signals – DFTs are extensively used in practice – Finite amount of data, easy to implement for computers 39ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Admin Lab 3 due Wednesday (tomorrow) On Thursday, Lab 4: – You will be looking at signals in the frequency domain in LabView – You will create your own synthesizer! 40ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah

Announcement Hackathon and bootcamp – If you are interested The bootcamp will be this Saturday, noon to six, in Detkin lab. The Hackathon will begin around 5-6 the weekend of the 15-17th 41ESE Spring'13 DeHon, Kod, Kadric, Wilson-Shah