FFT inside a specific interval

5 ビュー (過去 30 日間)
MartinM
MartinM 2021 年 9 月 17 日
コメント済み: William Rose 2021 年 9 月 17 日
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 件のコメント
William Rose
William Rose 2021 年 9 月 17 日
@MartinM, YOur code does not run because Trep is not defined.

サインインしてコメントする。

回答 (1 件)

MartinM
MartinM 2021 年 9 月 17 日
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?

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by