Method of the parameters optimization for terahertz anisotropic layered filter