I have two time domain signals, e.g.:
What is the correct procedure for calculating the residual of these two signals? The current code I am using is below, where I am simply subtracting the two signals to get the residual signal. I am not sure if the residual is correct and whether the affect of phase difference is taken into account in this calculation.
clear all ;
legend ('y1', 'y2', 'residual')
Furthermore, the residual signal should be of smaller amplitude then the parent signals, isnt it so? I realise that can be achived by simply adding the signals instead of subtracting(y3= y1+y2 gives the figure below) them but is that the correct way?