FFT of a Superposition signal

6 次查看(过去 30 天)
Hi,
I have a superposition signal waveform, which I am importing as a txt file, attaching the file. I would like to get the frequency components of the signal. This should be an easy code with just calling the fft function. But I am not able to see the frequency points. May be I am missing something. Could someone please help?
clc;close all
x1 = importdata('Plot-try-matlab-1.txt');
time = x1(:,1);
N = length(x1);
n = 2^nextpow2(N);
Y = fft(x1,n);
plot(Y);
Thanks for the help.

回答(1 个)

Benjamin Thompson
Benjamin Thompson 2022-8-11
编辑:Benjamin Thompson 2022-8-11
Try this, and see this article on usage of the FFT to understand how to interpret the results and assign results to frequencies. Your time data does not make sense so I just plot results on a range of 1:n for frequency.
clc;close all
x1 = importdata('Plot-try-matlab-1.txt');
time = x1(:,1);
N = length(x1);
n = 2^nextpow2(N);
Y = fft(x1(:,2),n);
plot(1:n, abs(Y));
https://www.mathworks.com/help/matlab/math/fourier-transforms.html
https://www.mathworks.com/help/matlab/math/fourier-transforms.html

标签

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by