Effacer les filtres
Effacer les filtres

FFT inside a specific interval

2 vues (au cours des 30 derniers jours)
MartinM
MartinM le 17 Sep 2021
Commenté : William Rose le 17 Sep 2021
Hello
I have a frequency and temporal domain.
And a vector linked to frequency domain.
I would like to FFt this vector but inside a specific frequency interval. And I don't know how to reconstruct the temporal vector...
FWHM=140e-15/1.76;
Tduration=FWHM./(2.*log(1+sqrt(2)))
phy.Tcav =1/Trep;
num.n=1*2^17;
num.tspan =10000*FWHM*1.76
num.dt=num.tspan/(num.n-1);
T = zeros(1, num.n);
for k=1:1:num.n
T(k)=(k-1)*num.dt-num.tspan/2;
end
DeltaT=T(2)-T(1);
fmax=1./(DeltaT);
fmin=1./(T(num.n)-T(1));
num.fspan=(fmax-fmin);
F=linspace(-num.fspan/2,num.fspan/2-num.fspan/num.n,num.n);
num.f=fftshift(F);
wabs=2.*pi.*fftshift(num.f);
A=0.1.*sin(10e-12.*(wabs))
Lim=1500:3500
A2=0.1.*sin(10e-12.*(wabs(Lim)))
plot(wabs(Lim),A2)
figure
plot(T(Lim),abs(fftshift(fft(A2))))
I know that i need to recreat T, from wabs(ini) and wabs(final) but can't found the tricks
If someone has an idea
Regards
  1 commentaire
William Rose
William Rose le 17 Sep 2021
@MartinM, YOur code does not run because Trep is not defined.

Connectez-vous pour commenter.

Réponses (1)

MartinM
MartinM le 17 Sep 2021
FF=F+phy.fo;
df=FF(1500)-FF(1499);
dt=1/df/length(Lim);
t=dt*linspace(-(length(Lim)-1)/2,length(Lim)/2,length(Lim))
plot(t,abs(fftshift(fft(A2))))
Not perfect,
but looks ok
Is it better if length(Lim) is a nextpow2?

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by