我想找到FM信号的相位。消息信号的Matlab代码是
m= ones(1,Fs);
m= [m(1:round(.4*Fs))*1, m(round(.4*Fs)+1:round(.7*Fs))*-2 ...
m(round(.7*Fs)+1:Fs)*0];
如何找到FM信号的相位?
答案 0 :(得分:0)
您的代码需要进行以下更正:
Kf=50; %%% increase Kf no notice effect
Fc=400;
Fs=5000; %%% Increase Fs. Nyquist criterion!
t=linspace(0,1,Fs);
m= ones(1,Fs);
m= [m(1:round(.4*Fs))*1 m(round(.4*Fs)+1:round(.7*Fs))*-2 m(round(.7*Fs)+1:Fs)*0];
fi_t =2*pi*Kf*cumtrapz(t,m);%%% use cumtrapz, not cum. Reverse order
u=10*cos(2*pi*Fc*t+fi_t);
plot(t,u);