memory access violation error fixed
normalization of calculated signal added back