{"id":127,"date":"2020-04-20T03:42:30","date_gmt":"2020-04-20T03:42:30","guid":{"rendered":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame4\/?p=127"},"modified":"2020-04-20T04:06:07","modified_gmt":"2020-04-20T04:06:07","slug":"aarushis-status-report-for-4-18","status":"publish","type":"post","link":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame4\/2020\/04\/20\/aarushis-status-report-for-4-18\/","title":{"rendered":"Aarushi&#8217;s Status Report for 4\/18"},"content":{"rendered":"<p>I completed porting the matlab code to C++ for the phase vocoder &amp; stft &amp; istft files &#8211; I had to refactor parts of the original matlab code and variable types for this conversion to be compile successful. I also created documentation for how the C++ files should be integrated \/ used.\u00a0 This documentation was for communication between our team members, for later reference for myself, and for reference for any future user:<\/p>\n<div><span style=\"font-family: arial, sans-serif\"><b>This is for IF we modify a song only once, not every minute.\u00a0<\/b>It&#8217;ll be easier to do that after.<\/span><\/div>\n<div><span style=\"font-family: arial, sans-serif\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: arial, sans-serif\">I think the android class we need is\u00a0<b>AudioTrack<\/b>\u00a0(<a href=\"https:\/\/developer.android.com\/reference\/android\/media\/AudioTrack\" target=\"_blank\" rel=\"noopener\">linked<\/a>).<br \/>\n<\/span><\/div>\n<div><span style=\"font-family: arial, sans-serif\">\u00a0<\/span><\/div>\n<div><span style=\"font-family: arial, sans-serif\">What you want to do is create a function as follows (i&#8217;m gonna write this in pseudo python\/<span style=\"color: #38761d\">java<\/span>\/<span style=\"color: #0b5394\">matlab\/<\/span><span style=\"color: #ff0000\">comments<\/span>\u00a0code sos):<\/span><\/div>\n<div><\/div>\n<div>def TSM(song_name,\u00a0original_bpm,\u00a0desired_bpm):<\/div>\n<div>\u00a0 \u00a0 \u00a0ratio =\u00a0desired_bpm \/\u00a0original_bpm<\/div>\n<div>\u00a0 \u00a0 \u00a0n = 1024<\/div>\n<div><\/div>\n<div><span style=\"color: #ff0000\">\u00a0 \u00a0 \u00a0# audioread is only a matlab function. doesn&#8217;t port to C++<\/span><\/div>\n<div><span style=\"color: #ff0000\">\u00a0 \u00a0 \u00a0# based on my google searches so far&#8230;<\/span><\/div>\n<div><span style=\"color: #ff0000\">\u00a0 \u00a0 \u00a0# we want an analogous JAVA function that is native to androids OS like AudioTrack fns<\/span><\/div>\n<div>\u00a0 \u00a0 \u00a0<span style=\"color: #3d85c6\">[original_signal, sampling_rate] = audioread(song_name)\u00a0<\/span><\/div>\n<div><span style=\"color: #ff0000\">\u00a0 \u00a0 \u00a0# can be broken\u00a0up into<\/span><\/div>\n<div><span style=\"color: #38761d\">\u00a0 \u00a0 \u00a0audioTrack.getSampleRate() of song_name<\/span><\/div>\n<div>\n<div><span style=\"color: #ff0000\">\u00a0 \u00a0 \u00a0# reading the song needs to output a matrix \/ array of the audio signal<\/span><\/div>\n<div><\/div>\n<\/div>\n<div><span style=\"color: #38761d\">\u00a0 \u00a0 \u00a0read song_name to signal\u00a0<\/span>(not sure\u00a0which\u00a0fn in AudioTrack does this) (this\u00a0<a href=\"https:\/\/github.com\/teco-kit\/Android-Context-Framework\/blob\/master\/src\/edu\/teco\/context\/probe\/audio\/AudioReader.java\" target=\"_blank\" rel=\"noopener\">link<\/a>\u00a0<i>may<\/i>\u00a0help)<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0modified_signal = pvoc(original_signal, ratio, n)<\/div>\n<div><\/div>\n<div>\u00a0 \u00a0 \u00a0return (modified_signal, sampling_rate)<\/div>\n<div><\/div>\n<div><\/div>\n<div><span style=\"color: #ff0000\"># calling the function<\/span><\/div>\n<div>desired_BPM = 160\u00a0<span style=\"color: #ff0000\"># equivalent to running pace<\/span><\/div>\n<div>original_BPM = 140\u00a0<span style=\"color: #ff0000\"># avg of eye of the tiger bpm got from online<\/span><\/div>\n<div>playback_song, sampling_Rate = TSM(&#8220;IntroEyeoftheTiger1.wav&#8221;, original_BPM, desired_BPM)<\/div>\n<div>\n<div><span style=\"color: #38761d\">audioTrack.play() of playback_song<\/span><\/div>\n<\/div>\n<div><\/div>\n<div><\/div>\n<div><\/div>\n<div>So far, in actually working with integration, we may not actually be able to use AudioTrack. An idea we are tossing around is writing &#8220;audioread&#8221; in C++. I am skeptical about this because matlab Coder creates C++ files for all matlab built in functions. Coder does not do this for audioread, however. This being a missing basic functionality of Coder leads me to believe that what we are searching for is NOT a basic functionality. Which is why, blog posts I have read suggest performing &#8220;audioread&#8221; from the integrated device&#8217;s OS. However, there are complicated typing and inputting signal matrices from\u00a0 Java to C++ with this method as well. Both not ideal methods will need to continue to be experimented with.<\/div>\n<div><\/div>\n<p>(DTCWT is still a work in progress.)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I completed porting the matlab code to C++ for the phase vocoder &amp; stft &amp; istft files &#8211; I had to refactor parts of the original matlab code and variable types for this conversion to be compile successful. I also created documentation for how the C++ files should be integrated \/ used.\u00a0 This documentation was &hellip; <\/p>\n<p class=\"link-more\"><a href=\"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame4\/2020\/04\/20\/aarushis-status-report-for-4-18\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Aarushi&#8217;s Status Report for 4\/18&#8221;<\/span><\/a><\/p>\n","protected":false},"author":291,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[6],"tags":[],"_links":{"self":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame4\/wp-json\/wp\/v2\/posts\/127"}],"collection":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame4\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame4\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame4\/wp-json\/wp\/v2\/users\/291"}],"replies":[{"embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame4\/wp-json\/wp\/v2\/comments?post=127"}],"version-history":[{"count":4,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame4\/wp-json\/wp\/v2\/posts\/127\/revisions"}],"predecessor-version":[{"id":136,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame4\/wp-json\/wp\/v2\/posts\/127\/revisions\/136"}],"wp:attachment":[{"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame4\/wp-json\/wp\/v2\/media?parent=127"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame4\/wp-json\/wp\/v2\/categories?post=127"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/course.ece.cmu.edu\/~ece500\/projects\/s20-teame4\/wp-json\/wp\/v2\/tags?post=127"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}