gainan.m

来自「Cordic算法的Matlab实现」· M 代码 · 共 30 行

M
30
字号
%% description
%   this routine is written to analysis the relationship
%   between n and An. Theoretically, as n approach infinite,
%   An will be a constant. What's more important, we will
%   study on the difference between the constant and An to
%   look into how many steps the algorithm takes to make
%   the precision of the results up to our expectation.
%   Input
%       F, shifting sequences in the form of comun vector(s)
%       m, mode
%   Output
%       An, gain of the algorithm
%% code
function An=gainAn(F,m)
[row,column]=size(F);
An=ones(column);% initialize An
if(m)% m!=0 No linear mode
    for j=1:column
        Ki=gainKi(F(:,j),m);% select Fi=i, mode
        %compute An for j-th column
        for i=1:row
            An(j)=An(j)*Ki(i);
        end
    end
end
% %plot
% plot(n,An,'ro'),hold on
% plot(n,An,'g'),hold off
% ends function
end

⌨️ 快捷键说明

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