[英]MATLAB - Using fm demod to decode data
I am trying to extract a sinusoid which itself has a speed which changes sinusiodially. 我试图提取一个正弦曲线,它本身的速度会发生正弦变化。 The form of this is approximately sin (a(sin(b*t))), a+b are constant.
其形式近似为sin(a(sin(b * t))),a + b是常数。
This is what I'm currently trying, however it doesnt give me a nice sin graph as I hope for. 这是我目前正在尝试的方法,但是它并没有像我希望的那样给我一个很好的正弦图。
Fs = 100; % Sampling rate of signal
Fc = 2*pi; % Carrier frequency
t = [0:(20*(Fs-1))]'/Fs; % Sampling times
s1 = sin(11*sin(t)); % Channel 1, this generates the signal
x = [s1];
dev = 50; % Frequency deviation in modulated signal
z = fmdemod(x,Fc,Fs,fm); % Demodulate both channels.
plot(z);
Thank you for your help. 谢谢您的帮助。
There is a bug in your code, instead of: 您的代码中有一个错误,而不是:
z = fmdemod(x,Fc,Fs,fm);
You should have: 你应该有:
z = fmdemod(x,Fc,Fs,dev);
Also to see a nice sine graph you need to plot s1
. 另外,要查看漂亮的正弦图,您需要绘制
s1
。
It looks like you are not creating a FM signal that is modulated correctly, so you can not demodulate it correctly as well using fmdemod
. 似乎您没有创建正确调制的FM信号,因此您也无法使用
fmdemod
正确解调该fmdemod
。 Here is an example that does it correctly: 这是一个正确执行此操作的示例:
Fs = 8000; % Sampling rate of signal
Fc = 3000; % Carrier frequency
t = [0:Fs]'/Fs; % Sampling times
s1 = sin(2*pi*300*t)+2*sin(2*pi*600*t); % Channel 1
s2 = sin(2*pi*150*t)+2*sin(2*pi*900*t); % Channel 2
x = [s1,s2]; % Two-channel signal
dev = 50; % Frequency deviation in modulated signal
y = fmmod(x,Fc,Fs,dev); % Modulate both channels.
z = fmdemod(y,Fc,Fs,dev); % Demodulate both channels.
If you find thr answers useful you can both up-vote them and accept them, thanks. 如果您发现这些答案有用,则可以同时投票接受它们,谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.