Using ifft correctly in MATLAB

조회 수: 2 (최근 30일)
Jaimin Jha
Jaimin Jha 2017년 4월 5일
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에서 Graphics Object Programming에 대해 자세히 알아보기


Community Treasure Hunt

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

Start Hunting!

Translated by