The grid frequencies In the design of a digital filter

I want to find many difference 'h' with same group delay and length filter using this code :

%desired filter length
N = 51;
f = [linspace(-1,-.18,164),linspace(-.1,.3,80),linspace(.38,1,124)];
%frequency grid
d = [zeros(1,164),ones(1,80),zeros(1,124)].*exp(-1i*pi*f*(N-1)/2);
%desired frequency response
w = [10*ones(1,164),ones(1,80),10*ones(1,124)];
A = w(:,ones(1,N)) .* exp(-1i*pi*f*(0:N-1) );
h = A \ (w.*d);


I'm trying to change the grid frequency ,but I find a problem to achieve an optimal filter,i read many articles about 'grid frequency' like https://ieeexplore.ieee.org/document/9919/ , 'Typically, the number of grid points Ng is chosen to be 8 or 16 times the filter length N',in other article use 2N,4N...

Is There constant rule for chosen the frequency grid in passband and stopband in this case?

Is there any other way to finding a set of (h)?

• What do you mean by "I find a problem to achieve an optimal filter"? The filter is always optimal on the grid. And as long as you chose the grid density sufficiently large, the design will be close to optimal on the continuous domain. And as you wrote in your question, around 8 to 16 times the filter length should be fine. Jul 17, 2018 at 18:12
• @ Matt L: I know the filter is always optimal on the grid, but i try to find a method changed the grid frequency and respect the optimal design, to collect a set of optimal design in this vector [h(0) h(1)...h(N-1)]. Jul 17, 2018 at 18:27
• I'm sorry, but I think I don't understand what you're trying to do, other than that you want to design a whole set of filters. Could you try to edit your question to clarify? Do you want to satisfy the same specs (cut-off, group delay) with filters of different lengths? Jul 17, 2018 at 18:37
• @ Matt L: I want to satisfy the same specs cut-off, group delay, filter length with different grid frequency, is it a good idea to satisfy optimal or approach to optimal design ? Jul 17, 2018 at 20:00
• So the only thing you change between designs is the number of grid points? Same specs, same filter lengths? Jul 17, 2018 at 20:02