this 1_20mhz.csv data is time domain signal
one of vector means time and the last one is Voltage of the signal
i want to change this csv data to fft in matlab
(time, voltage) -> (frequency , magnitude)

 採用された回答

Chunru
Chunru 2021 年 12 月 5 日
編集済み: Chunru 2021 年 12 月 5 日

1 投票

x = readmatrix("1_20mhz.csv");
n = size(x, 1);
fs = 1/diff(x(1:2)) % sampling frequency
fs = 5.0000e+07
y = fft(x(:,2));
f = (0:n-1)/n*fs;
%plot(f, abs(y))
plot(f/1e6, 20*log10(abs(y)))
xlabel('f(MHz)'); ylabel('Amp (dB)'); grid on
xlim([1.9 20])

4 件のコメント

Kyong Sun Bae
Kyong Sun Bae 2021 年 12 月 5 日
thank you very much, but i have a question.
the csv file '1_20mhz' is from analog discovery2 at digilent, and the fft graph of the 1_20mhz is that png file.
your answer and below photo is different.
Chunru
Chunru 2021 年 12 月 5 日
Use the log scale for amplitude and use the comparable xlim to achieve the similar result. See the updated answer above.
Kyong Sun Bae
Kyong Sun Bae 2021 年 12 月 5 日
holy moly i love you so much!! thank you very much
Kyong Sun Bae
Kyong Sun Bae 2021 年 12 月 5 日
but i want to before answer that you replied
can you bring me the code that you replied first at my question?

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeFourier Analysis and Filtering についてさらに検索

製品

リリース

R2021a

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by