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 CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by