matlab
clear all
clc
Ucm=1;
Uomigm=1;
fomig=30;
fc=5000;
m=0.5;
N=fc*4;
k=0:N-1;
t=k/N;
ut=Uomigm*cos(2*pi*fomig*t);
% ut=sawtooth(2*pi*fomig*t,0.5);
% ut=square(2*pi*fomig*t);
uc=Ucm*cos(2*pi*fc*t);
% uam=Ucm.*(1+m.*Uomigm.*cos(2*pi*fomig*t)).*cos(2*pi*fc*t);
% uam=Ucm.*(1+m.*Uomigm.*ut).*cos(2*pi*fc*t);
% uam=uc+ut;
% udsb=uc.*ut;
fut=sym('ut');
ufm=Ucm*cos(2*pi*fc*t+1000*int(fut));
p1=fft(ut);
p2=fft(uc);
% p3=fft(uam);
% p3=fft(udsb);
if isSym(ufm)
ufm_double = double(subs(ufm, ut, ut_val));
else
ufm_double = ufm;
end
p3=fft(ufm_double);
subplot(3,2,1);plot(t,ut);title('调制信号');axis([0,0.1,-2,2]);
subplot(3,2,2);plot(abs(p1));axis([0,6000,0,30000]);title('调制信号频域');
subplot(3,2,3);plot(t,uc);title('载波信号');axis([0,0.1,-2,2]);
subplot(3,2,4);plot(abs(p2));axis([0,6000,0,30000]);title('调制信号频域');
subplot(3,2,5);plot(t,ufm_double);title('已调信号');axis([0,0.1,-2,2])
subplot(3,2,6);plot(abs(p3));axis([0,6000,0,30000]);title('调制信号频域');
函数或变量 'isSym' 无法识别。
出错 hahahaha (第 26 行)
if isSym(ufm)
^^^^^^^^^^^^^