write mat file and resp threshold to h5 file