{"id":2504,"date":"2022-04-21T19:06:07","date_gmt":"2022-04-21T23:06:07","guid":{"rendered":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/?p=2504"},"modified":"2022-04-21T19:24:25","modified_gmt":"2022-04-21T23:24:25","slug":"footprintid-and-mapping-frequencies-in-matlab-from-audio-files","status":"publish","type":"post","link":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/?p=2504","title":{"rendered":"FootprintID and Mapping Frequencies in Matlab from Audio Files"},"content":{"rendered":"<p>In one of my other courses (Foundations of Intelligent Infrastructure), we went through an exercise today where we recorded sound and then used Matlab to map frequencies.<\/p>\n<p>My group measured the sound of different shoes stomping on the concrete hall in Porter. Graphs showing frequency and sound below.<\/p>\n<p><img loading=\"lazy\" class=\"alignnone size-medium wp-image-2532\" src=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/220412_Bootheelonconcfloor_time-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/220412_Bootheelonconcfloor_time-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/220412_Bootheelonconcfloor_time-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/220412_Bootheelonconcfloor_time-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/220412_Bootheelonconcfloor_time.jpg 1120w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/> <img loading=\"lazy\" class=\"alignnone size-medium wp-image-2533\" src=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/220412_Bootheelonconcfloor-300x225.jpg\" alt=\"\" width=\"300\" height=\"225\" srcset=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/220412_Bootheelonconcfloor-300x225.jpg 300w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/220412_Bootheelonconcfloor-1024x768.jpg 1024w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/220412_Bootheelonconcfloor-768x576.jpg 768w, https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/wp-content\/uploads\/2022\/04\/220412_Bootheelonconcfloor.jpg 1120w\" sizes=\"(max-width: 300px) 85vw, 300px\" \/><\/p>\n<p>Our experiment reminded the professor of a project at CMU where floor sensors are used to measure movement across spaces. The specific application discussed is in elder care, but also may be a way to provide less invasive monitoring of spaces.<\/p>\n<p>https:\/\/www.cmu.edu\/piper\/news\/archives\/2017\/february\/noh-wins-NSF-award.html<\/p>\n<p>https:\/\/www.andrew.cmu.edu\/user\/shijiapa\/documentations\/Pan_Ubicomp_2017.pdf<\/p>\n<p>&nbsp;<\/p>\n<p>Matlab code (note: need to drop sound file into the same folder as the Matlab file):<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">%%\r\nclear all; clc;\r\n\r\n% Load signal in the time domain, x (fs is the sample rate in hertz)\r\n[x,fs] = audioread('takeone.m4a');\r\ntb = (0:1\/fs:(length(x)-1)\/fs); % Convert samples, k, to time base, t\r\nplot(tb,x)\r\nxlabel('Time (seconds)')\r\nylabel('Amplitude')\r\ntitle('Sound')\r\n\r\n%% \r\n% Play the sound\r\nsound(x,fs)\r\n\r\n%%\r\n% Use the fft command to compute the DFT of the signal. \r\nm = length(x);         % Window length, N\r\ny = fft(x,m);          % DFT of signal\r\nf = (0:m-1)*(fs\/m);    % Frequency range\r\np = y.*conj(y)\/m;      % Power of the DFT\r\n\r\n% Plot up to the Nyquist frequency:\r\nplot(f(1:floor(m\/2)),p(1:floor(m\/2)))\r\nxlabel('Frequency (Hz)')\r\nylabel('Power')\r\ntitle('Five Shoe Stomps on Concrete Floor')\r\ngrid on;\r\nxlim([0 1000])        % Zoom in on relevant range\r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In one of my other courses (Foundations of Intelligent Infrastructure), we went through an exercise today where we recorded sound and then used Matlab to map frequencies. My group measured the sound of different shoes stomping on the concrete hall in Porter. Graphs showing frequency and sound below. Our experiment reminded the professor of a &hellip; <a href=\"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/?p=2504\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;FootprintID and Mapping Frequencies in Matlab from Audio Files&#8221;<\/span><\/a><\/p>\n","protected":false},"author":28,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[4],"tags":[],"_links":{"self":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/posts\/2504"}],"collection":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/users\/28"}],"replies":[{"embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2504"}],"version-history":[{"count":6,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/posts\/2504\/revisions"}],"predecessor-version":[{"id":2538,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=\/wp\/v2\/posts\/2504\/revisions\/2538"}],"wp:attachment":[{"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/courses.ideate.cmu.edu\/48-339\/s2022\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}