Question regarding signal sampling/reconstruction
이전 댓글 표시
Hello all, So I have this signal I need to plot in Matlab, and I have a few issues with creating the time line I guess. This is the code:
f_m1=400;
fm=10*f_m1;
fs=10*fm;
ts=1/fs;
t=0:ts:0.005;
%t=linspace(0,0.005,5000);
f1=400;
m_f=cos(2*pi*f_m1*t)+cos(20*pi*f_m1*t)-(f_m1/f1)*sin(2*pi*f_m1*t)-(10*f_m1/f1)*sin(20*pi*f_m1*t);
plot(t,m_f); grid on
xlabel('Time')
ylabel('m_f(t)')
title('m_f(t)')
You can see I used 2 ways to construct a time scale, one with a simple colon operator and one with linsapce
The nyquist freq for this signal should be 2*fm, and then using that i should be able to plot the signal correctly, but using that scale, im getting a very jagged function, with a smaller amplitude as well. Only at 3*fm im getting a correct amplitude, and only at around 10*fm im getting a smooth a function as using the linspace. Why is that?
Also, how do I know to convert the number of samples in the linsapce (this case being 5000) to a sampling frequency, and vice versa?
Thanks to any who help :)
답변 (1개)
Star Strider
2014년 12월 17일
0 개 추천
The Nyquist frequency is fn=fs/2, so by my calculations, with fs=10*fm, fn=5*fm.
댓글 수: 4
Moran
2014년 12월 17일
Star Strider
2014년 12월 17일
The Nyquist frequency is the highest reliably resolvable frequency in a sampled signal. It is half the sampling frequency.
As I understand your Question and Comment, if the maximum frequency of your signal is 4KHz, you have to sample it at at least 8KHz in order to resolve the highest frequency in your signal. However, the Nyquist frequency remains half your sampling frequency, regardless of what it is. If you decide to sample it at 10KHz, the Nyquist frequency is then 5KHz even if there is nothing above 4KHz in your signal.
Moran
2014년 12월 18일
Star Strider
2014년 12월 18일
It’s difficult for me to understand what you want to do in your code. It runs without error, and since I don’t know what it’s doing that you don’t want it to do (or not doing that you do), or what you intend your code to do, all I can do is address your concerns about the Nyquist frequency.
Note that ‘fs’ is 40KHz:
f_m1=400;
fm=10*f_m1;
fs=10*fm;
ts=1/fs;
카테고리
도움말 센터 및 File Exchange에서 Spline Postprocessing에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!