{"id":26036,"date":"2019-02-27T22:34:38","date_gmt":"2019-02-28T06:34:38","guid":{"rendered":"https:\/\/blog.digilentinc.com\/?p=26036"},"modified":"2021-06-09T13:25:41","modified_gmt":"2021-06-09T20:25:41","slug":"capturing-and-analyzing-live-audio","status":"publish","type":"post","link":"https:\/\/digilent.com\/blog\/capturing-and-analyzing-live-audio\/","title":{"rendered":"Capturing and Analyzing Live Audio"},"content":{"rendered":"<p>If you are familiar with the new WaveForms Asset Store, you may have seen<a href=\"https:\/\/testandmeasure.org\/#\/category\/scripts\/pmod-mic3-audio-streaming-recording-125baaaf\"> the recent addition involving the Pmod MIC3 and WaveForms.<\/a> This fully-downloadable script streams live audio data from the <a href=\"https:\/\/digilent.com\/shop\/pmod-mic3-mems-microphone-with-adjustable-gain\/\">Pmod MIC3<\/a> and displays it through the WaveForms oscilloscope function. It presents the data as a waveform in the time domain and as a FFT.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-26037\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/freq_sweep-600x296.gif\" alt=\"\" width=\"600\" height=\"296\" data-wp-pid=\"26037\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/freq_sweep-600x296.gif 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/freq_sweep-768x379.gif 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/freq_sweep-1024x505.gif 1024w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/freq_sweep-800x395.gif 800w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><\/p>\n<p>The download also includes a script that performs a 1.25 second recording, providing higher-resolution data. <a href=\"https:\/\/testandmeasure.org\/#\/category\/scripts\/pmod-mic3-audio-streaming-recording-125baaaf\">The official Asset Store page<\/a>\u00a0explains in further detail how exactly the script is accomplishing all of this:<\/p>\n<blockquote><p>&#8220;This script utilizes the pattern generator to produce the clock and chip select signals required for SPI communication with the MIC3. The MIC3 transmits 16-bits of data, of which the 12 least-significant are the audio data. Samples are taken by the logic analyzer every 500 milliseconds (or once, over a period of 1.25 seconds), which is pushed into an array that is displayed in the oscilloscope window as a reference channel. In the oscilloscope window, the data is displayed in the time domain and frequency domain.&#8221;<\/p><\/blockquote>\n<p>All you need for this project is a <a href=\"https:\/\/digilent.com\/shop\/pmod-mic3-mems-microphone-with-adjustable-gain\/\">Pmod MIC3<\/a> (and preferably a breadboard for convenience).<\/p>\n<figure id=\"attachment_26038\" aria-describedby=\"caption-attachment-26038\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-26038 size-medium\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/demo-600x550.png\" alt=\"\" width=\"600\" height=\"550\" data-wp-pid=\"26038\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/demo-600x550.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/demo-768x704.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/demo-800x734.png 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/demo.png 978w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption id=\"caption-attachment-26038\" class=\"wp-caption-text\">Diagram of the setup.<\/figcaption><\/figure>\n<p>This demonstration opens up the possibility for a wealth of audio projects because you can capture the audio live, and then analyze it with the powerful<a href=\"https:\/\/digilent.com\/shop\/waveforms-previously-waveforms-2015\/\"> WaveForms software.\u00a0<\/a> You can even use this project along with other hardware actuators or displays (like a\u00a0DIY music visualizer using LED strips)!<\/p>\n<p>Though the demonstration above is primarily focused on sending data from the microphone sensor to WaveForms, you can also send data to a microcontroller <em>with<\/em> WaveForms, which allows the freedom to attach additional hardware on the other side of the system. If you are interested in learning more about how to send data from WaveForms to Arduino, make sure to\u00a0<a href=\"https:\/\/forum.digilent.com\/topic\/15907-how-to-send-signal-to-arduino-with-analog-discovery-2\/#comment-38781\">check out this write up<\/a> from a question answered on the <a href=\"https:\/\/forum.digilent.com\/\">Forum.<\/a><\/p>\n<figure id=\"attachment_26040\" aria-describedby=\"caption-attachment-26040\" style=\"width: 600px\" class=\"wp-caption aligncenter\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-26040 size-medium\" src=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/s-600x478.png\" alt=\"\" width=\"600\" height=\"478\" data-wp-pid=\"26040\" srcset=\"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/s-600x478.png 600w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/s-768x612.png 768w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/s-800x638.png 800w, https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/s.png 941w\" sizes=\"auto, (max-width: 600px) 100vw, 600px\" \/><figcaption id=\"caption-attachment-26040\" class=\"wp-caption-text\">Image of WaveForms workspace set up to pass data to an Arduino Uno. See write up link above for more details.<\/figcaption><\/figure>\n<p>Make sure to let us know what you create, and if you have a cool audio project to share, make sure to link it in the comments below!<\/p>\n<div class='watch-action'><div class='watch-position align-left'><div class='action-like'><a class='lbg-style6 like-26036 jlk' data-task='like' data-post_id='26036' data-nonce='d8c4d58d14' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Like' \/><span class='lc-26036 lc'>0<\/span><\/a><\/div><div class='action-unlike'><a class='unlbg-style6 unlike-26036 jlk' data-task='unlike' data-post_id='26036' data-nonce='d8c4d58d14' rel='nofollow'><img src='https:\/\/digilent.com\/blog\/wp-content\/plugins\/wti-like-post-pro\/images\/pixel.gif' title='Unlike' \/><span class='unlc-26036 unlc'>0<\/span><\/a><\/div><\/div> <div class='status-26036 status align-left'>Be the 1st to vote.<\/div><\/div><div class='wti-clear'><\/div>","protected":false},"excerpt":{"rendered":"<p>Learn how to capture live audio and intelligently analyze it using WaveForms and the Pmod MIC3.<\/p>\n","protected":false},"author":36,"featured_media":26039,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[38,4327,4312],"tags":[452],"ppma_author":[4485],"class_list":["post-26036","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-expansion-modules","category-projects","category-usb-scopes-analyzers-generators","tag-waveforms"],"jetpack_featured_media_url":"https:\/\/digilent.com\/blog\/wp-content\/uploads\/2018\/11\/1.png","jetpack_sharing_enabled":true,"authors":[{"term_id":4485,"user_id":36,"is_guest":0,"slug":"mirandamay7","display_name":"Miranda Hansen","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/bcab037c32924b9f9b3ca4898e179f2764cb7d9a82aa2bd475170c8aaa884e1c?s=96&d=mm&r=g","1":"","2":"","3":"","4":"","5":"","6":"","7":"","8":"","9":"","10":""}],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/26036","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/users\/36"}],"replies":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/comments?post=26036"}],"version-history":[{"count":0,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/posts\/26036\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media\/26039"}],"wp:attachment":[{"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/media?parent=26036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/categories?post=26036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/tags?post=26036"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/digilent.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=26036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}