{"id":86,"date":"2019-09-30T18:41:22","date_gmt":"2019-09-30T18:41:22","guid":{"rendered":"https:\/\/synthnotes.ucsd.edu\/wp7\/?p=86"},"modified":"2020-08-18T21:44:38","modified_gmt":"2020-08-18T21:44:38","slug":"oscillators-introduction","status":"publish","type":"post","link":"https:\/\/synthnotes.ucsd.edu\/wp7\/index.php\/2019\/09\/30\/oscillators-introduction\/","title":{"rendered":"Oscillators: Introduction"},"content":{"rendered":"<h1>Oscillators<\/h1>\n<hr \/>\n<p>The most basic sound-generating process in digital sound is the oscillator. An oscillator creates a periodic waveform of some shape (sine, square, saw, triangle, etc) and repeats it in time. The number of times it repeats per second is its fundamental frequency. This is measured in units of Hertz (Hz) or cycles per second. The reciprocal of frequency is the period, or the number of seconds per cycle.<\/p>\n<h2>As a concept<\/h2>\n<hr \/>\n<h3>Unit Circle<\/h3>\n<p>It is helpful to visualize a sine oscillator as a wheel and spoke.<\/p>\n<p><a href=\"https:\/\/synthnotes.ucsd.edu\/wp7\/wp-content\/uploads\/2019\/09\/Unfasor.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-87 size-full\" src=\"https:\/\/synthnotes.ucsd.edu\/wp7\/wp-content\/uploads\/2019\/09\/Unfasor.gif\" alt=\"Unfasor\" width=\"219\" height=\"432\" \/><\/a><\/p>\n<p>The angle of the &#8220;spoke&#8221; is the phase at a given moment in time while the frequency are the number of rotations per second. The length (magnitude) of the spoke is the amplitude at any given point.<\/p>\n<h3>Phase<\/h3>\n<p>The phase of a waveform, often denoted with the Greek letter phi (\u03a6), is a means to define a specifc point on a waveform. Phase change is measured on a unit circle, that is, a circle with a radius of 1.0. As the circumference of the circle is 2\u03c0r, one rotation has 2\u03c0 of phase. The unit used to measure phase is the radian.<\/p>\n<h3>Sampled Signals<\/h3>\n<p>When programming digital audio, we will be working primarily with sampled waveforms. A waveform is generated by calculating samples at a certain (and usually a fixed) rate. This is the sample rate (seconds per sample).<\/p>\n<p>To convert time to a number of samples, simply multiply the time in seconds by the sample rate. For instance: an oscillator at 200 Hz has a period of 1\/200 (or .005) seconds. To find the number of samples for this period with a sample rate of 44100; multiply 44100 * .005. The answer is 220.5 samples.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Oscillators The most basic sound-generating process in digital sound is the oscillator. An oscillator creates a periodic waveform of some shape (sine, square, saw, triangle, etc) and repeats it in time. The number of times it repeats per second is its fundamental frequency. This is measured in units of Hertz (Hz) or cycles per second. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-86","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/synthnotes.ucsd.edu\/wp7\/index.php\/wp-json\/wp\/v2\/posts\/86","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/synthnotes.ucsd.edu\/wp7\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/synthnotes.ucsd.edu\/wp7\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/synthnotes.ucsd.edu\/wp7\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/synthnotes.ucsd.edu\/wp7\/index.php\/wp-json\/wp\/v2\/comments?post=86"}],"version-history":[{"count":2,"href":"https:\/\/synthnotes.ucsd.edu\/wp7\/index.php\/wp-json\/wp\/v2\/posts\/86\/revisions"}],"predecessor-version":[{"id":564,"href":"https:\/\/synthnotes.ucsd.edu\/wp7\/index.php\/wp-json\/wp\/v2\/posts\/86\/revisions\/564"}],"wp:attachment":[{"href":"https:\/\/synthnotes.ucsd.edu\/wp7\/index.php\/wp-json\/wp\/v2\/media?parent=86"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/synthnotes.ucsd.edu\/wp7\/index.php\/wp-json\/wp\/v2\/categories?post=86"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/synthnotes.ucsd.edu\/wp7\/index.php\/wp-json\/wp\/v2\/tags?post=86"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}