downsample data use fft question

I have some question. For example.
The original signal X has 100000 points, the sample rate is 2kHz;
but the output signal Y has 2000 points, the value of each point is the mean of origin signal per 50 points.
How should I calculate the Fast Fourier Transform? My sample rate becomes 40Hz?
If we don't have original data, do I need to use downsample or upsample?
This is my code:
Fs = 40;
N = length(Y);
n = 2^nextpow2(N);
X_fft = fft(Y,n);
mag = abs(Y_fft);
f = Fs*(0:(N/2))/N;
plot(f,mag(1:N/2+1))
Is that correct
Thanks

3 件のコメント

Star Strider
Star Strider 2017 年 10 月 22 日
If you want to downsample your data, use the Signal Processing Toolbox resample (link) function.
HuanChinag Lin
HuanChinag Lin 2017 年 10 月 22 日
my data Y has been downsampled,if I want to analysis the original data X by using data Y,is my code correct?
Star Strider
Star Strider 2017 年 10 月 22 日
I cannot run your code.
I prefer the calculations in this version of the fft (link) documentation.

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

回答 (0 件)

カテゴリ

タグ

質問済み:

2017 年 10 月 22 日

編集済み:

2017 年 10 月 22 日

Community Treasure Hunt

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

Start Hunting!

Translated by