Professional Documents
Culture Documents
Creating and Using A Wavetable in MATLAB
Creating and Using A Wavetable in MATLAB
1 0.0490676743274180
2 0.098017140329561
3 0.146730474455362
…
128 -2.449293598294706e-
16
wavetable
The Assignment
Your assignment is to write the following MATLAB functions:
[table, N] = wavetable(f, r), which generates a wavetable called table that contains one cycle
of a sinusoidal waveform of frequency f with a sampling rate of r. The number of samples
in the table, N, is also returned.
[ i, waveform ] = makeSoundWithWavetable( table, r, freqDesired, s) sends in a wavetable table,
its sampling rate r, the desired frequency of a sound to generate freqDesired, and the desired
length of the sound in seconds s. The function plays the sound of the desired waveform within
the function and sends back the vector of values in waveform and the increment used to get these
values i. Use the simple interpolation method explained above. Have your function plot one
cycle of waveform.