%%This function is written to calculate the covolution of continous signals. %% in the function arguments, cconv(x,h), note that : %% x : input signal %% h : impulse response of the system. %% Note : for any signals x(t) and h(t) and convolution of them %% y(t)=x(t)*h(t),you should set the axises range and time range %% in lines : 20,24,27,31, %% ***************************************************************************** %% * by : Davood Shaghaghi * %% * Electrical Engineering Department, Hamedan University of Technology(HUT) * %% * Email: davood.shaghaghi@gmail.com * %% * April 14, 2010 * %% * Copying is permitted with source citation! * %% ***************************************************************************** function []=cconv(x,h) tic syms t T t=-3:.1:6.5; f= subs(x,T).*subs(h,t-T); y=int(f,T,-inf,inf); subplot(3,1,1) ezplot(x,[-1.5 1.5]) title('input signal,x(t)') subplot(3,1,2) ezplot(h) title('impulse response,h(t)') subplot(3,1,3) plot(t,y); axis([-3 3 -1 1]) title('output signal,y(t)') shg beep toc/60 end