Fall Music 320A Homework #2 Sinusoids, Complex Sinusoids 145 points Theory and Lab Problems Due Thursday 10/11/2018 before class

Similar documents
Sinusoids. Lecture #2 Chapter 2. BME 310 Biomedical Computing - J.Schesser

DSP First. Laboratory Exercise #2. Introduction to Complex Exponentials

Lecture 3 Complex Exponential Signals

DSP First. Laboratory Exercise #7. Everyday Sinusoidal Signals

Signals and Systems EE235. Leo Lam

Signal Processing First Lab 02: Introduction to Complex Exponentials Multipath. x(t) = A cos(ωt + φ) = Re{Ae jφ e jωt }

Laboratory Assignment 4. Fourier Sound Synthesis

Basic Signals and Systems

1 Introduction and Overview

Digital Video and Audio Processing. Winter term 2002/ 2003 Computer-based exercises

Here are some of Matlab s complex number operators: conj Complex conjugate abs Magnitude. Angle (or phase) in radians

Signal Processing First Lab 02: Introduction to Complex Exponentials Direction Finding. x(t) = A cos(ωt + φ) = Re{Ae jφ e jωt }

DSP First Lab 03: AM and FM Sinusoidal Signals. We have spent a lot of time learning about the properties of sinusoidal waveforms of the form: k=1

1 Introduction and Overview

Problem Set 1 (Solutions are due Mon )

Spring 2018 EE 445S Real-Time Digital Signal Processing Laboratory Prof. Evans. Homework #1 Sinusoids, Transforms and Transfer Functions

GEORGIA INSTITUTE OF TECHNOLOGY. SCHOOL of ELECTRICAL and COMPUTER ENGINEERING

THE CITADEL THE MILITARY COLLEGE OF SOUTH CAROLINA. Department of Electrical and Computer Engineering. ELEC 423 Digital Signal Processing

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

Lab S-3: Beamforming with Phasors. N r k. is the time shift applied to r k

Laboratory Assignment 2 Signal Sampling, Manipulation, and Playback

Experiments #6. Convolution and Linear Time Invariant Systems

SIGNALS AND SYSTEMS: 3C1 LABORATORY 1. 1 Dr. David Corrigan Electronic and Electrical Engineering Dept.

ECE 201: Introduction to Signal Analysis

Fourier Series and Gibbs Phenomenon

Fourier Signal Analysis

Project 2 - Speech Detection with FIR Filters

SMS045 - DSP Systems in Practice. Lab 1 - Filter Design and Evaluation in MATLAB Due date: Thursday Nov 13, 2003

Electrical & Computer Engineering Technology

L A B 3 : G E N E R A T I N G S I N U S O I D S

Digital Signal Processing Laboratory 1: Discrete Time Signals with MATLAB

Armstrong Atlantic State University Engineering Studies MATLAB Marina Sound Processing Primer

ECE 201: Introduction to Signal Analysis. Dr. B.-P. Paris Dept. Electrical and Comp. Engineering George Mason University

ECE 201: Introduction to Signal Analysis

Lab P-4: AM and FM Sinusoidal Signals. We have spent a lot of time learning about the properties of sinusoidal waveforms of the form: ) X

STANFORD UNIVERSITY. DEPARTMENT of ELECTRICAL ENGINEERING. EE 102B Spring 2013 Lab #05: Generating DTMF Signals

Introduction to signals and systems

Lab 4 Fourier Series and the Gibbs Phenomenon

6.02 Fall 2012 Lecture #12

Alternating voltages and currents

Lecture 7 Frequency Modulation

y(n)= Aa n u(n)+bu(n) b m sin(2πmt)= b 1 sin(2πt)+b 2 sin(4πt)+b 3 sin(6πt)+ m=1 x(t)= x = 2 ( b b b b

Spectrum. Additive Synthesis. Additive Synthesis Caveat. Music 270a: Modulation

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

Lab 3 FFT based Spectrum Analyzer

Sinusoids and Phasors (Chapter 9 - Lecture #1) Dr. Shahrel A. Suandi Room 2.20, PPKEE

THE SINUSOIDAL WAVEFORM

Complex Numbers in Electronics

Lab P-3: Introduction to Complex Exponentials Direction Finding. zvect( [ 1+j, j, 3-4*j, exp(j*pi), exp(2j*pi/3) ] )

ECE438 - Laboratory 7a: Digital Filter Design (Week 1) By Prof. Charles Bouman and Prof. Mireille Boutin Fall 2015

THE HONG KONG POLYTECHNIC UNIVERSITY Department of Electronic and Information Engineering. EIE2106 Signal and System Analysis Lab 2 Fourier series

Digital Signal Processing Lecture 1 - Introduction

EEL 4350 Principles of Communication Project 2 Due Tuesday, February 10 at the Beginning of Class

Introduction to Digital Signal Processing (Discrete-time Signal Processing)

ECEn 487 Digital Signal Processing Laboratory. Lab 3 FFT-based Spectrum Analyzer

Introduction to Simulink Assignment Companion Document

Lab S-1: Complex Exponentials Source Localization

5.1 Graphing Sine and Cosine Functions.notebook. Chapter 5: Trigonometric Functions and Graphs

Lab 6: Building a Function Generator

Circuit Analysis-II. Circuit Analysis-II Lecture # 2 Wednesday 28 th Mar, 18

George Mason University Signals and Systems I Spring 2016

Project I: Phase Tracking and Baud Timing Correction Systems

DSP First Lab 08: Frequency Response: Bandpass and Nulling Filters

Frequency Division Multiplexing Spring 2011 Lecture #14. Sinusoids and LTI Systems. Periodic Sequences. x[n] = x[n + N]

1. page xviii, line 23:... conventional. Part of the reason for this...

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

Laboratory Assignment 5 Amplitude Modulation

Figure 1: Block diagram of Digital signal processing

Signal Processing. Introduction

Integrators, differentiators, and simple filters

George Mason University ECE 201: Introduction to Signal Analysis

ECE 3500: Fundamentals of Signals and Systems (Fall 2015) Lab 4: Binary Phase-Shift Keying Modulation and Demodulation

Lab S-8: Spectrograms: Harmonic Lines & Chirp Aliasing

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

Digital Signal Processing PW1 Signals, Correlation functions and Spectra

CMPT 468: Frequency Modulation (FM) Synthesis

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

ECE 203 LAB 2 PRACTICAL FILTER DESIGN & IMPLEMENTATION

DSP First. Laboratory Exercise #4. AM and FM Sinusoidal Signals

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

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

ME 375. HW 7 Solutions. Original Homework Assigned 10/12, Due 10/19.

Signal Processing First Lab 20: Extracting Frequencies of Musical Tones

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

SAMPLING THEORY. Representing continuous signals with discrete numbers

Sampling and Reconstruction of Analog Signals

Memorial University of Newfoundland Faculty of Engineering and Applied Science. Lab Manual

PYKC 27 Feb 2017 EA2.3 Electronics 2 Lecture PYKC 27 Feb 2017 EA2.3 Electronics 2 Lecture 11-2

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

4 Experiment 4: DC Motor Voltage to Speed Transfer Function Estimation by Step Response and Frequency Response (Part 2)

EEE - 321: Signals and Systems Lab Assignment 3

CSE4214 Digital Communications. Bandpass Modulation and Demodulation/Detection. Bandpass Modulation. Page 1

George Mason University ECE 201: Introduction to Signal Analysis Spring 2017

Synthesis: From Frequency to Time-Domain

Lab course Analog Part of a State-of-the-Art Mobile Radio Receiver

Chapter 2. Signals and Spectra

ESE 150 Lab 04: The Discrete Fourier Transform (DFT)

Midterm 1. Total. Name of Student on Your Left: Name of Student on Your Right: EE 20N: Structure and Interpretation of Signals and Systems

The Formula for Sinusoidal Signals

Massachusetts Institute of Technology Dept. of Electrical Engineering and Computer Science Fall Semester, Introduction to EECS 2

Transcription:

Fall 2018 2019 Music 320A Homework #2 Sinusoids, Complex Sinusoids 145 points Theory and Lab Problems Due Thursday 10/11/2018 before class Theory Problems 1. 15 pts) [Sinusoids] Define xt) as xt) = 2sin ω 0 t π ) +cosω 0 t) 4 a) Express xt) in the form xt) = Acosω 0 t+φ), where φ is in radians. b) Does the previous result depend on some special property of the two sinusoids combined, or can any two sinusoids be combined into a single sinusoid like this? Under what conditions can two different sinusoids be combined like this? c) Find a complex valued signal x such that xt) = Re{ xt)} 2. 15 pts) The phase of a sinusoid can be related to time shift as follows: xt) = Acos2πf 0 t+φ) = Acos2πf 0 t t 1 )) In the following parts, assume that the period of the sinusoidal wave is T 0 = 12 sec a) When t 1 = 3 sec, the value of the phase is φ = π/4. Explain whether this is true or false. b) When t 1 = 3 sec, the value of the phase is φ = π/2. Explain whether this is true or false. c) When t 1 = 7 sec, the value of the phase is φ = 5π/6. Explain whether this is true or false. 3. 15 pts) [Sinusoids] a) For a sinusoid with a period T 0 = 1/10 seconds, what is the frequency f 0 in Hz? What is the frequency ω 0 in radians per second? 1

b) Define xt) as xt) = Asin[ω t τ)]. Write an expression for the phase in terms of the frequency ω and time delay τ. c) For xt) defined as above, find the phase at t = 0 for a time delay of τ =.25 seconds and the frequency obtained for part a). 4. 35 pts) [Complex Sinusoids] Define the discrete-time generalized sinusoid x[n] = Xz n 0 for n = 0,1,2,..., where X = 2e jπ/4 z 0 = 0.9e jπ/8 a) 5 pts) What is the amplitude of this sinusoid? What is the phase in radians? What is the phase in cycles? What is the phase in degrees? b) 5 pts) What is the time constant τ of decay in samples)? c) 5 pts) What is the 60 db decay time T 60 in time constants? d) 5 pts) What is T 60 in samples? e) 5 pts) What is the 80 db decay time T 80 in time constants? f) 5 pts) What is T 80 in samples? g) 5 pts) If the sampling rate is 800 Hz, what are τ and T 60 in seconds, and what is the frequency of the sinusoid in Hz? 5. 10 pts) [AM, phasors] An amplitude modulated AM) cosine wave is represented by xt) = [12+7sinπt π/3)]cos13πt) Use complex sinusoids to show that xt) can be expressed as xt) = A 1 cosω 1 t+φ 1 )+A 2 cosω 2 t+φ 2 )+A 3 cosω 3 t+φ 3 ) where ω 1 < ω 2 < ω 3, thereby finding each A i,φ i, and ω i. 2

Lab Assignments README! VERY IMPORTANT!! For all lab assignments, submit your M-file scripts, functions, and figures in one zip file through the corresponding HW directory on the Assignments page on canvas 1. Within coursework, upload the zip file using the filename specification below. The zip file should be named with your last name, and homework number. For example, for Gavin Harrison s zip file, the file should be titled Gavin Harrison hw2.zip. For Gavin s answer to lab problem 3 on homework 2, the file would be titled q3.m. Also, at the beginning of each script, include the following comment: % Your Name / Lab # - Question # YoushouldcreateyourcodeinsuchawaythatIwillbeabletorunitfrommyowncomputer. This means that you should have the proper file references and root directories, etc.. All your plots should have appropriate titles, axis labels, and units. For problems with questions), include your answers) in the body of the script files as comments. Also, please fully comment your matlab code for readability. 1. 10 pts) Write a Matlab script that generates a sinusoidal wave. a) Its length must be 5 seconds, with 44100 samples per second CD quality). b) Its amplitude level must be -6 db, where 0 db corresponds to peak-amplitude A = 1. c) Use 440 Hz for its frequency. d) Your script must be able to save the wave as a sound file named mysound.wav and play it. Note that you do not need to submit the sound file: just submit your script. hint: audiowrite and sound can come handy) 2. 20 pts) Define the discrete-time generalized sinusoid xn) = Xz n 0 for n = 0,1,2,..., where X = 2e jπ/4 1 http://canvas.stanford.edu z 0 = 0.9e jπ/8 3

a) Plot re{xz n 0} and im{xz n 0} versus n. b) Plot Xz n 0 as a collection of points in the complex plane imaginary part versus real part). c) Mark circles on your plot, with the kth circle having radius X e k, where k = 0,1,2,3 indicating the amplitude of the signal after k time constants have passed. d) What is the number of time steps samples) that it takes for the signal to traverse between successive circles? Does it take the same amount of time to go from the k = 0 circle to the k = 1 circle as it does to go from the k = 1 circle to the k = 2 circle? e) Find the time constant τ of decay in samples. f) Mark the 60 db decay time T 60 on the plots. 3. 25 pts) Additive synthesis, the sum of K cosine waves, can be expressed as yt) = K A k cos2πf k t+φ k ) k=1 where A k, f k, and φ k are the peak amplitude, frequency Hz), and initial phase rad) of kth sinusoidal component. Also, K is the number of sinusoidal components. Write a Matlab function that implements this synthesis method and saves the result as an audio file. The syntax of your function should be as follows: function y = additivef, Z, fs, dur, name) % function y = additivef, Z, fs, dur, name) % f: vector of frequencies in Hz % Z: vector of complex amplitudes A*expj*phi) % fs: sampling rate in Hz % dur: total duration of the signal in seconds % name: name of the output audio file % f and Z must be of the same length: % Z1) corresponds to f1) and so on. % Your Name / Lab 2-2 Remember: a) Your function must be able to take any length of f and Z, as long as they are of the same length. b) Note that Z is a vector of complex amplitudes that is, phasors), not real numbers. c) Try to make it run as fast as possible: can you implement this without using any loop in your code? 4

d) Use your additive function to generate a one-second-long, unit-amplitude, zerophase sine wave at f 0 = 200 Hz. e) Use your additive function to generate the sum of four sinusoids with frequencies [220, 660, 1100, 1540], and amplitudes [1, 1/3, 1/5, 1/7], all with zero phase. f) Using your function or creating another one), create a signal that is comprised of each frequency starting with 220Hz) presented in a sequence 1 second apart with 1 second periods of silence in between e.g. 220Hz for 1 second, silence for 1 second, 660Hz for 1 second, silence for 1 second,..., 1540 Hz for 1 second). g) Listen to all three of these signals, and plot the first 10 milliseconds of each on the same axes, labelling the time axis in milliseconds. h) Use your additive function to generate the sum of sinusoids with frequencies f 0 [1:7] and amplitudes 1/[1:7]. What waveform does this approximate? i) Generate the same, but with randomized phase. Does it sound the same? Does it look the same? Optional: Use the Dual-tone multi-frequency signaling DTMF) table on the Wikipedia DTMF page 2, generate a sequence of tones for your own telephone numbers, each tone last around 300ms, comment your own telephone number in the matlab script, and wavwrite your number into a wave file. General Hints: Obtain the real sinusoid by taking the real part of a complex sinusoid. For faster implementation, think about vector and matrix multiplication in place of loops over samples.) 4. Plotting Generalized Complex Sinusoids a) 5pts)Foreachofthefollowingcomplexsignalsx[n], plotthefirst10,000samples in the time domain. Plot the real and the imaginary part of the signal separately. i. x[n] = e j π 4 0.999e j N) π n N = 512) ii. x[n] = e j π 2 0.999e j N) π n N = 2048) iii. x[n] = ) ) e j π n n N + 0.9995e j 4π N N = 1024) b) 5 pts) Repeat the previous problem, plotting the complex amplitudes of the first 10,000 samples of each of the signals x[n] in the z plane. c) 10 pts) Discuss the two different representations of the signals. What are the advantages of one plot over the other? How are they related? [Hint: Consider Euler s identity and circular motion as depicted on the cover of the textbook see the gif here: http://en.wikipedia.org/wiki/phasor)] 2 http://en.wikipedia.org/wiki/dual-tone multi-frequency signaling#keypad 5