amplitude spectrum of signal

조회 수: 1 (최근 30일)
AshCrow
AshCrow 2024년 4월 3일
답변: Anudeep Kumar 2025년 7월 30일
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.

답변 (1개)

Anudeep Kumar
Anudeep Kumar 2025년 7월 30일
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!

카테고리

Help CenterFile Exchange에서 Audio Processing Algorithm Design에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by