Problem in performing IFFT
Show older comments
I have performed IFFT for converting frequency to time domain and back to frequency domain. I am getting same results also. However in time domain plot, my response should start with zero and I am getting slighly higher value at time zero.
Here is my code:
clear all
close all
clc
a=0.5;eta=0.3;beta=0.025;wb=14.25;
% Define time and frequency axis variables
fs =400; % samples/s
N = 1024; % number of points
dt = 1 / fs; % s, time step
t = (0:N-1)*dt; % s, time axis
df = 1 / N / dt; % Hz, frequency step
f = (-N/2:N/2-1)*df; % Hz, frequency axis
% Define function
y=sin(pi.*a).*eta.*(1+exp(-1i.*pi.*f./eta))./((-f.^2+(2.*1i).*f.*beta+1).*(eta.^2-f.^2));
%plot original signal
figure, plot(f,y),title('Frequency response');ylabel('Response of beam');xlabel('Frequency'); % plot initial time domain signal
%conversion to time domain
y2 = ifft(ifftshift(y));
figure, plot(t,(y2)),title('Time response');ylabel('Response of beam');xlabel('Time');
axis([0 2.5 -0.05 0.05]); % time domain signal after IFFT
%back to original signal
%y3=fftshift(fft(y2));
%figure,plot(f,y3),title('Frequency response');ylabel('Response of beam');xlabel('Frequency');
Any Help is highly appreciated.
Thanks
3 Comments
Matt J
on 30 Mar 2021
However in time domain plot, my response should start with zero
Why?
Susmita Panda
on 31 Mar 2021
Susmita Panda
on 1 Apr 2021
Accepted Answer
More Answers (0)
Categories
Find more on Design and Simulate SerDes Systems in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!