Signal analysis - need help with FFT

1 visualización (últimos 30 días)
Janusz Rogalski
Janusz Rogalski el 6 de En. de 2019
Comentada: dpb el 7 de En. de 2019
I have a signal that I'm trying to analyze using FFT and rectangular window. However I am not sure how to adjust the value of "t" and use rectangular window on this signal to perform correct analysis Can you please tell me what am I doing wrong? Thank you in advance.
clear
close all
clc
fs=2000;
T=1/fs;
t=0:T:(1-T);
y=sin(200*t.*sin(60*t));
% Plot signal
figure(1);
plot(t,y);
title('Signal');
xlabel('Time [s]');
ylabel('Amplitude');
% Spectrum
figure
widmo=(abs(fft(y)));
stem(widmo);
title('Spectrum')
grid on;
axis tight;
xlabel('Frequency [Hz]');
ylabel('Amplitude')
% Rectangular window
N = length(y);
w = window(@boxcar,fs);
okno = y.*w';
figure;
plot(t,okno);
figure;
bar(abs(fft(okno)));
  5 comentarios
David Goodmanson
David Goodmanson el 7 de En. de 2019
Hi Janusz,
It may or may not be what was intended, but certainly the spectrum of
y = sin(200*t).*sin(60*t);
is a lot easier to interpret than the spectrum of
y = sin(200*t.*sin(60*t));
dpb
dpb el 7 de En. de 2019
Ah! yes, a misplaced parentheis could make a big difference here! Good catch! :)

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Spectral Measurements en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by