0
$\begingroup$

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

https://gist.github.com/mattdsp/17f508d2b368db61f47689e4622d8841/c1518f22a5aa451951601b56c5d9f72743868bfe

%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)?

$\endgroup$
6
  • $\begingroup$ 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. $\endgroup$
    – Matt L.
    Jul 17, 2018 at 18:12
  • $\begingroup$ @ 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)]. $\endgroup$
    – K.n90
    Jul 17, 2018 at 18:27
  • 1
    $\begingroup$ 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? $\endgroup$
    – Matt L.
    Jul 17, 2018 at 18:37
  • $\begingroup$ @ 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 ? $\endgroup$
    – K.n90
    Jul 17, 2018 at 20:00
  • $\begingroup$ So the only thing you change between designs is the number of grid points? Same specs, same filter lengths? $\endgroup$
    – Matt L.
    Jul 17, 2018 at 20:02

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.