1

我正在尝试这个 matlab 代码,但我不断收到错误消息。有什么提示吗?

%Frequency Demodulation
f_fmCarrier=1000; %frequency of FM carrier signal
f_sampling=f_fmCarrier*2; %frequency of sampling
recordFmModulatedSignal=audiorecorder(f_sampling,16,1,1);
recordblocking(recordFmModulatedSignal,5);
rFmModulatedSignal=getaudiodata(recordFmModulatedSignal);
figure(2)
subplot(3,1,1);
plot(rFmModulatedSignal,'b');
title('Recieved FM Modulated signal');
xlabel('Seconds');
ylabel('Amplitude');
fmMessageSignal=fmdemod(rFmModulatedSignal,f_fmCarrier,f_sampling,mod_index*f_fmMessageSignal);
subplot(3,1,2);
plot(fmMessageSignal,'r');
title('Demodulated signal by using fmdemod command');
xlabel('Seconds');
ylabel('Amplitude');
B_fm=fir1(401,2*(f_fmMessageSignal/f_sampling));% lowpass filter of order 401 & frequency
fmMessageSignal2=filter(B_fm,1,fmMessageSignal);
subplot(3,1,3);
plot(fmMessageSignal2,'m');
title('Demodulated signal by using a lowpass filter');
xlabel('Seconds');
ylabel('Amplitude');

错误:

Undefined function 'fmdemod' for input arguments of type 'double'.

Error in project2 (line 32)
fmMessageSignal=fmdemod(rFmModulatedSignal,f_fmCarrier,f_sampling,mod_index*f_fmMessageSignal);
4

1 回答 1

1

fmdemod不是 MATLAB 中的内置函数,因此会出现错误。具体来说,它位于通信系统工具箱中,您似乎没有。

您需要自己编写或找到符合上述代码段所需接口的实现。这是工具箱中版本的在线文档

于 2015-05-12T12:17:28.247 回答