pulse_shaping.m
来自「国外大学的同志作出来的好程序」· M 代码 · 共 30 行
M
30 行
function [psflt_data]=pulse_shaping(data, upsampling_rate, pulse_filter, truncate);
%pulse shaping function:
%Upsampling the data and Pulse-shaping.
%Suitable for intergate number of upsampling_rate.
%psflt_data has the same length with that of data times upsampling_rate.
%if the length of pulse_filter is 2*grp_delay*upsampling_rate+1;
%By Aijun Song, July, 2005
if nargin<3 | nargin>5,
disp('The number of the inputs is not supported.')
return;
elseif nargin==3,
truncate=0;
end
%upsampling of the data
upsampled_data=upsample(data, upsampling_rate);
%pulse shaping.
psflt_data=conv(pulse_filter, upsampled_data);
%suppose pulse_filter have a length upsampling_rate*(grp_delay*2)+1
grp_delay=(length(pulse_filter)-1)/(2*upsampling_rate);
if truncate,
ilen=length(psflt_data);
psflt_data=psflt_data(grp_delay*upsampling_rate+1: ilen-grp_delay*upsampling_rate);
end
%normalization
psflt_data=psflt_data/max(psflt_data);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?