?? ch5example8prog2.m
字號:
% ch5example8prog2.m
clear;
Fs=10000; % 仿真的采樣率
t=1/Fs:1/Fs:1; % 仿真時間點
m_t(Fs*1)=0; % 基帶信號變量初始化
for F=150:400 % 基帶信號發生:頻率150Hz~400Hz
m_t=m_t+0.003*sin(2*pi*F*t)*(400-F); % 幅度隨線性遞減
end
m_t90shift=imag(hilbert(m_t)); % 基帶信號的希爾伯特變換
carriercos=cos(2*pi*1000*t); % 1000Hz載波 cos
carriersin=sin(2*pi*1000*t); % 1000Hz正交載波 sin
s_SSB1=m_t.*carriercos-m_t90shift.*carriersin; % 上邊帶SSB
out=s_SSB1.*cos(2*pi*1018*t+1);% 存在頻率誤差的相位誤差時的相干解調
[a,b]=butter(4, 500/(Fs/2)); % 低通濾波器設計4階,截止頻率為500Hz
demodsig=filter(a,b,out); % 解調輸出
% 下面作出各波形以及頻譜
figure(1);
subplot(3,2,1); plot(t(1:100),s_SSB1(1:100)); % SSB波形
subplot(3,2,2); plot([0:9999],abs(fft(s_SSB1))); % SSB頻譜
axis([0 5000 -500 6000]);
subplot(3,2,3); plot(t(1:100),out(1:100)); % 相干解調波形
subplot(3,2,4); plot([0:9999],abs(fft(out))); % 相干解調頻譜
axis([0 3000 -500 6000]);
subplot(3,2,5); plot(t(1:100),demodsig(1:100)); % 低通輸出信號
subplot(3,2,6); plot([0:9999],abs(fft(demodsig)));% 低通輸出信號的頻譜
axis([0 3000 -500 6000]);
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -