Fourier transform of table signal

19 visualizaciones (últimos 30 días)
fima v
fima v el 10 de Ag. de 2019
Movida: DGM el 9 de Oct. de 2024
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 comentario
dpb
dpb el 10 de Ag. de 2019
Editada: dpb el 10 de Ag. de 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 .

Iniciar sesión para comentar.

Respuestas (1)

David Goodmanson
David Goodmanson el 11 de Ag. de 2019
Editada: David Goodmanson el 12 de Ag. de 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.
  2 comentarios
fima v
fima v el 12 de Ag. de 2019
Movida: DGM el 9 de Oct. de 2024
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
dpb
dpb el 12 de Ag. de 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...

Iniciar sesión para comentar.

Categorías

Más información sobre Fourier Analysis and Filtering en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by