Optimal design of distributed parameter filters