Using ifft correctly in MATLAB

2 次查看(过去 30 天)
Jaimin Jha
Jaimin Jha 2017-4-5
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 个)

类别

Help CenterFile Exchange 中查找有关 Fourier Analysis and Filtering 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by