📄 get_psfilter.m
字号:
function ps_filter=get_psfilter(sim);
%get pulse shaping filters for disk
%in case, some machines don't have Communications Toolbox,
%or by rcosine function.
%
a=ver;
comm_version=0;
for ic=1:size(a, 2),
if (strcmp(a(ic).Name, 'Communications Toolbox')),
comm_version=str2num(a(ic).Version);
%disp(['[get_psfilter]This matlab has Communication Toolbox, Version:' a(ic).Version '.']);
end
end
%load preset value.
if comm_version<3;
disp('[get_psfilter]Only two types of filters: root_raised_cosine/alpha=.5/grp_delay=10 and square/grp_delay=0')
load ps_filters
ps_filter=ps_filter_sqrt;
return;
end
upsampling_rate=sim.sampling_rate/sim.symbol_rate;
%use Matlab Communication Toolbox.
if comm_version>=3
ps_type=sim.pulse_shaping_type;
ps_alpha=sim.ps_alpha;
ps_grp_delay=sim.ps_grp_delay;
ps_filter_sqrt=rcosine(1, upsampling_rate, ps_type, ps_alpha, ps_grp_delay);
save ps_filters ps_filter_sqrt
ps_filter=ps_filter_sqrt;
end
if strcmp(sim.pulse_shaping_type,'rect'),
ps_filter=ones(upsampling_rate, 1);
disp('[get_psfilter]For rect pulse, other parameters ignored.');
end
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -