Dielectric losses in ferroelectric ceramics produced by domain-wall motion