Calculating Gain and Phase from Transfer Functions