Aarushi’s Status Report for 4/18

I completed porting the matlab code to C++ for the phase vocoder & stft & istft files – 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.  This documentation was for communication between our team members, for later reference for myself, and for reference for any future user:

This is for IF we modify a song only once, not every minute. It’ll be easier to do that after.
 
I think the android class we need is AudioTrack (linked).
 
What you want to do is create a function as follows (i’m gonna write this in pseudo python/java/matlab/comments code sos):
def TSM(song_name, original_bpm, desired_bpm):
     ratio = desired_bpm / original_bpm
     n = 1024
     # audioread is only a matlab function. doesn’t port to C++
     # based on my google searches so far…
     # we want an analogous JAVA function that is native to androids OS like AudioTrack fns
     [original_signal, sampling_rate] = audioread(song_name) 
     # can be broken up into
     audioTrack.getSampleRate() of song_name
     # reading the song needs to output a matrix / array of the audio signal
     read song_name to signal (not sure which fn in AudioTrack does this) (this link may help)
     modified_signal = pvoc(original_signal, ratio, n)
     return (modified_signal, sampling_rate)
# calling the function
desired_BPM = 160 # equivalent to running pace
original_BPM = 140 # avg of eye of the tiger bpm got from online
playback_song, sampling_Rate = TSM(“IntroEyeoftheTiger1.wav”, original_BPM, desired_BPM)
audioTrack.play() of playback_song
So far, in actually working with integration, we may not actually be able to use AudioTrack. An idea we are tossing around is writing “audioread” 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 “audioread” from the integrated device’s OS. However, there are complicated typing and inputting signal matrices from  Java to C++ with this method as well. Both not ideal methods will need to continue to be experimented with.

(DTCWT is still a work in progress.)

Leave a Reply

Your email address will not be published. Required fields are marked *