Plotting amplitude spectrum of a signal
Mostrar comentarios más antiguos
i got this sygnal
tmax=0.5;
t=0:0.001:tmax;
fs=1000;
tsamp=0:1/fs:tmax;
f1 = 18;
f2 = 321.37;
y = sin(2*pi*f1*tsamp) + sin(2*pi*f2*tsamp);
figure();
plot(t, y);
grid on;
how do I plot it's amplitude spectrum?
Respuesta aceptada
Más respuestas (1)
Sulaymon Eshkabilov
el 8 de En. de 2023
Editada: Sulaymon Eshkabilov
el 8 de En. de 2023
tmax=0.5;
t=0:0.001:tmax;
fs=1000;
tsamp=0:1/fs:tmax;
f1 = 18;
f2 = 321.37;
y = sin(2*pi*f1*tsamp) + sin(2*pi*f2*tsamp);
figure();
plot(t, y);
grid on;
Y =movmedian(y, 5); % Amplitude
figure
plot(t,Y)
grid on
xlabel('x')
ylabel('|y(x)|')
Categorías
Más información sobre Spectral Measurements en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!







