What are the uses of ripples in the filter design. We try to design a filter with least ripples but sometimes we design a filter to have 2 or 3 ripples. Why is it so?
There is usually a trade-off between filter length or delay, transition bandwidth, and ripple. Sometimes to get a filter with a sharper cut-off, the only alternatives include designs (via FIR optimization or IIR pole zero placement) that have (greater) ripples in the stop band or pass band.
Ripples are usually an undesired side effect. E.g., when designing a frequency selective filter you normally want a piecewise constant magnitude of the frequency response, but this is physically impossible.
Certain design criteria result in filters without ripples, such as the Butterworth criterion, which results in filters with a maximally flat response.