Frequency domain to Time domain Using IFFT : Symmetric figure problem
1 次查看(过去 30 天)
显示 更早的评论
Hi...
I want to convert the frequency domain data to time domain data...
But.. there is some problems...
clc
clear
close all
% Signal Generating
Fs = 3000;
Ts = 1/Fs;
t = 0 : Ts : 1-Ts;
f1 = 30;f2 = 70; f3 = 100;
w1 = 2* pi * f1; w2 = 2* pi * f2; w3 = 2* pi * f3;
theta1 = 0; theta2 = 0; theta3 = 0;
y = 1*exp(-1*t).*sin(w1.*t + theta1)+ ...
2*exp(-2*t).*sin(w2.*t + theta2)+ ...
3*exp(-3*t).*sin(w3.*t + theta3);
plot(t,y)
%% FFT & IFFT
[Frequency, Amplitude] = FFT_hg(t, y);
figure;
plot(Frequency, abs(Amplitude));
xlim([0 150])
B = ifft(Amplitude/2)*length(y);
t1 = (0:(1-Ts)/(length(B)-1):1-Ts);
figure;
B = real(B);
plot(t1,B)
grid on
From the above code...
Shape of figure(3) looks like symmetric...
I don't know, why the figure(1) and figure(3) are different...
Can you help me?
function [Frequency, Amplitude] = FFT_hg(Time, T_Amplitude)
fl=(length(Time)-1)/(max(Time)-min(Time));
L=length(T_Amplitude); %
LN=ceil(L/2);
A = fft(T_Amplitude);
X2=abs(2*A/L); %
Amplitude = X2(1:LN); %
f=fl*(0:L)/L;
Frequency=f(1:LN);
end
0 个评论
回答(1 个)
Pat Gipper
2021-1-12
Your function produced a vector of complex numbers called "A". The original sequence will be reproduced using ifft(A). But the function went further by removing all the phase information by taking the absolute value of A.
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!