how to find max freq and lamdha min for a pulse
5 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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
0 Commenti
Risposta accettata
Wayne King
il 19 Mag 2012
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 Commenti
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!