Convolution of two signal

Illustration
Tayfun_celebi - 2021-12-10T11:47:05+00:00
Question: Convolution of two signal

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(,) ?

Related Questions

  • Convolution of two signal
  • Expert Answer

    Profile picture of John Williams John Williams answered . 2025-11-20

    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 u
    subplot(3, 1, 1);
    plot(t, u, 'b-', 'LineWidth', 2);
    grid on;
    xlabel('t', 'FontSize', 12);
    ylabel('u', 'FontSize', 12);
    % Plot g
    subplot(3, 1, 2);
    plot(t, g, 'b-', 'LineWidth', 2);
    grid on;
    xlabel('t', 'FontSize', 12);
    ylabel('g', 'FontSize', 12);
    % Plot out
    subplot(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]);

     


    Not satisfied with the answer ?? ASK NOW

    Get a Free Consultation or a Sample Assignment Review!