MATLAB: Convolution of two signal convolution analytically or function code How can I write the convolution code of the function below? u(t)=sin(2*pi*f*t)g(t)=exp(-t/tau) Analytically or with con(,) ? Best Answer Try this:numPoints = 1000; % Whatever.f = .10; % Whatever.tau = 2; % Whatever.t = linspace(0, 4*pi); % Whatever.u = sin(2*pi*f*t);g = exp(-t/tau);out = conv(u, g, 'full');% Plot usubplot(3, 1, 1);plot(t, u, 'b-', 'LineWidth', 2);grid on;xlabel('t', 'FontSize', 12);ylabel('u', 'FontSize', 12);% Plot gsubplot(3, 1, 2);plot(t, g, 'b-', 'LineWidth', 2);grid on;xlabel('t', 'FontSize', 12);ylabel('g', 'FontSize', 12);% Plot outsubplot(3, 1, 3);% plot(t, out, 'b-', 'LineWidth', 2); % Would need to compute the new t if you want this.plot(out, 'b-', 'LineWidth', 2); % Just plot vs. index.grid on;xlabel('t', 'FontSize', 12);ylabel('out', 'FontSize', 12);% Enlarge figure to full screen.set(gcf, 'Units', 'Normalized', 'OuterPosition', [0, 0.04, 1, 0.96]); Related SolutionsMATLAB: How can i perform a Fourier series on this function Here is the full solution to your problem. Good luck. MATLAB: Help on entering velocity formula Try this:fontSize = 20;t = linspace(-3*pi, 3*pi, 800);v= pi *exp(-0.25*t) .* cos(pi*t) - 0.25 .* exp(-0.25*t) .* sin(pi*t);plot(t, v, 'b-', 'Linewidth', 3);grid on;xlabel('t', 'FontSize', fontSize);ylabel('v', 'FontSize', fontSize); Related QuestionConvolution integral with ode45How to get frequency of a wav file for per cycle in matlab
Best Answer