Scaling of Filter Coefficients in “fir1” function
Hello Everyone,
I had a quick question.
I was looking through the "fir1" function’s implementation to see how the coeffs are being scaled. I came across this function:
function b = scalefilter(b,First_Band,ff,L)
%SCALEFILTER Scale filter to have passband approx. equal to one.
if First_Band
b = b / sum(b); % unity gain at DC
else
if ff(4)==1
% unity gain at Fs/2
f0 = 1;
else
% unity gain at center of first passband
f0 = mean(ff(3:4));
end
b = b / abs( exp(-1i*2*pi*(0:L-1)*(f0/2))*(b.’) );
end
end
Since there is no documentation for this particular line, I was curious to know where the following equation comes from:
scalingFactor = 1 / abs( exp(-1i*2*pi*(0:L-1)*(f0/2))*(b.’) );
Does anyone know?Hello Everyone,
I had a quick question.
I was looking through the "fir1" function’s implementation to see how the coeffs are being scaled. I came across this function:
function b = scalefilter(b,First_Band,ff,L)
%SCALEFILTER Scale filter to have passband approx. equal to one.
if First_Band
b = b / sum(b); % unity gain at DC
else
if ff(4)==1
% unity gain at Fs/2
f0 = 1;
else
% unity gain at center of first passband
f0 = mean(ff(3:4));
end
b = b / abs( exp(-1i*2*pi*(0:L-1)*(f0/2))*(b.’) );
end
end
Since there is no documentation for this particular line, I was curious to know where the following equation comes from:
scalingFactor = 1 / abs( exp(-1i*2*pi*(0:L-1)*(f0/2))*(b.’) );
Does anyone know? Hello Everyone,
I had a quick question.
I was looking through the "fir1" function’s implementation to see how the coeffs are being scaled. I came across this function:
function b = scalefilter(b,First_Band,ff,L)
%SCALEFILTER Scale filter to have passband approx. equal to one.
if First_Band
b = b / sum(b); % unity gain at DC
else
if ff(4)==1
% unity gain at Fs/2
f0 = 1;
else
% unity gain at center of first passband
f0 = mean(ff(3:4));
end
b = b / abs( exp(-1i*2*pi*(0:L-1)*(f0/2))*(b.’) );
end
end
Since there is no documentation for this particular line, I was curious to know where the following equation comes from:
scalingFactor = 1 / abs( exp(-1i*2*pi*(0:L-1)*(f0/2))*(b.’) );
Does anyone know? digital signal processing, dsp, filter, signal processing, signal MATLAB Answers — New Questions