how to find max freq and lamdha min for a pulse

2 ビュー (過去 30 日間)
kavya saxena
kavya saxena 2012 年 5 月 19 日
hi all
i want to know how can i calculate max frequency and min wavelength for following function
y=15(1-cos(2 *pi*f*t/n)*sin(2*pi*f*t)
here f=0.5MHz
n=5cycle
the matlab coding which i did is
> f=0.5e6;
> fs=f*100;
> ts=1/fs;
> n=5
> t=0:ts:n/f;
> y=15*(1-cos(2*pi*f*t/n)).*cos(2*pi*f*t);
>plot (t,y)
>x=fft(y);
>plot(x);
now what should i do further......plz help me

採用された回答

Wayne King
Wayne King 2012 年 5 月 19 日
ydft = fft(y);
ydft = ydft(1:floor(length(ydft)/2)+1);
[maxval,I] = max(abs(ydft));
freq = 0:fs/length(y):fs/2;
fprintf('Maximum at %2.3f Hz\n.', freq(I));
You would have been better with:
t=0:ts:n/f-ts;
y=15*(1-cos(2*pi*f*t/n)).*cos(2*pi*f*t);
ydft = fft(y);
ydft = ydft(1:length(ydft)/2+1);
[maxval,I] = max(abs(ydft));
freq = 0:fs/length(y):fs/2;
fprintf('Maximum at %2.3f Hz\n.', freq(I));
Due to the spacing of the frequencies in the DFT. As far as the wavelength, you have not told us the propagation speed, which you have to in order to determine wavelength. If we assume that it is the speed of light, then
lambda = 3e8/freq(I);
fprintf('Wavelength is %3.2f meters.\n',lambda)

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSpectral Measurements についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by