⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pulse_shaping.m

📁 国外大学的同志作出来的好程序
💻 M
字号:
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 + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -