ifft one side spectrum to get a real signal

81 ビュー (過去 30 日間)
Tsuwei Tan
Tsuwei Tan 2019 年 10 月 8 日
編集済み: Muhammad Waqar 2021 年 12 月 10 日
Dear Matlab Profession,
Please find the following code.
I have a code to generate a one side spectrum in frequency domain, I am not sure it is postive frequency or negative frequency.
But I do know the energetic portion of signal in time domain aftfter ifft must starts after 3.33 sec as either Figure (1) or (2).
The issue is based on Fourier transform theory, I should get a "real" signal, but I still get a complex signal in time domain.
May I ask how to fix it or use ifftshift? Thank you!
clear;clc;close all;
%% This is the time and frequency steps used to generate signals
sig_end=7; % in sec, r/cw=5000/1500=3.33 sec arrival already covered
Fs=400; % Sampling Freq, Fs/2 is the folding freq
dt=1/Fs; % Time Step
L=Fs*sig_end; % Signal Length: Fs* a number
t=(0:L-1)*dt; % physical time (s)
df=Fs/L; % frequency step
freq=0:df:Fs/2; %desired frequencies for broadband
%% Load one side spectrum generated from software
load('Sign_spectrum_one_side.mat','Pr')
Pr_other_side=conj(Pr);
Pr_two_sides_1=cat(1,Pr_other_side(2:end-1),flip(Pr));
Pr_two_sides_2=cat(1,Pr_other_side,flip(Pr(2:end-1)));
pr_two_sides_1=ifft(Pr_two_sides_1);
pr_two_sides_2=ifft(Pr_two_sides_2);
figure(1)
plot(t,pr_two_sides_1);
xlabel('Time (sec)');ylabel('Arbitrary magnitude')
figure(2)
plot(t,pr_two_sides_2)
xlabel('Time (sec)');ylabel('Arbitrary magnitude')

採用された回答

Samatha Aleti
Samatha Aleti 2019 年 10 月 16 日
ifft” of that vectors which have symmetric complex conjugate structure will result in real values.
Also, you may specify the "symflag" as symmetric while computing fft inorder to ensure that the output is real. Refer the following document for more information:
Refer the following link for detailed explanation:

その他の回答 (1 件)

Muhammad Waqar
Muhammad Waqar 2021 年 12 月 10 日
編集済み: Muhammad Waqar 2021 年 12 月 10 日
Hi there,
Here is a link to an easy-to-use function to perform fft or ifft along with an example:

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by