Fourier transform of table signal

41 ビュー (過去 30 日間)
fima v
fima v 2019 年 8 月 10 日
コメント済み: dpb 2019 年 8 月 12 日
Hello, i am trying to perform an fft on a signal given by a table as shon bellow and attached in the txt file.I got the result shown bellow
where my values are 404, which is not logical giving amplitude of 1.2, where did i go wrong?
i am using this code to perform FFT ,is there a way to increase the resoltion
[X,TXT,RAW] = xlsread('Book1.xlsx');
xdft = fft(X(:,2));
DT = X(2,1)-X(1,1);
% sampling frequency
Fs = 1/DT;
DF = Fs/size(X,1);
freq = 0:DF:Fs/2;
xdft = xdft(1:length(xdft)/2+1);
plot(freq,abs(xdft))
  1 件のコメント
dpb
dpb 2019 年 8 月 10 日
編集済み: dpb 2019 年 8 月 10 日
Look at example of one-sided PSD at
doc fft
for example of how to normalize the FFT and use zero-padding to increase resolution in frequency domain .

サインインしてコメントする。

回答 (2 件)

David Goodmanson
David Goodmanson 2019 年 8 月 11 日
編集済み: David Goodmanson 2019 年 8 月 12 日
Hello fima,
It’s true that the amplitude is off, but frequency is a much more serious issue. The time domain plot shows that the period is 1usec and the fundamental frequency is 1MHz. However, the fft peak shows up at a frequency of 1.58e8.
That makes no sense, but after splitting out the first and second columns of the data set and calling them t and y respectively, the following two lines show the spacing of points in the time array.
figure(1)
plot(diff(t))
As you can see, the spacing is anything but constant, so the fft is not really going to work. On the upside, the time domain data is really clean and zooming in on a plot of t vs. y shows that the time points are closely spaced exactly where they need to be to catch the fast parts of the waveform. So whatever instrument you are using is doing a fine job.
All this means that obtaining the spectrum by simply applying an fft is not going to work.
The shortest time interval in the data is t0 = 2.857-11 (sampling rate of 35 Ghz). Interpolating the waveform to an array of constant spacing t0 would allow use of the fft.
  1 件のコメント
dpb
dpb 2019 年 8 月 12 日
"The shortest time interval in the data is t0 = 2.857-11 (sampling rate of 35 Ghz). Interpolating the waveform to an array of constant spacing t0 would allow use of the fft."
Looking at the other plot OP posted, looks like that's basically what the spectrum analyzer did but the author of book cut the data down to what a spreadsheet could handle when distributing it...

サインインしてコメントする。


fima v
fima v 2019 年 8 月 12 日
Hello i Have attached a src_square.txt source and its spectral fourier transform in the photo shown bellow and
How ever the spectrum analyzer results are much more accurate, what can be done to match more highly my src_quare.txt
to the Spectrum.
xyce_fourier.PNG
Capture.PNG

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by