Origin of linear and nonlinear giant magnetoimpedance