Filter löschen
Filter löschen

Fourier transform of table signal

18 Ansichten (letzte 30 Tage)
fima v
fima v am 10 Aug. 2019
Kommentiert: dpb am 12 Aug. 2019
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 Kommentar
dpb
dpb am 10 Aug. 2019
Bearbeitet: dpb am 10 Aug. 2019
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 .

Melden Sie sich an, um zu kommentieren.

Antworten (2)

David Goodmanson
David Goodmanson am 11 Aug. 2019
Bearbeitet: David Goodmanson am 12 Aug. 2019
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 Kommentar
dpb
dpb am 12 Aug. 2019
"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...

Melden Sie sich an, um zu kommentieren.


fima v
fima v am 12 Aug. 2019
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

Kategorien

Mehr zu Fourier Analysis and Filtering finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by