ece481 | doering | ece labs | ece | rhit |
“Analog Synthesis” Using MATLABOverviewThis project will give you the opportunity to begin designing sounds in MATLAB. The project parts are laid out to give you some structure, but please feel free to expand upon the ideas. Append all MATLAB code that you develop. Place all generated sounds in WAV format (see wavwrite) in your AFS public directory and indicate where I can find them. Deliverables
Part 1 - Signal SourcesImplement 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. Part 2 - Envelope GeneratorsImplement 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. Part 3 - CompositionCompose 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. Running MATLABThere are at least four ways to access MATLAB on at Rose-Hulman:
MATLAB Startup FileA 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:
A sample startup.m file is available. Please edit it to suit your needs. Recommended methods for using a startup file:
|
|