can I use FFT to determine the variable frequency?
4 views (last 30 days)
Show older comments
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
0 Comments
Accepted Answer
Rick Rosson
on 31 Jul 2011
You may want to try the spectrogram function. For more information:
>> doc spectrogram
HTH.
Rick
More Answers (0)
See Also
Categories
Find more on Parametric Spectral Estimation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!