Changes of twisted nematic liquid-crystal layers by frequency switching of applied electric fields