⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 roundoffnoise.m

📁 数字信号处理实践方法(第二版)
💻 M
字号:
function RoundoffNoise(b,a,n,nbits,iopt)

% function RoundoffNoise computes the scale factors and roundoff 
% noise of the transfer function realized by the cascaded second
% order canonic sections

if(nbits<2)
	nbits=2;
elseif(nbits>28)
   nbits=32;
end
norm = CanonicScale(b,a,iopt,n);	% obtain scale factors 
temp = norm./[norm(2:size(b,1)) 1];
for i=1:size(b,1)	% scale the coefficients
	B(i,:)=b(i,:)*temp(i);
end
[B,A] = QuantizeCoeff(B,a,nbits);
norm_square = NormSquare(B,A);   % norm_square(i)=||Hi(z)||2 squared
roundoff_noise_gain = 3*norm_square(1);
for i=2:size(b,1)
	roundoff_noise_gain = roundoff_noise_gain+5*norm_square(i);
end
roundoff_noise_gain = (roundoff_noise_gain + 3)/12;

fprintf('Scale factors: '); disp(norm);
fprintf('Norm squared values for Fi(z): '); disp(norm_square);
fprintf('roundoff noise: %g*q^2\n',roundoff_noise_gain);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -