Fourier transform of table signal

41 vues (au cours des 30 derniers jours)
fima v
fima v le 10 Août 2019
Commenté : dpb le 12 Août 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 commentaire
dpb
dpb le 10 Août 2019
Modifié(e) : dpb le 10 Août 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 .

Connectez-vous pour commenter.

Réponses (2)

David Goodmanson
David Goodmanson le 11 Août 2019
Modifié(e) : David Goodmanson le 12 Août 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 commentaire
dpb
dpb le 12 Août 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...

Connectez-vous pour commenter.


fima v
fima v le 12 Août 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

Catégories

En savoir plus sur Fourier Analysis and Filtering dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by