How to solve error using matlab function CFIRPM with function handle?
Mostrar comentarios más antiguos
I want to find FIR filter with the best approximation to the desired frequency response, for that i choose to use the function handle
%the function
function [dh,dw]=fresp(n,f,gf,w)
c = exp(-1i*pi*gf*n/2 );
[dh,dw]=freqz(c);
end
%example to apply function handle (fun_han_cfirpm.m)
n = 22; % Filter order
f = [-1 1]; % Frequency band edges
w = [1 1]; % Weights for optimization
gf = linspace(-1,1,256);
b = cfirpm(n,f,@fresp);
fvtool(b);
The error found
> In crmz (line 112)
In cfirpm (line 336)
In fun_han_cfirpm (line 7)
Warning: Matrix is singular to working precision.
> In crmz (line 112)
In cfirpm (line 336)
In fun_han_cfirpm (line 7)
Warning: Matrix is singular to working precision.
Error using fun_han_cfirpm (line 8)
Coefficients must be finite.
What is the cause of the error?
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Digital Filter Design en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!