amplitude spectrum of signal

1 visualizzazione (ultimi 30 giorni)
AshCrow
AshCrow il 3 Apr 2024
Risposto: Anudeep Kumar il 30 Lug 2025
1)Determine and plot the amplitude spectrum of the even signal x(t) analytically and numerically, then compare the results.
2)If signal x(t) passes through an LTI system with impulse response h(t); Determine and plot the amplitude and phase spectrum of the output signal.

Risposte (1)

Anudeep Kumar
Anudeep Kumar il 30 Lug 2025
You can define 'x(t)' and 'h(t)' using basic MATLAB arrays as below and plot using the 'plot()' function.
% Define t
t = -5:0.01:5; % Adjust the range and step as needed
% x(t)
x = zeros(size(t));
x(abs(t) >= 0 & abs(t) <= 1) = t(abs(t) >= 0 & abs(t) <= 1) + 1;
x(abs(t) > 1 & abs(t) <= 2) = 2;
x(abs(t) > 2 & abs(t) <= 4) = -t(abs(t) > 2 & abs(t) <= 4) + 4;
% h(t)
h = zeros(size(t));
h(t >= 0 & t <= 2) = 1;
h(t > 2 & t <= 3) = -1;
% Plot x(t)
figure;
subplot(2,1,1);
plot(t, x, 'LineWidth', 2);
xlabel('t'); ylabel('x(t)');
title('x(t)');
grid on;
% Plot h(t)
subplot(2,1,2);
plot(t, h, 'LineWidth', 2);
xlabel('t'); ylabel('h(t)');
title('h(t)');
grid on;
As for the second part please look into the 'conv' function from MATLAB and apply it as per your use case. Below are the links to all the documentation you may want to refer to:
I hope this helps!

Categorie

Scopri di più su Audio Processing Algorithm Design in Help Center e File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by