FFT of a Superposition signal

조회 수: 5 (최근 30일)
Ram Prasadh Narayanan
Ram Prasadh Narayanan 2022년 8월 11일
편집: Benjamin Thompson 2022년 8월 11일
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

카테고리

Help CenterFile Exchange에서 Discrete Fourier and Cosine Transforms에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by