|
|
| ctc(x,y,T)
|
function z = ctc(x,y,T)
% z = ctc(x,y,T) simulates the convolution of two causal continuous-time signals x(t) and
% y(t), removing initial anomalies in time caused by the discrete nature of the computer.
% T is the interval between time samples in seconds and is used to scale the result z(t)
% to its correct amplitude (approximately).
z = conv(x,y)*T;
len = max(length(x),length(y));
z = z(1:len);
if x(1)==0 & y(1)==0,
z(1:len-1) = z(2:len); z(len) = 0;
end
if x(1)~=0 & y(1)~=0,
z(2:len) = z(1:len-1); z(1) = 0;
end
|
|
Contact us at files@mathworks.com