Separated data processing to its own function

Processed data is now stored as a .mat reducess the need to reprocess
data for code changes that affect formating.