Can you please help me with some ideas on how to implement an FIR filter in Matlab using Parks-Mclellan algorithm?
My specifications are the passband cut-off frequency, the transition bandwidth. The I also have the passband ripple, which is an alternating value $ \delta_p=\pm0.2$ and the stopband ripple $\delta_s$. This because the weigth in the stopband frequency range comes from: $ \rho(\omega)=\delta_p/\delta_s$. The design using firpm should meet these specifications.
I have two troubles: The first one is that I have to find the optimal minimum order of the filter N to get the desired design without using any Matlab builtin function (I saw there is one called firpmord, but again I can't use it), so I imagine I need some kind of iteration but don't know how to put this in code. Also can't find a way to account for the alternating ripple to use it in my calculations. I'm just looking for some advice on how to achieve this.
I'm just starting, trying to catch it:
dp=0.2; % this should be plus minus
h=firpm(N,[0 wp w_tr w_stop],[Gp Gp 0 0],[1,dp/ds])