  One of the widely used denoising methods in different domains is the
Savitzky-Golay (SG) filter. The SG filter has two design parameters: window
length and the filter order. As the length of the window increases, the
estimation variance decreases, but the bias error increases at the same time.
Mean square error (MSE) measure includes both bias and variance criteria. In
this paper, we obtain the optimal window length of an SG filter with arbitrary
order which minimizes the MSE. To achieve the optimal window length, we propose
an algorithm whose performance is better than the existing methods. In this
paper, we follow the viewpoint proposed by Persson and Strang and design the
filter on the basis of Chebyshev orthogonal polynomials
