The method presented enables the design digital FIR filters satisfying specific frequency characteristics with auxiliary constraints. Such filters make it possible to estimate in realtime the parameters of fundamental current and voltage waveforms encountered in electrical power systems. The problem of design is converted to an optimisation problem with constraints using the standard least-squares criterion. The minimisation problem using the Lagrange multiplier method is mapped to a simpler problem of solving a set of linear equations. Using this method we optimise the selection of algorithms for particular applications.