필터 지우기
필터 지우기

how to perform FFT on this signal and frequency domain

조회 수: 1 (최근 30일)
zayaz aya
zayaz aya 2018년 3월 29일
댓글: Birdman 2018년 3월 29일
t = (0:0.001:1); x = 110*sin(2*pi*50*t); y = 10*sin(2*pi*250*t); z=x+y; plot(z)

채택된 답변

Birdman
Birdman 2018년 3월 29일
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
zayaz aya
zayaz aya 2018년 3월 29일
im trying to download it
Birdman
Birdman 2018년 3월 29일
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');

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by