필터 지우기
필터 지우기

can I use FFT to determine the variable frequency?

조회 수: 2 (최근 30일)
Ivy
Ivy 2011년 7월 30일
Hi All.
Can I use Fourier transform to determine the variable frequency?Below is the code. If the frequency perturbation(rand/10) is small,the main frequency array(xx) contains the same value. If the frequency perturbeation(rand/10) is large, such as rand,the value in main frequency array(xx) does NOT make sense.
Is there any way I can find the variable frequency?
I appreciate any of your advice.
Ivy
clear all;
clc;
Fs=1000;
T=1/Fs;
L=1000;
t=(0:L-1)*T;
for i=1:1:10000 %variable frquency signal.
x(i)=0.7*sin(2*pi*(50+rand/10)*T*(i-1));
end
for k=1:1:5000
NFFT =1024;
Y=fft(x(k:1024+k),NFFT);
f= 100*linspace(0,1,100);
[C,index]=max(abs(Y(1:100)));
xx(k)=f(index);
end

채택된 답변

Rick Rosson
Rick Rosson 2011년 7월 31일
You may want to try the spectrogram function. For more information:
>> doc spectrogram
HTH.
Rick
  댓글 수: 2
Ivy
Ivy 2011년 7월 31일
Thank you, Rick.
I will look through it.
Ivy
Ivy 2011년 7월 31일
Hi Rick,
I have use the following code to get the variable frequency.But I can't get the result(frequency increase from 50 to 10050). Could you please correct me?
Thanks!
Ivy
clear all;
clc;
Fs=1000;
T=1/Fs;
L=1000;
t=(0:L-1)*T;
for i=1:1:10000 %variable frquency signal.
x(i)=0.7*sin(2*pi*(50+i)*T*(i-1));
end
NFFT =1024;
[S,F,T,P] = spectrogram(x,256,255,256,1E3);
surf(T,F,10000*log10(P),'edgecolor','none'); axis tight;
view(0,90);

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Parametric Spectral Estimation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by