将一正弦信号,在频域插值后,进行IFFT变换回时域时,波形不一样,下图红色的为插值后反变换的波形,蓝色的为原来波形,这是怎么回事?谢谢!插值为线性插值,部分代码如下:
k=1
for fk=Ey_ampf(1):0.5:Ey_ampf(Ey_N) %%对反算得到频域实部和虚部分别进行线性插值
for ii=1:1:length(Ey_ampf1)-1
if fk>=Ey_ampf1(ii)&&fk<=Ey_ampf1(ii+1)%%确定fk插值的位置
T_gisExc_R(k)=((fk-Ey_ampf1(ii))*real(Ey_ampfft512(ii+1))+(Ey_ampf1(ii+1)-fk)*real(Ey_ampfft512(ii)))/(Ey_ampf1(ii+1)-Ey_ampf1(ii));
T_gisExc_I(k)=((fk-Ey_ampf1(ii))*imag(Ey_ampfft512(ii+1))+(Ey_ampf1(ii+1)-fk)*imag(Ey_ampfft512(ii)))/(Ey_ampf1(ii+1)-Ey_ampf1(ii));
Ey_ampfft1(k)=T_gisExc_R(k)+T_gisExc_I(k)*1i;
Transf(k)=fk;
k=k+1;
end
end
end