Constrained Least Square FIR Filter Design - Example

The Matlab commands below produce the filter illustrated in the figure. The Matlab programs can be down loaded from the previous page.

Go back to previous page.

        n = 61;                 % impulse response length
        wo = 0.3*pi;            % cut-off frequency
        dp = 0.02;              % passband ripple size
        ds = 0.02;              % stopband ripple size
        up = [1+dp, ds];        % upper constraint function
        lo = [1-dp, -ds];       % lower constraint function
        [h,wp,ws,L2E,mL2,it,cs] = cl2lpr(n,wo,up,lo);