Using ifft correctly in MATLAB
6 次查看(过去 30 天)
显示 更早的评论
Hi,
I am trying to match the functions in Fourier transform table, i.e. I am plotting one function, then I use the standard transform of that function, take the ifft and try to match with original time domain function. But, the results don't match. I also tried using ifftshift command, but that also does not help. Can you please help me out with this? For reference I am attaching my code here.
clc; clear all; close all; %% sigma=5; t=0:1:100; f1=exp((-t.^2)/(2*(sigma^2)));
%%
N=2^8; f2=zeros(1,N-1);w=zeros(1,N-1);
for n=1:1:N-1; w(n)=2*pi*n/N; f2(n)=sigma*(sqrt(2*pi))*exp(-((sigma^2)*(w(n)^2))/2);
end f3=sigma*(sqrt(2*pi)); f4=[f3 f2]; f5=ifft(ifftshift(f4)); %% figure(1) subplot(2,1,1), plot(t,f1) subplot(2,1,2), plot(1/(N):100/(N):100,f4)
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!