Well, you task is basically about synthesising some given sounds - this is very broad question. The function you are using: synthesize_fp.m takes the arguments you need to play with, but two most important ones are:
f
- vector of frequencies that you must specify. If you provide only one, then you will obtain sinusoid. Adding more frequencies will produce more complicated waveforms. You can refer to this site for some fundamental waveforms: Geometric Waveforms. For musical synthesis widely used is sawtooth wave, so you can start with it. Please notice that also very important are:
p
- amplitudes for each frequency you are providing. Changing them will affect your sound very much. Please notice that rectangular and sawtooth wave differ only with amplitudes of their harmonics.
Last parameter is gamma
, that defines the phase shift with respect to fundamental frequency. Personally I suggest you to set it to zeros on the beginning. This shouldn't do very much difference when you are trying to play with this synthesis task. By doing that your equation becomes simply sum of the cosines: $\cos\left(2\pi f[j]t \right)$. There is really no need to bother with phase for now.
Mostly you would want to mimic natural spectral content of the instruments. Therefore you might want to download some instrument recordings (flute/pipe organ), analyse their spectrum and feed a given harmonics with their amplitudes to your script.