![]() ece481 | doering | ece labs | ece | rhit |
|
![]() | All MATLAB code that you develop |
![]() | Signal spectra, MATLAB graphics |
![]() | .WAV files |
![]() | Brief write-up summarizing your results |
Develop a function that accepts an amplitude trajectory, a frequency trajectory (in Hz), and sampling frequency (in Hz) to produce a sinusoidal output whose amplitude and frequency tracks the two input trajectories, respectively.
Demonstrate that your oscillator works properly by showing the results (spectrogram and soundfile) of the following MATLAB code:
fs=5e3;
ff=[linspace(200,1600,2.5*fs) linspace(1600,800,1.5*fs)];
aa=[linspace(1,0,3*fs) linspace(0,0.75,fs)];
y=yourfun(aa,ff,fs);
calspec(y,[],fs)
Hints:
If y(t)=sin(2pq(t)), then the instantaneous frequency f(t) is dq(t)/dt.
You may find the cumsum function useful.
Design a spectrogram picture using multiple frequency/amplitude trajectories. See if you can construct a recognizable picture!
Use functions that generate curved lines (e.g., arcs, exponentials, parabolas, sinusoids) in addition to the straightline segments produced by linspace. Be creative!
Include a .WAV file of the sound associated with your spectrogram picture.
The three principal features of a bell-like sound are (1) nonharmonic partials, (2) decay times of the partials that are approximately inversely proportional to their frequencies, and (3) beating of pairs of components (e.g., slight mistuning on the lowest 2 partials).
Use additive synthesis to implement the bell sound described in Figure 1 (see handout from class). Use decaying exponentials with the “durations” indicating the time constants. Demonstrate your results by showing the spectrogram image and its associated .WAV file.
|