{"id":4438,"date":"2015-04-13T01:40:15","date_gmt":"2015-04-13T05:40:15","guid":{"rendered":"http:\/\/pages.vassar.edu\/magnes\/?p=4438"},"modified":"2015-04-15T06:06:51","modified_gmt":"2015-04-15T10:06:51","slug":"audio-signal-processing-preliminary-data","status":"publish","type":"post","link":"https:\/\/pages.vassar.edu\/magnes\/2015\/04\/13\/audio-signal-processing-preliminary-data\/","title":{"rendered":"Audio Signal Processing &#8211; Preliminary Data"},"content":{"rendered":"<p>We have used Matlab\u00a0to read, write, plot, and play audio files. We begin by taking the fast fourier transforms (fft) of these audio files and manipulated the locations of the frequencies using different methods.<\/p>\n<p style=\"text-align: center\">Original Sample<\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-4438-1\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/wav\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/original.wav?_=1\" \/><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/original.wav\">http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/original.wav<\/a><\/audio>\n<p>&nbsp;<\/p>\n<p>1. <strong>changing the sample rate<\/strong><\/p>\n<p>Audio files have a given sample rate at which they are recorded, usually 44.1 kHz. If you play the audio file back at a different sample rate the pitch of the audio is changed. For example, if you play the audio at 88.2kHz the frequency of the sound is higher due to the wave function being read faster; this however also changes the length of time of the audio sample (something we want to avoid in our project).<\/p>\n<p style=\"text-align: center\">\u00a0Half the Sample Frequency<\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-4438-2\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/wav\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/f_s_half.wav?_=2\" \/><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/f_s_half.wav\">http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/f_s_half.wav<\/a><\/audio>\n<p style=\"text-align: center\">Twice the Sample Frequency<\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-4438-3\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/wav\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/f_s_twice.wav?_=3\" \/><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/f_s_twice.wav\">http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/f_s_twice.wav<\/a><\/audio>\n<p>&nbsp;<\/p>\n<p>2. <strong>upsampling\/downsampling<\/strong><\/p>\n<p>By adding samples to the array of the sound file, but playing it back at the original sampling rate, changes the pitch of the audio file when played back. This is done by either adding elements to the array every nth element (upsampling) or deleting every nth sample of the array (downsampling). Upsampling decreases the frequency and downsampling raises the frequency. This also changes the amount of time the sound file takes on playback because it changes the length of the array being read, but not the speed at which it is read.<\/p>\n<p style=\"text-align: center\"><strong><strong>\u00a0<\/strong><\/strong>Upsampling<\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-4438-4\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/wav\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/original_upsmlp.wav?_=4\" \/><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/original_upsmlp.wav\">http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/original_upsmlp.wav<\/a><\/audio>\n<p style=\"text-align: center\">Downsampling<\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-4438-5\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/wav\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/original_downsmlp.wav?_=5\" \/><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/original_downsmlp.wav\">http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/original_downsmlp.wav<\/a><\/audio>\n<p>&nbsp;<\/p>\n<p>3. <strong>phase shifting<\/strong><\/p>\n<p>When taking the fft of a wavefunction, you get an array of amplitudes, and the matrix element it the frequency of which the amplitude value is representative.\u00a0When phase shifting , the elements get shifted down or up and the elements at the end of the array are looped to the beginning.<\/p>\n<div id=\"attachment_4460\" style=\"width: 488px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/phys375_writeup2.jpg\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-4460\" class=\" wp-image-4460\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/phys375_writeup2-300x291.jpg\" alt=\"Made in Matlab\" width=\"478\" height=\"463\" srcset=\"https:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/phys375_writeup2-300x291.jpg 300w, https:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/phys375_writeup2-1024x995.jpg 1024w, https:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/phys375_writeup2-624x606.jpg 624w, https:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/phys375_writeup2.jpg 1260w\" sizes=\"auto, (max-width: 478px) 100vw, 478px\" \/><\/a><p id=\"caption-attachment-4460\" class=\"wp-caption-text\">The top two graphs show the original signal and its Fourier transform. The bottom two graphs illustrate the effect of phase shifting.<\/p><\/div>\n<p style=\"text-align: center\">\u00a0Phase Shifting<\/p>\n<audio class=\"wp-audio-shortcode\" id=\"audio-4438-6\" preload=\"none\" style=\"width: 100%;\" controls=\"controls\"><source type=\"audio\/wav\" src=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/circshift.wav?_=6\" \/><a href=\"http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/circshift.wav\">http:\/\/pages.vassar.edu\/magnes\/files\/2015\/04\/circshift.wav<\/a><\/audio>\n<p>&nbsp;<\/p>\n<p>4. <strong>finding peaks<\/strong><\/p>\n<p>If you use a peak finding function of the fft of a wavefunction, you could use those values to rebuild the signal using sinusoidal function of frequencies of the locations of the peaks. if you were to shift the values of those peaks before rebuilding the wavefunction, you could in theory create a wavefunction of a different pitch without changing the amount of time. We have yet to implement this method, but it is part of our next trials.<\/p>\n<hr \/>\n<p>Please find the Matlab\u00a0code here:<\/p>\n<p>https:\/\/drive.google.com\/a\/vassar.edu\/file\/d\/0B4quZV7NVNf7ako4RlBkeUNETXc\/view?usp=sharing<\/p>\n<p>Sound File Source:<\/p>\n<p>http:\/\/eleceng.dit.ie\/dorran\/matlab\/<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We have used Matlab\u00a0to read, write, plot, and play audio files. We begin by taking the fast fourier transforms (fft) of these audio files and manipulated the locations of the frequencies using different methods. Original Sample &nbsp; 1. changing the sample rate Audio files have a given sample rate at which they are recorded, usually [&hellip;]<\/p>\n","protected":false},"author":2547,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[62713,71651,71650],"class_list":["post-4438","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-fourier","tag-preliminary-data","tag-spring-2015"],"_links":{"self":[{"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/posts\/4438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/users\/2547"}],"replies":[{"embeddable":true,"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/comments?post=4438"}],"version-history":[{"count":6,"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/posts\/4438\/revisions"}],"predecessor-version":[{"id":4589,"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/posts\/4438\/revisions\/4589"}],"wp:attachment":[{"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/media?parent=4438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/categories?post=4438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pages.vassar.edu\/magnes\/wp-json\/wp\/v2\/tags?post=4438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}