Ira Fulton School of Engineering Intro to Sinusoids What is a sinusoid? » Mathematical equation : Function of the time variable : Amplitude : Frequency.

Slides:



Advertisements
Similar presentations
Introduction to Alternating Current and Voltage
Advertisements

Each of the circuit elements will have a different ac current response to an applied ac voltage. We need to look at each of these elements. Resistor:
Sound Synthesis Part II: Oscillators, Additive Synthesis & Modulation.
Tamara Berg Advanced Multimedia
What makes a musical sound? Pitch n Hz * 2 = n + an octave n Hz * ( …) = n + a semitone The 12-note equal-tempered chromatic scale is customary,
Chapter 11.
Techniques in Signal and Data Processing CSC 508 Frequency Domain Analysis.
1 Transmission Fundamentals Chapter 2 (Stallings Book)
Lesson 17 Intro to AC & Sinusoidal Waveforms
Chapter 15 AC Fundamentals.
Math Review with Matlab:
Chapter 11.
Sine waves The sinusoidal waveform (sine wave) is the fundamental alternating current (ac) and alternating voltage waveform. Electrical sine waves are.
Review on Fourier …. Slides edited from: Prof. Brian L. Evans and Mr. Dogu Arifler Dept. of Electrical and Computer Engineering The University of Texas.
Music Processing Roger B. Dannenberg. Overview  Music Representation  MIDI and Synthesizers  Synthesis Techniques  Music Understanding.
7/5/20141FCI. Prof. Nabila M. Hassan Faculty of Computer and Information Fayoum University 2013/2014 7/5/20142FCI.
SINUSOIDAL ALTERNATING WAVEFORMS
Harmonics and Overtones Waveforms / Wave Interaction Phase Concepts / Comb Filtering Beat Frequencies / Noise AUD202 Audio and Acoustics Theory.
Transmitting Signals First Meeting. Signal Processing: Sinewaves Sinewave is a fundamental tool in many areas of science, engineering and mathematics.
SAMPLING & ALIASING. OVERVIEW Periodic sampling, the process of representing a continuous signal with a sequence of discrete data values, pervades the.
Chapter 15 Fourier Series and Fourier Transform
Q factor of an underdamped oscillator large if  is small compared to  0 Damping time or "1/e" time is  = 1/   (>> 1/   if  is very small)
Alternating-Current Circuits Chapter 22. Section 22.2 AC Circuit Notation.
infinity-project.org Engineering education for today’s classroom 53 Design Problem - Digital Band Build a digital system that can create music of any.
AC Fundamentals Chapter 15. Introduction 2 Alternating Current 3 Voltages of ac sources alternate in polarity and vary in magnitude Voltages produce.
Vibrationdata 1 Unit 5 The Fourier Transform. Vibrationdata 2 Courtesy of Professor Alan M. Nathan, University of Illinois at Urbana-Champaign.
Lecture 1 Signals in the Time and Frequency Domains
ELECTRICAL CIRCUIT ET 201 Define and explain characteristics of sinusoidal wave, phase relationships and phase shifting.
EE 319K Introduction to Microcontrollers
Motivation Music as a combination of sounds at different frequencies
1 Prof. Nizamettin AYDIN Advanced Digital Signal Processing 30/09/14.
EE2010 Fundamentals of Electric Circuits Lecture 13 Sinusoidal sources and the concept of phasor in circuit analysis.
Prof. Brian L. Evans Dept. of Electrical and Computer Engineering The University of Texas at Austin EE445S Real-Time Digital Signal Processing Lab Fall.
Wireless PHY: Modulation and Demodulation Y. Richard Yang 09/6/2012.
Lecture 3 MATLAB LABORATORY 3. Spectrum Representation Definition: A spectrum is a graphical representation of the frequency content of a signal. Formulae:
1 Prof. Nizamettin AYDIN Digital Signal Processing.
Wireless and Mobile Computing Transmission Fundamentals Lecture 2.
1 Prof. Nizamettin AYDIN Advanced Digital Signal Processing.
1 Prof. Nizamettin AYDIN Digital Signal Processing.
Chapter 15 AC Fundamentals.
EE 113D Fall 2008 Patrick Lundquist Ryan Wong
1 ECE 3336 Introduction to Circuits & Electronics Note Set #8 Phasors Spring 2013 TUE&TH 5:30-7:00 pm Dr. Wanda Wosik.
421 Pendulum Lab (5pt) Equation 1 Conclusions: We concluded that we have an numerically accurate model to describe the period of a pendulum at all angles.
Vibrationdata 1 Unit 6a The Fourier Transform. Vibrationdata 2 Courtesy of Professor Alan M. Nathan, University of Illinois at Urbana-Champaign.
Digital Signal Processing
Superposition and Standing Waves
AC SINUSOIDS Lecture 6 (I). SCOPE Explain the difference between AC and DC Express angular measure in both degrees and radians. Compute the peak, peak-peak,
Chapter2 : SIGNALS 1st semester King Saud University
EEE 332 COMMUNICATION Fourier Series Text book: Louis E. Frenzel. Jr. Principles of Electronic Communication Systems, Third Ed. Mc Graw Hill.
Chapter 2. READING ASSIGNMENTS This Lecture: Chapter 2, pp Appendix A: Complex Numbers Appendix B: MATLAB or Labview Chapter 1: Introduction.
1 AC Circuit Theory. 2 Sinusoidal AC Voltage Waveform: The path traced by a quantity, such as voltage, plotted as a function of some variable such as.
Signals & Systems Lecture 17: Chapter 3 Spectrum Representation.
DSP First, 2/e Lecture 5 Spectrum Representation.
DSP First, 2/e Lecture 6 Periodic Signals, Harmonics & Time-Varying Sinusoids.
Chapter 8 Introduction to Alternating Current and Voltage.
DSP First, 2/e LECTURE #1 Sinusoids Aug © , JH McClellan & RW Schafer.
Lecture 6 Periodic Signals, Harmonics & Time-Varying Sinusoids
Time-Frequency Spectrum
Fourier Series Prof. Brian L. Evans
UNIT – II ANGLE MODULATION (Part -1/2) Prepared by:
Periodic Signals Prof. Brian L. Evans
Lecture 5 Spectrum Representation
Review on Fourier …. Slides edited from: Prof. Brian L. Evans and Mr. Dogu Arifler Dept. of Electrical and Computer Engineering The University of Texas.
SAMPLING & ALIASING.
Lecture 2 Data and Signals
UNIT II Analysis of Continuous Time signal
Electric Circuits Fundamentals
LECTURE #2 Phase & Time-Shift Delay & Attenuation
Signal Processing First
Signal Processing First
Presentation transcript:

Ira Fulton School of Engineering Intro to Sinusoids What is a sinusoid? » Mathematical equation : Function of the time variable : Amplitude : Frequency (# cycles per sec, Hertz) : Phase

Ira Fulton School of Engineering SINUSOIDAL SIGNAL FREQUENCY –Radians/sec –Hertz (cycles/sec) PERIOD (in sec) AMPLITUDE –Magnitude PHASE Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering Intro to Sinusoids What is a sinusoid? » Plot

Ira Fulton School of Engineering Intro to Sinusoids Examples

Ira Fulton School of Engineering Intro to Sinusoids Examples

Ira Fulton School of Engineering Intro to Sinusoids Examples

Ira Fulton School of Engineering Intro to Sinusoids How to plot a sinusoid? » Determine height » Determine zero crossings Max height is +A » peaks oscillate: +A and -A » peaks occur when argument of cosine is a multiple of, i.e.,

Ira Fulton School of Engineering Intro to Sinusoids Zero crossings » where plot crosses zero » located at odd multiples of, i.e., Note: cycles repeat (periodic function) » sufficient to determine peak and zero crossings in one cycle and then replicate cycle » Period = length of cycle =

Ira Fulton School of Engineering Intro to Sinusoids We can also get equation from plot » find the parameters,, and

Ira Fulton School of Engineering Intro to Sinusoids We can also get equation from plot » find the parameters,, and Answer:

Ira Fulton School of Engineering Intro to Sinusoids Procedure to get equation from plot Find the amplitude Find the period by measuring the time distance between positive peaks: Find the phase by measuring the “time shift” (delay from 0) of a peak. Note: positive if peak moved to right, and negative if peak moved to left. Then, compute

Ira Fulton School of Engineering Intro to Sinusoids Sinusoids can be interpreted as a “rotating phasor” rotating angle » : speed of rotation (# cycles per sec) » : initial angle start point

Ira Fulton School of Engineering TRIG FUNCTIONS Circular Functions Common Values –sin(k  ) = 0 –cos(0) = 1 –cos(2k  ) = 1 and cos((2k+1)  ) = -1 –cos((k+0.5)  ) = 0 Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering Generating Signals using Sinusoids Main reason why sinusoids are important: they are basic tools for constructing other useful and more complicated signals A new signal can be generated by combining together different sinusoids

Ira Fulton School of Engineering Example: Beat Note Waveform Beat notes generated by adding two sinusoids with nearby frequencies They can also be generated by playing two neighboring piano keys Mathematically: where small. Generating Signals using Sinusoids

Ira Fulton School of Engineering Generating Signals using Sinusoids Example: Beat Note Waveform Let Matlab Script File: beatnote.m dur = 2.0; fs = 8000; f1 = 220; f2 = 180; t = 0: (1/fs): dur; x = cos(2*pi*f1*t)+cos(2*pi*f2*t); plot(t,x); xlabel(‘Time,t’); ylabel(‘Beat Signal’); sound(x,fs);

Ira Fulton School of Engineering Generating Signals using Sinusoids Example: Beat Note Waveform Let Matlab Function: beat.m function [x,t] = beat(f0, d, dur); fs = 8000; f1 = f0+d; f2 = f0-d; t = 0: (1/fs): dur; x = cos(2*pi*f1*t)+cos(2*pi*f2*t);

Ira Fulton School of Engineering Matlab Functions Example: Beat Note Waveform Let Matlab Script File using Function beat.m [x,t] = beat(200,20,1); plot(t,x); xlabel(‘Time,t’); ylabel(‘Beat Signal’); sound(x,fs);

Ira Fulton School of Engineering Generating Signals using Sinusoids A new signal can be generated by combining together different sinusoids Periodic signals obtained when frequencies are integer multiples of : where is called harmonic frequency of and is called the fundamental frequency.

Ira Fulton School of Engineering Generating Signals using Sinusoids A new periodic signal can be generated by combining together sinusoids having harmonically related frequencies Period = length of one cycle =

Ira Fulton School of Engineering PERIODIC SIGNALS Repeat every T secs –Definition –Example: –Speech can be “quasi-periodic” Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering Generating Signals using Sinusoids Example: Square Wave For N =1:

Ira Fulton School of Engineering Generating Signals using Sinusoids T=0.1 Courtesy of James McClellan et al, Signal Processing First, 2003 Square Wave generates using only first 3 harmonic Frequencies:

Ira Fulton School of Engineering Generating Signals using Sinusoids Example: Square Wave Matlab Function square.m function [x,t] = square(f0, N, dur); fs = 8000; t = 0:1/fs:dur; x = zeros(1,length(t)); for m = 0:N x = x + (8/((2*m+1)*pi))*cos(2*pi*(2*m+1)*f0*t- pi/2); end Generate and plot square waves with = 25Hz, dur = 0.12 sec, and N=1,2,3,25

Ira Fulton School of Engineering Generating Signals using Sinusoids Example: Synthetic Vowel Generated signal approximates the waveform produced by a man speaking the sound “ah”.

Ira Fulton School of Engineering Vowel Waveform (sum of all 5 components) Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering Generating Signals using Sinusoids Example: Synthetic Vowel Matlab Script File dur = 1; f = 100; fs = 8000; t = 0:1/fs:dur; x = * cos(2*pi*2*f*t ); x = x * cos(2*pi*4*f*t ); x = x * cos(2*pi*5*f*t ); x = x * cos(2*pi*16*f*t ); x = x * cos(2*pi*17*f*t); plot(t,x); xlabel(‘Time, t’); ylabel(‘Vowel’) sound(x,fs)

Ira Fulton School of Engineering TUNING FORK EXAMPLE “A” is at 440 Hertz (Hz) Waveform is a SINUSOIDAL SIGNAL Computer plot looks like a sine wave This should be the mathematical formula: Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering TUNING FORK A-440 Waveform Time (sec)

Ira Fulton School of Engineering SPEECH EXAMPLE More complicated signal (BAT.WAV) Waveform x(t) is NOT a Sinusoid Theory will tell us –x(t) is approximately a sum of sinusoids –FOURIER ANALYSIS Break x(t) into its sinusoidal components –Called the FREQUENCY SPECTRUM Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering Speech Signal: BAT PeriodicNearly Periodic in Vowel Region –Period is (Approximately) T = sec Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering DIGITIZE the WAVEFORM x[n] is a SAMPLED SINUSOID –A list of numbers stored in memory Sample at 11,025 samples per second –Called the SAMPLING RATE of the A/D –Time between samples is 1/11025 = 90.7 microsec Output via D/A hardware (at F samp ) Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering STORING DIGITAL SOUND x[n] is a SAMPLED SINUSOID –A list of numbers stored in memory CD rate is 44,100 samples per second 16-bit samples Stereo uses 2 channels Number of bytes for 1 minute is –2 X (16/8) X 60 X = Mbytes Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering Always use the COSINE FORM Sine is a special case: SINES and COSINES Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering Sinusoidal Synthesis Sinusoids with DIFFERENT Frequencies –SYNTHESIZE by Adding Sinusoids SPECTRUM Representation DIFFERENT –Graphical Form shows DIFFERENT Frequencies SPECTROGRAM Tool –Shows how frequency content varies in function of time –MATLAB function is specgram.m Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering SPECTROGRAM EXAMPLE Two Constant Frequencies: Beats Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering Time-Varying Frequency Diagram Frequency is the vertical axis Time is the horizontal axis A-440 Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering Sinusoidal Synthesis: Motivation Synthesize Complicated Signals –Musical Notes Piano uses 3 strings for many notes Chords: play several notes simultaneously –Human Speech Vowels have dominant frequencies Application: computer generated speech –Can all signals be generated this way? Sum of sinusoids? Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering Fur Elise WAVEFORM Beat Notes Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering SIMPLE TEST SIGNAL C-major SCALE: stepped frequencies –Frequency is constant for each note IDEAL Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering SPECTROGRAM of C-Scale ARTIFACTS at Transitions Sinusoids ONLY From SPECGRAM ANALYSIS PROGRAM Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering Spectrogram of LAB SONG ARTIFACTS at Transitions Sinusoids ONLY Analysis Frame = 40ms Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering Time-Varying Frequency Frequency can change vs. time –Continuously, not stepped FREQUENCY MODULATION (FM)FREQUENCY MODULATION (FM) CHIRP SIGNALS –Linear Frequency Modulation (LFM) VOICE Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering New Signal: Linear FM Called Chirp Signals (LFM) –Quadratic phase Freq will change LINEARLY versus time –Example of Frequency Modulation (FM) –Define “instantaneous frequency” QUADRATIC Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering INSTANTANEOUS FREQ Definition For Sinusoid: Derivative of the “Angle” Makes sense Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering INSTANTANEOUS FREQ of the Chirp Chirp Signals have Quadratic phase Freq will change LINEARLY versus time Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering CHIRP SPECTROGRAM Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering CHIRP WAVEFORM Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering OTHER CHIRPS  (t) can be anything:  (t) could be speech or music: –FM radio broadcast Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering SINE-WAVE FREQUENCY MODULATION (FM) Courtesy of James McClellan et al, Signal Processing First, 2003

Ira Fulton School of Engineering Music Synthesis Musical notes synthesized using a sinewave at a given frequency. Musical scale is divided into 8 octaves; each octave consists of 12 notes. Notes in each octave are related to notes in previous and next octave: –The frequency of a note is twice the frequency of the corresponding note in the previous adjacent (lower) octave. Each octave contains 12 notes (5 black keys and 7 white) and the ratio between the frequencies of the notes is constant between successive notes: f next note = 2 1/12 f previous note

Ira Fulton School of Engineering Music - Octave D4 denotes D note in 4 th octave A4 or A-440 note (tone at 440 Hz) is usually a reference note called middle A.

Ira Fulton School of Engineering Music - Octave

Ira Fulton School of Engineering Music - Notation Musical notation shows which notes are to be played and their relative timing 4

Ira Fulton School of Engineering Sinewave Synthesis Methods used –Recursive –Taylor’s Series –Look-up Table

Ira Fulton School of Engineering Recursive Method Let A =  and B =n  where  is the angle and n the index For  = 1 and n= 1 Sin(2) and cos(2) can be computed using only four multiplications and 2 addition/subtraction Sin(1) and cos(1) must first be precomputed and stored in memory

Ira Fulton School of Engineering Recursive Method – Practical Example Generate a sine wave of frequency F = 100 Hz having a sample frequency Fs equals to 8000 samples/s. Calculate the angle increment  –Total number of samples/period = Fs/F = 80 –The angle increment  = 360/80 = 4.5  Precompute sin(4.5) and cos(4.5) Apply the recursive method

Ira Fulton School of Engineering Taylor’s Series

Ira Fulton School of Engineering Look-up Table Calculate the values of L evenly spaced points on a sinusoid and store them in memory Suppose L = 16 and Fs = samples/s The total number of cycles obtained per second is:16000/16 = 1000 Hz –The frequency calculated is called fundamental frequency given by: Base Address0 Base Address + 1 sin(2  /L) Base Address + 2 sin(4  /L) Base Address + L – 1 sin(2  (L-1)/L)

Ira Fulton School of Engineering If the samples are not read sequentially from the look-up table (e.g., skipping one sample), the frequency generated will be: Look-up Table (Cont’d) where: and  is the lookup table increment index. Example: Suppose Fs = 16 Khz, L = 16, and  = 2: The maximum value  can reach is bounded by the Nyquist rate:  = L/2 => f sin = F s /2;

Ira Fulton School of Engineering Frequency synthesized for different values of  (L = 16) Look-up Table (Cont’d)  Frequency Generated (Hz) Maximum Frequency What if  not integer?

Ira Fulton School of Engineering Look-up Table – Non Integer  Two Methods –Round – down –Interpolation

Ira Fulton School of Engineering Look-up Table – Round Down Method “+”: Look-up Table “o”: Desired Output L = 8  = 2.5 High Distortion!!

Ira Fulton School of Engineering (3,0.7071) (2,1) Look-up Table – Interpolation Linear interpolation method used y = mx + b where: m = line slope given by (Base_address + l +1) – (Base_address + l ) Base_address is the beginning address of the lookup table. b = (Base_address + l ). x = fractional part of the pointer with 0<x<1 y = linear approximated output sample. Note that () denotes indirect addressing. Interpolation 0.5.( )+1 = Interpolation 0.5.( )+1 =

Ira Fulton School of Engineering Methods - Comparison Look-up TableTaylor’s SeriesRecursive Method Memory SpaceYesNo SpeedFastSlow ComplexityLowHighModerate AccuracyModerateHigh

Ira Fulton School of Engineering Amplitude Modulation of Tones - ADSR envelope Smoothing may be needed since the musical note will not reach its full intensity instantaneously Attack – Decay – Sustain- Release (ADSR) envelope -Attack time: time during which the musical note reaches its peak -Decay time: time required for the tone’s intensity to partially die away -Sustain time: time where the tone’s intensity remains unchanged -Release time: time for final attenuation

Ira Fulton School of Engineering ADSR - Examples

Ira Fulton School of Engineering ADSR Generation -One segment at a time (A – D – S – R) -Approximated as rising/decaying exponentials

Ira Fulton School of Engineering ADSR Generation – cont’d -If Fs = samples/s and assuming a max note duration of 1 second, we need to store 16K in memory for the ADSR envelope values, which consumes a lot of memory -An alternative to the lookup ADSR is to try to compute the values “on the fly” using the equation: where g is the rise/decay rate and x(n) is the desired target value; initially x(-1)= 0. ^

Ira Fulton School of Engineering ADSR Generation – cont’d -The equation presented previously is a first- order IIR filter given by the following difference equation: z -1 g  1-g y[n]x[n]

Ira Fulton School of Engineering ADSR Generation – cont’d IIR Filter Why??? Solve for the equation and show that the output have an exponential shape