how to perform FFT on this signal and frequency domain

1 visualización (últimos 30 días)
zayaz aya
zayaz aya el 29 de Mzo. de 2018
Comentada: Birdman el 29 de Mzo. de 2018
t = (0:0.001:1); x = 110*sin(2*pi*50*t); y = 10*sin(2*pi*250*t); z=x+y; plot(z)

Respuesta aceptada

Birdman
Birdman el 29 de Mzo. de 2018
Try this:
[pxx1,f1] = pwelch(y1,512,66.7,[],1000);
[pxx2,f2] = pwelch(y2,512,66.7,[],1000);
figure(1);
semilogx(f1,pxx1);xlabel('Frequency(Hz)');title('2*pi*50*t');
figure(2);
semilogx(f2,pxx2);xlabel('Frequency(Hz)');title('2*pi*250*t');
You will see each signal's frequency domain plot, which has peaks at 50 and 250 Hz respectively.
  3 comentarios
zayaz aya
zayaz aya el 29 de Mzo. de 2018
im trying to download it
Birdman
Birdman el 29 de Mzo. de 2018
Try this:
Fs = 1000; % Sampling frequency
T = 1/Fs; % Sampling period
L = 1001; % Length of signal
t = (0:L-1)*T; % Time vector
y1=110*sin(2*pi*50*t);
y2=10*sin(2*pi*250*t);
f = Fs*(0:(L/2))/L;
Y1=abs(fft(y1));
Y2=abs(fft(y2))
figure(1);
semilogx(f,Y1(1:numel(f)));xlabel('Frequency(Hz)');title('2*pi*50*t');
figure(2);
semilogx(f,Y2(1:numel(f)));xlabel('Frequency(Hz)');title('2*pi*250*t');

Iniciar sesión para comentar.

Más respuestas (0)

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by