gusucode.com > matlab通信工程仿真源码(张德丰等编著)程序书籍 > matlab_code/matlab通信工程仿真源码(张德丰等编著)/第8章/li8_6.m
Fs=10000; %仿真的采样率 t=1/Fs:1/Fs:1; %仿真时间点 m_t(Fs*1)=0; %基带信号变量初始化 for f=150:400 %基带信号发生:频率150~400Hz m_t=m_t+0.01*sin(2*pi*f*t)*(400-f);%幅度随线性递减 end m_t90shift=imag(hilbert(m_t)); %基带信号的希伯尔特变换 carriercos=cos(2*pi*1000*t); %1000载波cos carriersin=sin(2*pi*1000*t); %1000Hz正交载波sin S_SSB1=m_t.*carriercos-m_t90shift.*carriersin; %上边带SSB S_SSB2=m_t.*carriercos+m_t90shift.*carriersin; %下边带SSB %下面作出各波形以及频谱 figure; subplot(421); plot(t(1:100),carriercos(1:100),t(1:100),carriersin(1:100),':m');%载波 subplot(422); plot([0:9999],abs(fft(carriersin)));%载波频谱 axis([0 2000 -500 12000]); subplot(423); plot(t(1:100),m_t(1:100)); %基带信号 subplot(424); plot([0:9999],abs(fft(m_t)));%基带频谱 axis([0 2000 -500 12000]); subplot(425); plot(t(1:100),S_SSB1(1:100)); %SSB波形上边带 subplot(426); plot([0:9999],abs(fft(S_SSB1))); %SSB波形上边带 axis([0 2000 -500 12000]); subplot(427); plot(t(1:100),S_SSB2(1:100)); %SSB波形下边带 subplot(428); plot([0:9999],abs(fft(S_SSB2))); %SSB波形下边带 axis([0 2000 -500 12000]);