gusucode.com > UWB_matlab源码程序 > CP0804/cp0804_signalshift.m

    %
% Function 8.14: "cp0804_signalshift"
%
% Applies a circular shift of 't' seconds
% to the input vector 'in'
%
% Programmed by Guerino Giancola
%

function [out] = cp0804_signalshift(in,fc,t)

% ------------------------------------
% Step One - Shifting the input signal
% ------------------------------------

dt = 1 / fc;            % sampling period

% shift samples
ss = mod(floor(t/dt),length(in));
out = in([end-ss+1:end 1:end-ss]);