1 Announcements l Take textbook to lab. »Be sure to read Chapter 13 before lab –MATLAB tutorial –Can skip Section 13.4 l Bring your transmitter and receiver.

Slides:



Advertisements
Similar presentations
Analog and Digital Signals AD/DA conversion BME 1008 Introduction to Biomedical Engineering FIU, Spring 2015 Feb 5 Lesson 3.
Advertisements

A Phonetician ’ s Guide to Audio Formats Chilin Shih University of Illinois at Urbana Champaign LSA 2006January 5-8, 2006.
Sound can make multimedia presentations dynamic and interesting.
Part A Multimedia Production Rico Yu. Part A Multimedia Production Ch.1 Text Ch.2 Graphics Ch.3 Sound Ch.4 Animations Ch.5 Video.
CMPS1371 Introduction to Computing for Engineers PROCESSING SOUNDS.
What have we learned so far?  When we apply a voltage, the capacitor will charge up to the applied voltage.  The capacitor charges up exponentially.
CHAPTER 5 Discrete Sampling and Analysis of Time-Varying Signals Analog recording systems, which can record signals continuously in time, digital data-acquisition.
Chapter 13 Sounds and signals basics of computer sound perception and generation of sound synthesizing complex sounds sampling sound signals simple example.
EGR 106 – Week 2 – Arrays & Scripts Brief review of last week Arrays: – Concept – Construction – Addressing Scripts and the editor Audio arrays Textbook.
Chapter 2 Fundamentals of Data and Signals
Chapter 2 : Business Information Business Data Communications, 4e.
Chapter 4: The Building Blocks: Binary Numbers, Boolean Logic, and Gates Invitation to Computer Science, C++ Version, Fourth Edition.
1 Chapter 2 Fundamentals of Data and Signals Data Communications and Computer Networks: A Business User’s Approach.
Data Acquisition. Data Acquisition System Analog Signal Signal Conditioner ADC Digital Processing Communication.
Sampling of Continuous Time Signal Section
Representing Sound in a computer Analogue  Analogue sound is produced by being picked up by a transducer (microphone) and converted in an electrical current.
Introduction to Digital Audio
11 Lecture Slides ME 3222 Kinematics and Control Lab Lab 2 AD DA and Sampling Theory By Dr. Debao Zhou.
Computer Science 121 Scientific Computing Winter 2014 Chapter 13 Sounds and Signals.
Vibrationdata 1 Unit 5 The Fourier Transform. Vibrationdata 2 Courtesy of Professor Alan M. Nathan, University of Illinois at Urbana-Champaign.
School of Informatics CG087 Time-based Multimedia Assets Sampling & SequencingDr Paul Vickers1 Sampling & Sequencing Combining MIDI and audio.
Fall 2004EE 3563 Digital Systems Design Audio Basics  Analog to Digital Conversion  Sampling Rate  Quantization  Aliasing  Digital to Analog Conversion.
Key terms Sampling rate – how often we read the value of the signal Resolution – the separation between “levels” for our samples (can we read the value.
Lab #8 Follow-Up: Sounds and Signals* * Figures from Kaplan, D. (2003) Introduction to Scientific Computation and Programming CLI Engineering.
Data Communications & Computer Networks, Second Edition1 Chapter 2 Fundamentals of Data and Signals.
Week 7 - Wednesday.  What did we talk about last time?  Introduction to arrays  Lab 6.
(2.1) Fundamentals  Terms for magnitudes – logarithms and logarithmic graphs  Digital representations – Binary numbers – Text – Analog information 
1 Quiz Preparation l Quiz 4 sheet provided. l Fill in your Name, etc. l Date is 9/11/12 l Answer questions during lecture. Lab Day/TimeSection Number Mon.
Introduction to MATLAB Session 1 Prepared By: Dina El Kholy Ahmed Dalal Statistics Course – Biomedical Department -year 3.
1 Chapter 1 MATLAB Primer This introductory chapter is relatively short and has as its main objective the introduction of MATLAB ® to the reader. This.
Sampling Theorems. Periodic Sampling Most signals are continuous in time. Example: voice, music, images ADC and DAC is needed to convert from continuous-time.
Objectives Understand what MATLAB is and why it is widely used in engineering and science Start the MATLAB program and solve simple problems in the command.
Arrays and Array Visualization Alice. What is an array? An array is a collection of objects or information that is organized in a specific order. The.
AUDIO MEDIA 1 Created } “Borrowed” } Microphone MIDI keyboard CD’s & flash drives Internet Audio Sources 2.
ECE 1304 Introduction to Electrical and Computer Engineering Section 1.1 Introduction to MATLAB.
Overview of Multimedia A multimedia presentation might contain: –Text –Animation –Digital Sound Effects –Voices –Video Clips –Photographic Stills –Music.
Multimedia Technology and Applications Chapter 2. Digital Audio
Music Tech.  What is the definition of sound?  What is a wave?
Matlab Programming for Engineers Dr. Bashir NOURI Introduction to Matlab Matlab Basics Branching Statements Loops User Defined Functions Additional Data.
Introduction to Matlab Module #2 Page 1 Introduction to Matlab Module #2 – Arrays Topics 1.Numeric arrays (creation, addressing, sizes) 2.Element-by-Element.
10/24/20151 Chapter 2 Review: MATLAB Environment Introduction to MATLAB 7 Engineering 161.
Digital Sound Actual representation of sound Stored in form of thousands of individual numbers (called samples) Not device dependent Stored in bits.
Vibrationdata 1 Unit 5 The Fourier Transform. Vibrationdata 2 Courtesy of Professor Alan M. Nathan, University of Illinois at Urbana-Champaign.
Sound Conversion Chilin Shih University of Illinois — Urbana Champaign E-MELD Conference 2003 July 11 th -13th LSA Institute Michigan State University.
Digital Recording. Digital recording is different from analog in that it doesn’t operate in a continuous way; it breaks a continuously varying waveform.
Chapter 12 The Principles of Computer Music Contents Digital Audio Processing Noise Reduction Audio Compression Digital Rights Management (DRM)
Introduction to Matlab Module #4 Page 1 Introduction to Matlab Module #4 – Programming Topics 1.Programming Basics (fprintf, standard input) 2.Relational.
A string is an array of characters Strings have many uses in MATLAB Display text output Specify formatting for plots Input arguments for some functions.
Vibrationdata 1 Unit 6a The Fourier Transform. Vibrationdata 2 Courtesy of Professor Alan M. Nathan, University of Illinois at Urbana-Champaign.
Matlab Programming for Engineers
CSCI-100 Introduction to Computing Hardware Part II.
Array Creation ENGR 1187 MATLAB 2. Today’s Topics  Arrays: What are they?  Vectors  Matrices  Creating Arrays.
Digital Signal Processing
Introduction to Engineering MATLAB – 4 Arrays Agenda Creating arrays of numbers  Vectors: 1-D Arrays  Arrays: 2-D Arrays Array Addressing Strings & String.
Introduction to MATLAB 1.Basic functions 2.Vectors, matrices, and arithmetic 3.Flow Constructs (Loops, If, etc) 4.Create M-files 5.Plotting.
Chapter 4 Digital Transmission. 4.2 Summary Line Coding Line Coding Schemes Block Coding Scrambling Signal Element versus data element Multilevel : 2b1Q.
Digital Oscillators. Everything is a Table A table is an indexed list of elements (or values) A digital oscillator or soundfile is no different.
Transmission Media. Quiz: ANGEL->Lessons->Quiz 2 Figure 1Figure 2 Figure 3Figure 4.
Signal Processing for Mechatronics. Textbook Signal Processing First Hardcover – March 8, 2003 by James H. McClellan, Ronald W. Schafer, Mark A. Yoder.
1-2 What is the Matlab environment? How can you create vectors ? What does the colon : operator do? How does the use of the built-in linspace function.
Fourier Analysis Patrice Koehl Department of Biological Sciences National University of Singapore
Introduction to Matlab
Data analysis and modeling: the tools of the trade
Unit 5 The Fourier Transform.
Multimedia Systems and Applications
MECH 373 Instrumentation and Measurements
Net 222: Communications and networks fundamentals (Practical Part)
COMS 161 Introduction to Computing
Recap In previous lessons we have looked at how numbers can be stored as binary. We have also seen how images are stored as binary. This lesson we are.
Presentation transcript:

1 Announcements l Take textbook to lab. »Be sure to read Chapter 13 before lab –MATLAB tutorial –Can skip Section 13.4 l Bring your transmitter and receiver to lab. »8 AA batteries »2 9V batteries »Earphones l First Professional Memo Due TODAY!

2 Today’s Topics l Digital signals l Introduction to MATLAB l Generating audio signals with MATLAB

3 Digital Music - Recording Sampler …  byte CD Analog signalDigital signal

4 Digital Music - Playback D/A Converter … CD Analog signalDigital signal Audio Amplifier

5 Computer-Generated Signals MATLABSound Card D/A Converter Audio Amplifier …

6 Audio Signal l Sound generated by a PC originates as a sequence of numbers (a discrete signal). What we wantWhat we can generate

7 MATLAB l MATLAB® allows us to generate sequences easily. »The basic data structure in MATLAB is a vector. »A vector is a convenient way to store a sequence. l We can also play sounds from within MATLAB.

8 MATLAB Basics l Assign a value to a variable >> a=3 a = 3 >> a=3; >> a a = 3 >> Semicolon suppresses echo Typing a variable name displays the value Be careful!!

9 MATLAB Basics l Vectors >> v=[1,3] v = 1 3 >> v=[1;3] v = 1 3 >> v' ans = 1 3 >> v=1:0.5:3 v = Comma delimits columns Semicolon delimits rows Apostrophe means transpose (turn rows into columns and vice versa) start value : increment : end value

10 l We have been considering sine waves: l is the frequency of the sine wave. l Sample the waveform every T seconds. »Let »We get a sequence »Let n=0,…,N to get sequence corresponding to a duration of NT seconds. Generating Sine Waves

11 Continuous Sine Wave Time in seconds

12 Sampling Operation Time in seconds

13 Sampled Signal Time in seconds

14 Discrete Array Index (n)

15 MATLAB >> f0=100; >> T=.0008; >> n=0:62; >> x=sin(2*pi*f0*T*n); >> stem(n,x) start value : end value (assumes increment of 1) stem(n,x) plot(n,x)

16 Good Programming Habits >> f0=100; >> T=.0008; >> n=0:62; >> x=sin(2*pi*f0*T*n); >> stem(n,x) >> x=sin(2*pi*100*.0008*(0:62)); >> stem(n,x) GOOD BAD! Do not Repeat Yourself!!

17 MATLAB vs. C l C code to create a sine wave: #include main(argc,argv) int argc; char *argv[]; { int i,n; double *sv, f0; n=5000; f0=100; sv = (char *) calloc(n, double); for (i = 0; i < 50000; i++) { sv(i) = sin(2* *f0*I/44100); }

18 Other MATLAB Abilities l Many built-in functions l Can easily add your own functions l Immediate results without compiling l Can solve systems of equations easily l All kinds of plotting methods l Simulink l Maple Symbolic Math Toolbox

19 Sampling Period l If we sample too slowly (T too large), we can get a misleading sequence.

20 Sampled Signal

21 Is this the true signal?

22 Or, is this the true signal?

23 Aliasing

24 Sampling Rate Too Low

25 “Wagon Wheel Effect” Correct Sampling Aliasing

26 Avoiding Aliasing l To avoid aliasing, sample at least twice as fast as the highest frequency in the signal. »Minimum of two samples per period »Shannon’s Sampling Theorem l Example: »A 40 Hz sine wave should be sampled at 80 Hz or more

27 Playing Sounds in MATLAB l Can play sounds directly from MATLAB: »sound(x,44100) –x is the sequence of values in a vector –44100 is the output sampling rate »soundsc(x,44100) –Same as sound() but auto-levels before playing –Each sound played at the same level

28 Playing Sounds in MATLAB l Can read or write WAV files: »y = wavread(‘fast.wav’); –y is the sound sequence read in as a vector –fast.wav is the name of the file to be read. »wavwrite(y,44100,’fast.wav’)

29 Stereo in MATLAB l If x is an Nx2 vector, the left column will be played as the left channel, and the right column will be played as the right channel. »fl=200; »fr=300; »t=[0:1/44100:8]; »xl = sin(2*pi*fl*t); »xr = sin(2*pi*fr*t); l sound([xl’ xr’],44100)

30 Quiz 8 1. Long calculations or detailed specifications should be included in the main text of the a report. (True or False) 2. Contractions are acceptable in an engineering report. (True or False)