📄 hrollfcoef.m
字号:
% hrollfcoef.m
%
% Generate coefficients of Nyquist filter
function [xh] = hrollfcoef(irfn,ipoint,sr,alfs,ncc)
%******************** variables ***************************
% irfn : Number of symbols to use filtering
% ipoint : Number of samples in one symbol
% sr : symbol rate
% alfs : rolloff coefficients
% ncc : 1 - transmitting filter 0 - receiving filter
%**********************************************************
xi = zeros(1,irfn*ipoint+1);
xq = zeros(1,irfn*ipoint+1);
point = ipoint;
tr = sr;
tstp = 1.0 ./ tr ./ ipoint;
n = ipoint .* irfn;
mid = ( n ./ 2 ) + 1;
sub1 = 4.0 .* alfs .* tr; % 4 * alpha * R_s
for i = 1:n
icon = i - mid;
ym = icon;
if icon == 0.0
xt = (1.0-alfs + 4.0.*alfs./pi) .* tr; % h(0)
else
sub2 = 16.0.*alfs.*alfs.*ym.*ym./ipoint./ipoint;
if sub2 ~= 1.0
x1 = sin(pi*(1.0-alfs)/ipoint*ym)./pi./...
(1.0-sub2)./ym./tstp;
x2 = cos(pi*(1.0+alfs)/ipoint*ym)./...
pi.*sub1./(1.0-sub2);
xt = x1 + x2; % h(t)
else % ( 4alphaRst )^2 = 1
xt = alfs.*tr.*((1.0-2.0/pi).*cos...
(pi/4.0/alfs)+(1.0+2.0./pi).*sin...
(pi/4.0/alfs))./sqrt(2.0);
end % if sub2 ~= 1.0
end % if icon == 0.0
if ncc == 0 % in the case of receriver
xh(i) = xt ./ ipoint ./ tr; % normalization
elseif ncc == 1 % in the case of transmitter
xh(i) = xt ./ tr; % normalization
else
error('ncc error');
end % if ncc == 0
end % for i = 1:n
%******************** end of file ***********************************
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -