# Create Sinusoids

### Description

Create and display one or more sinusoids.

### Usage

1 2 3 |

### Arguments

`freqs` |
A vector of frequencies, one for each desired sinusoid. |

`amps` |
A vector of peak amplitudes, one for each desired sinusoid. |

`dur` |
The desired duration of the sinusoids, in milliseconds. |

`phases` |
A vector of initial phases, one for each desired sinusoid, expressed in radians. |

`fs` |
The desired sampling frequency of the sinusoids. |

`sum` |
If TRUE, the sum the generated sinusoids is also found. |

`show` |
If TRUE, the generated sinusoids are plotted. If sum is TRUE, a second plot is created to display the sum of the sinusoids. |

`colors` |
An optional vector of colors used to plot the individual sinusoids. If the number of colors given is less than the number of frequencies specified, the colors are repeated. |

### Details

A number of sinusoids are generated, and optionally plotted and/or returned. The number of frequencies specified must equal the number of amplitudes and initial phases.

### Value

A dataframe with the following columns:

`time` |
The time, in milliseconds, at which is sample is taken. |

`waveN` |
A series of columns, each indicating the amplitude of wave N at a given time. |

`sum` |
A column indicating the sum of all of the sinusoids. |

### Author(s)

Santiago Barreda <sbarreda@ucdavis.edu>

### Examples

1 2 3 4 5 6 7 |