Frequency domain to Time domain Using IFFT : Symmetric figure problem

조회 수: 10(최근 30일)
HYEON-GI RYU
HYEON-GI RYU 2021년 1월 12일
답변: Pat Gipper 2021년 1월 12일
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

답변(1개)

Pat Gipper
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.

태그

Community Treasure Hunt

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

Start Hunting!

Translated by