inverse Fourier transform of a signal
4 次查看(过去 30 天)
显示 更早的评论
Hello all, I got a real signal from network analyzer and this network analyzer can transform the signal for me. However, when I used the command ifft, I couldn't get the signal that I saw before. Could you please suggest how to do it? The stimulus in the txt file is the frequency (the range is from 0.1 Ghz to 0.3 Ghz).
if true
clear all
close all
clc
load('cable.mat');
filename = 's11.txt';
M = csvread(filename,9,0);
f=M(:,1);
s11=complex(M(:,2),M(:,3));
y = ifft(s11);
plot(abs(y))
end
2 个评论
Star Strider
2016-3-1
You cannot take the ifft of an incomplete fft such as yours. You need all the frequencies from 0 to 0.3 GHz, or preferably the original time-domain signal that you can then filter to isolate the frequencies of interest to you.
回答(1 个)
John BG
2016-3-1
Shan
try the following:
1.- don't care about the file extension:
A=csvread('s11.s2p',9,0)
or
A=csvread('s11.txt',9,0)
or
A=csvread('s11.dat',9,0)
or
A=csvread('s11.csv',9,0)
It does not matter, as long as the file extension is .s2p .txt .dat .csv the input is exactly the same.
2.- get plot-able data
f=A(:,1)
s11re=A(:,2)
s11im=A(:,3)
s11mod=(s11re.^2+s11im.^2).^5
s11ang=atan(s11im./s11re)
3.- now try plotting s11:
plot(s11mod)
or
s11=s11re+i*s11im
plot(s11.*conj(s11))
or
plot(s11mod.^2)
or
plot(10*log10(s11mod.^2))
5.- do you really need s11 in time domain? s11 is already frequency domain
6.- You may also find useful to build an rfckt object to replicate the 3D expensive real Network Analyzer plot onto the rftool Smith chart and polar diagram:
data=rfckt.datafile
data.AnalyzedResult.Freq=f
S_data=complex(zeros(2,2,1601))
s11re=A(:,2)
s11im=A(:,3)
s11=s11re+i*s11im
S_data(1,1,:)=s11
data.AnalyzedResult.S_Parameters=S_data
now the variable 'data' can be imported into rftool
launch rftool:
rftool
go to: File > Import from Workspace
choose: data
on the lower half of the rftool GUI tick only s11, all other s parameters empty
Smith Chart: Z Chart
now you should see a more or less static copy of what you got while cutting the coaxial.
If you find this answer of any help solving this question, please click on the thumbs-up vote link,
thanks in advance
John
3 个评论
Sagar Dutta
2020-2-10
Shan Chu, Did you find the solution to convert into time domain using ifft? I am also trying to do the same thing, need some help.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Filter Analysis 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!