Framework And Algorithms For Wearable Medical Applications