フィルターのクリア

How do I do FFT for small amount of points?

2 ビュー (過去 30 日間)
Joseph Schmidt
Joseph Schmidt 2016 年 12 月 10 日
コメント済み: Walter Roberson 2016 年 12 月 10 日
I have a small amount of data points X=[8 7 2 4 5 1] that I want to perform FFT for in order to find the trig functions that compose this repeating pattern. Is there an easy way to code this? I've seen a bunch of code that works for continuous samples of waves but I want to downsize it.

回答 (2 件)

Walter Roberson
Walter Roberson 2016 年 12 月 10 日
fft(X)
is happy to work with small number of points

Joseph Schmidt
Joseph Schmidt 2016 年 12 月 10 日
Ok I got the code to work but I'm not sure how to extract the frequency of the wave and amplitudes. Here is my code so far:
Fs = 1000; % Sampling frequency
T = 1/Fs; % Sampling period
L = 1000; % Length of signal
t = (0:L-1)*T; % Time vector
X = [2 2 1 0 0 1];
for i = 1:10
X = horzcat(X, X);
end
%plot(X);
Y = fft(X);
%plot(Y);
mag_Y = abs(Y)
plot(mag_Y);
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 12 月 10 日
See the first example in the fft documentation as that shows how to label the x axis with frequency

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeFourier Analysis and Filtering についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by