📄 polyphase.m
字号:
function P = polyphase(varargin)
% POLYPHASE -- convert matrix polynomial to polyphase form
%
% P = polyphase(P,m,r)
% P = polyphase(P)
%
% If P has type '', both M and R must be given. This routine will
% attach M, R to P and rearrange the coefficients into polyphase form.
%
% If P has type 'polyphase', the same P is returned.
%
% If P has type 'symbol', P is scaled by sqrt(m), and the coefficients
% are rearranged into polyphase form.
% Copyright (c) 2004 by Fritz Keinert (keinert@iastate.edu),
% Dept. of Mathematics, Iowa State University, Ames, IA 50011.
% This software may be freely used and distributed for non-commercial
% purposes, provided this copyright statement is preserved, and
% appropriate credit for its use is given.
%
% Last update: Feb 20, 2004
switch varargin{1}.type
case ''
% P = polyphase(P,m,r)
if (nargin < 3)
error('M and R must be given');
end
P = varargin{1};
m = varargin{2};
r = varargin{3};
[n1,n2] = size(P);
if (n2 ~= r | round(n1/r)*r ~= n1)
error('size of P is not compatible with given R');
end
newmin = P.min - mod(P.min,m);
Pmax = get(P,'max');
newmax = Pmax + (m-1-mod(Pmax,m))
P = trim(P,[newmin,newmax]);
P = reshape(P,n1,m*r);
P.type = 'polyphase';
P.m = m;
P.r = r;
case 'polyphase'
% P = polyphase(P)
P = varargin{1};
case 'symbol'
% P = polyphase(P)
P = varargin{1};
m = P.m;
r = P.r;
[n1,n2] = size(P);
newmin = P.min - mod(P.min,m);
Pmax = get(P,'max');
newmax = Pmax + (m-1-mod(Pmax,m));
P = trim(P,[newmin,newmax]);
P = reshape(P,n1,m*r);
P.type = 'polyphase';
P.min = P.min / m;
P = P * sqrt(m);
otherwise
disp('this should not happen');
keyboard
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -