Skip to content

Instantly share code, notes, and snippets.

@marcusmueller
Last active August 29, 2015 14:13
Show Gist options
  • Save marcusmueller/26f84192bd975d563e3e to your computer and use it in GitHub Desktop.
Save marcusmueller/26f84192bd975d563e3e to your computer and use it in GitHub Desktop.
Answers

The total sine table has a length of wave_table_len, which means that the original sine that is saved in that table has a period of wave_table_len samples.

Now, taking every single one of these samples, step=1, means that the resulting sine has a period of wave_table_len, too.

Now, we know that a single sample has a duration of 1.0/f_sample; thus, the generated sine has the real-world time period of wave_table_len/f_sample; it's frequency is the inverse, f_sample/wave_table_len.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment