Problem in performing IFFT
古いコメントを表示
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 件のコメント
Matt J
2021 年 3 月 30 日
However in time domain plot, my response should start with zero
Why?
Susmita Panda
2021 年 3 月 31 日
Susmita Panda
2021 年 4 月 1 日
採用された回答
その他の回答 (0 件)
カテゴリ
ヘルプ センター および File Exchange で Design and Simulate SerDes Systems についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!