dhrebeniuk / RosaKit

LibRosa port to Swift for ability using same prepossessing logic in iOS/MacOS platforms
MIT License
83 stars 14 forks source link

Adding istft function #3

Closed abokhalel2 closed 3 years ago

abokhalel2 commented 3 years ago

Hi, thank you for sharing this amazing project!

I have a question about the execute_real_forward function which uses pocketfft.c file

In ArrayLibRosaExtensions.swift, the function basically converts flatMatrix into resultComplexMatrix using execute_real_forward. I'm trying to reverse this process and convert the resultComplexMatrix back to flatMatrix.

Is there a way to do in this library? Any help is appreciated.

Again, thank you so much for this project

dhrebeniuk commented 3 years ago

Hello @abokhalel2 , are you wanna matrix with sepparated real and image values?

I take from NumPy, it contains pocketfft.c you can also look it.

May you describe much details, what's yours task? I will try help you

abokhalel2 commented 3 years ago

Thank you @dhrebeniuk

We use an ML Model that process audio files in our iOS application. The ML Model, however, does not accept the audio file directly. In order for the ML Model to accept the audio file, we have to process it using stft function.

So, our application used your library to do this process, and it is woking great. However, once the ML Model finishes processing the file, we need to reverse the process in order to be able to save the file. we need something like istft function.

I started reversing this process, and I was not able to reverse execute_real_forward. I would love for this library to have something like istft function or a way to reverse execute_real_forward. I don't have unfortunately much experience in c language.

By the way, I would love to contribute to your work if you have something like https://www.buymeacoffee.com/

dhrebeniuk commented 3 years ago

@abokhalel2 , Oh I understand you. I planned port istft also to library from librosa. But I'm not allocated time for this this yet :( .

abokhalel2 commented 3 years ago

@dhrebeniuk, No problem. Looking forward for the future update.

dhrebeniuk commented 3 years ago

@abokhalel2 , I'm thinking ticket should still open as reminder for me.

dhrebeniuk commented 3 years ago

@abokhalel2 , I also find this article: http://www.ml-illustrated.com/2020/06/01/deploy-pytorch-model-with-coreml-convert-issues.html

Maybe it's can also help.

abokhalel2 commented 3 years ago

@dhrebeniuk Thank you for sharing the link. I will check it out

abokhalel2 commented 3 years ago

@dhrebeniuk I still wasn't able to deploy istft function to swift or coreml. I will be waiting for your next release.

dhrebeniuk commented 3 years ago

@abokhalel2 , in master available istft, it's not finished yet, need finish least functionality. But you can try experiment with it.

dhrebeniuk commented 3 years ago

Release in version 0.0.3