calculate relative error of two signals I'm new to dsp.stackexchange and digital signal processing. I'm required to develop an app to measure the similarity of two signals.for an example I need to compare breathing of a man whether it is abnormal or normal. I have recorded two breathing signals.

Relative error of two signals

I have compared two signals and obtained correlation of two signal. It gives crazy result (because I'm using Android phone it might contain noise). I would like to calculate the  relative error of two signals. In the above link there is an answer on how to get the relative error. But I can't understand the formula. I have two double arrays containing values after doing FFT. I'm stuck at applying above formula. How can I go through this?
So from the other post your error is:

$$
ERR = \sum \left | G_1(n) - G_2(n) \right|^2
$$

To calculate this should be quite simple. Do an element wise subtraction to get the difference between the two frequency responses at each point. Then square each element (magnitude squared if you have any imaginary components for some reason). Then sum over all the elements to get the total difference/error.

As mentioned in the other post you probably want to normalise this by the reference signal to make detecting abnormality easier.

Similarly you could just take the absolute difference rather than squaring. Squaring is more conventional though as it emphasises big differences more and is related to the variance.