convert scale into wavelength
Mostrar comentarios más antiguos
hello everyone I am a beginner on matlab I am working with a matlab code that calculates the average spectrum of the fft of a signal s and that is the code
Fdepart=36.8;
idepart=round(Fdepart/(Fpas*1e-6)+NbTL*N/2);
Farrivee=38;
iarrivee=round(Farrivee/(Fpas*1e-6)+NbTL*N/2);
spectremoyen=zeros(1,iarrivee-idepart+1);
Puissance=zeros(1,iarrivee-idepart+1);
freq_abscisse=Fdepart-Fpas*1e-6:Fpas*1e-6:Fdepart+(iarrivee-idepart)*Fpas*1e-6-Fpas*1e-6; %plage de fréquence en abscisse
n2=no*ne/((ne^2*(cos(tetad-elfa))^2+(no^2*(sin(tetad-elfa))^2)))^0.5; % indice vu par le faisceau diffracté
q1=(no^2-n2^2*(cos(tetad))^2)^0.5;
q2=n2*sin(tetad);
lam=v*(-q1+q2)./freq_abscisse; %abscisse en longueur d'onde
% glissement de 0 à Tmax avec calcul de la puissance autour de f1
NT=10
for i=1:M %(normalement lié à TL)
spectre1=((abs(fftshift(fft((s((i-1)*NT+1:(i-1)*NT+N)),NbTL*N)))).^2);
%spectre1=((abs(fftshift(fft((s((i-1)+1:i+N)),NbTL*N)))).^2);
spectremoyen=spectremoyen+spectre1(idepart:iarrivee);
spectre_inst(i,:)=spectre1(idepart:iarrivee);
end;
% Normalisation du spectre moyen
spectremoyen=spectremoyen/max(spectremoyen);
spectre_inst=spectre_inst/max(max(spectre_inst));
spectdyn=sum(spectre_inst,2); %Calcul du spectre instantanné en fonction du temps
t=(0:1:999)*10*Te*1e6;
and that is the curve that I see as you can see there are values from 0 to 300 , they are iarrivee- idepart =34-86 - 33790, which is the axis from 0 to 300 but now this axis should be converted to wavelength how I can plot it?
Respuestas (1)
Star Strider
el 31 de Mayo de 2017
0 votos
Wavelength is propagation velocity divided by frequency (for a sinusoidal waveform). If you know the propagation velocity and frequency, you can calculate wavelength.
Categorías
Más información sobre Fourier Analysis and Filtering en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!