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.
8 次查看(过去 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
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?
采纳的回答
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 个评论
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Multirate Signal Processing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!