Nondestructive resonant technique for the measurement of complex permittivity, theoretical analysis and experimental results