无法在OCTAVE中执行amdemod

问题描述 投票:0回答:2

我发现以下代码可以进行AM mod和demod的实验。但是我不能以八度运行。卡在过滤的解调器上,因为八度表示格式不同。以及如何将它们绘制到频率域。代码如下

% Parameters
Fs = 44100;
T  = 1;
Fc = 15000;
Fm = 10;

% Low-pass filter design
[num,den] = butter(10,1.2*Fc/Fs); 

% Signals
t = 0:1/Fs:T;
x = cos(2*pi*Fm*t);
y = ammod(x,Fc,Fs);
z = amdemod(y,Fc,Fs);
w = amdemod(y,Fc,Fs,0,0,num,den); 

% Plot
figure('Name','AM Modulation');
subplot(4,1,1); plot(t,x); title('Modulating signal');
subplot(4,1,2); plot(t,y); title('Modulated signal');
subplot(4,1,3); plot(t,z); title('Demodulated signal');
subplot(4,1,4); plot(t,w); title('Demodulated signal (filtered)');
matlab signals octave
2个回答
0
投票

ammod(https://octave.sourceforge.io/communications/function/ammod.html)位于八度软件包“通讯”中,您可能必须安装或加载。您可以在https://octave.sourceforge.io/communications/index.html上找到该软件包,并在https://octave.org/doc/interpreter/Installing-and-Removing-Packages.html上找到安装任何软件包的说明。


0
投票

在Octave中,包amdemod中的communications仅允许恰好三个输入参数,使用type amdemod时可以查看它们:

© www.soinside.com 2019 - 2024. All rights reserved.