added mangitude and max frequency peak finding at 1000Hz