Regarding 2), if you are ok to use Matlab I can help you out.
I understand that you can do the 2) by MATLAB. Probably MATLAB(non-free) is quite similar to the Python (free)
Although I have used MALAB for many years in 90's, recently many use Python.
Please reply to jk90029@yahoo,com for future precise explanation,