?? 新建 文本文檔 (2).txt
字號:
clear
echo on
t0=2; %信號持續(xù)時間
ts=0.001;%抽樣時間
fc=100;%載波頻率
fs=1/ts;
df=0.3;%頻率分辨力
t=[-t0/2:ts:t0/2];
x=sin(200*t);m=x;
m(1001);
c=cos(2*pi*fc.*t);%定義載波同向分量
b=sin(2*pi*fc.*t);%定義載波正交分量
v=m.*c+imag(hilbert(m)).*b;%計算出下邊帶調(diào)幅分量
u=m.*c-imag(hilbert(m)).*b;%計算出上邊帶調(diào)幅分量
[M,m,df1]=fftseq(m,ts,df);%傅立葉變換
M=M/fs;
[U,u,df1]=fftseq(u,ts,df);%傅立葉變換
U=U/fs;
[V,v,df1]=fftseq(v,ts,df);%傅立葉變換
V=v/fs;
f=[0:df1:df1*(length(m)-1)]-fs/2;
pause;clf
subplot(2,2,1)
plot(t,m(1:length(t)));axis([-0.1,0.1,-0.5,1.1])
xlabel('時間');title('未調(diào)信號')
pause;subplot(2,2,2)
plot(t,c(1:length(t)));axis([-0.1,0.1,-1.5,1.5])
xlabel('時間');title('載波')
pause;subplot(2,2,3)
plot(t,u(1:length(t)));%做出上邊帶信號波形
axis([-0.2,0.2,-1,1.2]);
xlabel('時間');title('上邊帶已調(diào)信號')
pause;sublot(2,2,4)
plot(t,v(1:length(t)));%做出下邊帶波形
axis([-0.2,0.2,-1,1.2])
xlabel('時間');title('下邊帶已調(diào)信號')
pause;subplot(2,1,1)
plot(f,abs(fftshift(M)))
xlabel('頻率');title('未調(diào)信號的頻譜')
pause;subplot(2,1,1)
plot(f,abs(fftshift(U)))
title('上邊帶已調(diào)信號頻譜');xlabel('頻率');
subplot(2,1,2);plot(f,abs(fftshift(V)))
title('下邊帶已調(diào)信號頻譜');xabel('頻率')
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -