how to calculate central frequency from fft of wave function

4 views (last 30 days)
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)

Answers (2)

Wayne King
Wayne King on 24 May 2012
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 Comment
kavya saxena
kavya saxena on 24 May 2012
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?

Sign in to comment.


Wayne King
Wayne King on 24 May 2012
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.

Products

Community Treasure Hunt

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

Start Hunting!