I want to determine the magnitude and phase of 100kHz Sinusoidal in a given signal when the sampling rate is 15MHz and when the signal has 32768 samples.

3 ビュー (過去 30 日間)
the code I used is as follows. Around 100kHz. Phase changes from 160 degrees (@99.79kHz) to -18 degrees (@101.2kHz). How can I adjust settings to correctly add 100kHz frequency point instead of 99.79kHz and 101.2kHz?
FFT_V_in = 2*fft(DAQSig(2,:))/n;
FFT_V_in_mag = (abs(FFT_V_in));
FFT_V_in_phase = angle(FFT_V_in);
fs=15000000
f = (0:n-1)*fs/n;
subplot(2,1,1)
plot(f,1000*FFT_V_in_mag)
ylabel('V_{in} (mV)')
ytickformat('%.2f')
title('Magnitude')
subplot(2,1,2)
plot(f,FFT_V_in_phase*180/pi)
ytickformat('%.2f')
ylabel('V_{in} (degree)')
title('Phase')
The output is as follows
  2 件のコメント
David Goodmanson
David Goodmanson 2018 年 7 月 19 日
Hi Arjuna,
kind of depends. Is your time domain signal pretty much the same amplitude all the way across, or does it die out at the beginning and the end?
Arjuna Weerasinghe
Arjuna Weerasinghe 2018 年 7 月 19 日
amplitude is the same from the beginning to the end.

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

採用された回答

Aquatris
Aquatris 2018 年 7 月 19 日
編集済み: Aquatris 2018 年 7 月 19 日
When you do an FFT, you basically assign magnitudes to each frequency. The frequency points are usually called bins and are determined by your sampling frequency and length of your signal. For instance, if your sampling frequency is 1000 Hz and you have 5000 samples, then the frequencies in the fft will be integer multiples of 1000/5000 = 0.2 Hz.
So to answer your question, if you were to adjust your Fs/N ratio (sampling rate/ length of the signal) to be 1, 0.1,10,100, you will get 100 Hz in your data instead of 99.76 Hz. This is most easily done by adjusting the length of your data rather than changing the sampling frequency.
For your data, you can use the first 30000 samples instead of 32768 and it should give you what you need (data at every 500 Hz, including 100 kHz).
  4 件のコメント
Aquatris
Aquatris 2018 年 7 月 19 日
編集済み: Aquatris 2018 年 7 月 19 日
Yes, it basically truncates the data (if data has more than n samples) so that data only has n samples.
Arjuna Weerasinghe
Arjuna Weerasinghe 2018 年 7 月 19 日
Yeah! Thnks for your time. saved my day! ?

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMultirate Signal Processing についてさらに検索

製品


リリース

R2017b

Community Treasure Hunt

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

Start Hunting!

Translated by