Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify key2note_env.m to include a second and third harmonic. Be sure to apply the envelope to all three components of the note. Choose the relative

Modify key2note_env.m to include a second and third harmonic. Be sure to apply the envelope to all three components of the note. Choose the relative amplitude of the second and third harmonics so the note sounds good to you, but remember that the relative amplitudes must be less than one. Call your new function key2note_fancy.m. (Using Matlab)

Here is the key2note_env.m:

X represents the amplitude, and getADSR is the function that synthesizes the envelope to the key2note_env..

You can choose the amplitude of the second and third harmonics less than 1.
 

function [xx, tt] = key2note_env (X, keynum, dur, fs) % KEY2NOTE Produce a sinusoidal waveform corresponding to a % given piano key number % usage: xx = key2note (X, keynum, dur, fs) % XX = the output sinusoidal waveform % X = complex amplitude for the sinusoid, X = A*exp(j*phi). % keynum = the piano keyboard number of the desired note % dur = the duration (in seconds) of the output note % fs = sampling frequency tt = 0: (1/fs): dur; freq = 440*2^((1/12) * (keynum-49)); XX = real (x*exp(1j*2*pi*freq*tt)).* (getADSR (dur*fs+1));

Step by Step Solution

3.36 Rating (168 Votes )

There are 3 Steps involved in it

Step: 1

To modify key2noteenvm to include a second and third harmonic you can simply add two more sinusoidal ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Analysis and Design of Analog Integrated Circuits

Authors: Paul R. Gray, ‎ Paul J. Hurst Stephen H. Lewis, ‎ Robert G. Meyer

5th edition

1111827052, 1285401107, 9781285401102 , 978-0470245996

More Books

Students also viewed these Business Writing questions

Question

Discuss the primary sources of nonverbal communication.

Answered: 1 week ago

Question

2. Write the introduction section of a paper.

Answered: 1 week ago

Question

What are types of firms that exemplify monopolistic competition?

Answered: 1 week ago