how to calculate central frequency from fft of wave function

3 次查看(过去 30 天)
hi all, is there any difference between central freq and maximum freq of a wave function. how i can calculate central frequency of this function using fft in matlab y=0.5(1-cos(2*pi*f*t)*sin(2*pi*f*t)

回答(2 个)

Wayne King
Wayne King 2012-5-24
Are you trying to show us an AM signal? If so, are the two f's really the same frequency, or did you mean something like this:
t = 0:1e-4:1-1e-4;
f0 = 50;
fc = 1e3;
y=0.5*(1-cos(2*pi*f0*t)).*sin(2*pi*fc*t);
ydft = fft(y);
ydft = ydft(1:length(y)/2+1);
freq = 0:1e4/length(y):1e4/2;
plot(freq,abs(ydft))
  1 个评论
kavya saxena
kavya saxena 2012-5-24
these two are same frequency. let it wiil be 20Khz then i did
f=20e3;
fs=f*100;
ts=1/fs;
n=3;
t=0:ts:n/f;
y=0.5*(1-cos(2*pi*f*t)).*sin(2*pi*f*t);
ydft = fft(y);
now how i get central freq?

请先登录,再进行评论。


Wayne King
Wayne King 2012-5-24
It appears to me that just rewriting that using trigonometric identities you see that it equals
1/2*sin(2*pi*f*t)-1/4*sin(2*pi*2*f*t)
So you get a line component at 20 kHz and one at 40 kHz with 1/2 the amplitude of the component at 20 kHz.
freq = 0:fs/length(y):fs/2;
ydft = fft(y);
ydft = ydft(1:ceil(length(y)/2));
plot(freq,abs(ydft))
So I'm guessing you call the center frequency 30 kHz.

标签

产品

Community Treasure Hunt

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

Start Hunting!

Translated by