FFT manual help formulation

조회 수: 6 (최근 30일)
nur yusof
nur yusof . 2015년 1월 22일
댓글: nur yusof . 2015년 1월 27일
Good day everyone!
I've been trying to introduce the fast fourier transform function fft into my code, to replace my manually coded fourier transform. The results I get are different and I have no idea why.
My coding is:-
Fs = 512; % Sampling frequency T = 1/Fs; % Sample time L = 6678; % Length of signal t = (0:L-1)*T; % Time vector Sum of a 50 Hz sinusoid and a 120 Hz sinusoid x = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t); y = x + 2*randn(size(t)); % Sinusoids plus noise plot(Fs*t(1:50),y(1:50)) title('Signal Corrupted with Zero-Mean Random Noise') xlabel('time (milliseconds)')
Can somebody tell me why the coding from help plot only 1:50,what it means by 50?And also what sum of a 50Hz sinusoid and a 120 hz sinusoid means?Is it standard equation for all signal?
Thanks in advance

답변 (1개)

Matz Johansson Bergström
Matz Johansson Bergström 2015년 1월 22일
The range 1:50 is only used in the plot, not in the rest of the example. See Documentation on FFT I guess they chose 50 because they want to demonstrate that it is very difficult to see frequency information from a noisy signal, that's all.
When they get back the information they want, the frequencies 50 and 120, you have to use the full signal, as they did. They actually pad to the next "power of two"-size, to get a more efficient transform.
  댓글 수: 1
nur yusof
nur yusof 2015년 1월 27일
Then can I use the
x = 0.7*sin(2*pi*50*t) + sin(2*pi*120*t)
y = x + 2*randn(size(t))
equation in my calculation to get FFT value?

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


Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by