![]() ece481 | doering | ece labs | ece | rhit |
|
![]() | Hardcopy of all MATLAB code that you develop |
![]() | Name of AFS public directory containing your .WAV files |
![]() | Brief write-up summarizing your results |
Implement the functions osc(type,f,dur,fs) and noise(dur,fs), where type is a string variable indicating 'sine', 'square', 'saw', or 'pulse' (do help square), f indicates frequency in Hz, dur indicates duration in seconds, and fs indicates sampling frequency in Hz. Both functions should return a 1xN row vector with unit amplitude.
Demonstrate the operation of your functions.
Implement the function adsr(atime,dtime,slevel,rtime,dur,fs) which produces an ADSR envelope as a result. Use exponential functions for the transient portions of the envelope. The maximum value of the envelope should always be unity.
dur refers to the total length of the envelope, and fs refers to the sampling frequency in Hz. atime is the percentage (0 to 100) of the total time associated with the attack phase (similarly, dtime is decay phase and rtime is release phase). slevel refers to the envelope value (also in percent of max value) during the sustain phase. [Hint: Please refer to my function adenv.m as an example of an attack/decay envelope generator. Also, look at the MATLAB function linspace].
Show that your ADSR module functions properly by plotting the envelope for at least two distinct cases.
Compose a simple piece of music using analog synthesis techniques of your choice. Better compositions will include variety, e.g., different envelope parameters at different times, multiple channels (chords), stereo, etc. Write a paragraph or two that describes your compositional technique. Good compositions will be click-free.
Hints: You may wish to use a familiar melody (remember, you’ve got an equation that converts a note from the equal-tempered scale into frequency), or you may want to use a musical “experiment” based on an algorithm as the basis for your composition.
There are at least four ways to access MATLAB on at Rose-Hulman:
![]() | On your own network-connected computer
| ||||||||
![]() | On a network-connected computer
| ||||||||
![]() | On the SGI computers in the Imaging Systems Laboratory (these are presently at version 5.3, other techniques are version 6) | ||||||||
![]() | On your own stand-alone computer
|
A startup.m file is useful for automatically setting up the MATLAB search path, for changing the current working directory to something other than the default, and for any other activity you would like to perform each time MATLAB starts up. You can place any valid MATLAB code inside your startup.m file. Common activities include:
Append your own path to the system search path: path(path,’C:\mypath\matlab’);
Change working directory: cd C:\mydir
Display a message to confirm that startup.m file commands were processed (put a line such as "disp('it works!')" in your file)
A sample startup.m file is available. Please edit it to suit your needs.
Recommended methods for using a startup file:
![]() | With locally-installed MATLAB: Place startup.m file in the "work" subdirectory of the MATLAB installation directory | ||||||||
![]() | Via Terminal Server method:
| ||||||||
![]() | On Imaging Lab SGI computers:
|
|