DEPARTMENT OF COMPUTING

CS 3005: Programming in C++

Reverse Sawtooth

Introduction

The reverse sawtooth waveform is similar to the sawtooth. However, it is generated by starting at maximum amplitude, ramping down to minimum amplitude and then jumping back to maximum amplitude.

The formula for the reverse sawtooth is

amplitude = 1.0 - (2.0 * j) / (cycle_size - 1)

Task

In this task, you will add the reverse sawtooth pattern to the options to fill in audio track data. The results should be available in the audio track creator and wav file creator programs.

An interaction with audio track creator may look like this:

$ ./program-audio-track-creator/audio_track_creator 
Samples/Second: 10
Seconds: 1
Fill style: reverse-sawtooth
Frequency: 2

sample_number,amplitude
0,1
1,0.5
2,0
3,-0.5
4,-1
5,1
6,0.5
7,0
8,-0.5
9,-1

Programming Requirements

Update library-commands/audio_track_creator_aux.{h,cpp}

Functions:

Additional Documentation

Grading Instructions

To receive credit for this assignment:

Last Updated 02/04/2025