FFT of a Superposition signal

5 Ansichten (letzte 30 Tage)
Ram Prasadh Narayanan
Ram Prasadh Narayanan am 11 Aug. 2022
Bearbeitet: Benjamin Thompson am 11 Aug. 2022
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.

Antworten (1)

Benjamin Thompson
Benjamin Thompson am 11 Aug. 2022
Bearbeitet: Benjamin Thompson am 11 Aug. 2022
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

Kategorien

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

Tags

Produkte


Version

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by