?? 2psk信號波形及其功率譜.txt
字號:
%2PSK
clear all;
close all;
A=1;
fc=3; %3Hz
N_sample=8; %取樣數
N=500; %碼元數
Ts=1; %1Baud/s
dt=Ts/fc/N_sample; %波形采樣間隔
t=0:dt:N*Ts-dt;
Lt=length(t);
%產生二進制信源
d=sign(randn(1,N));
dd=sigexpand((d+1)/2,fc*N_sample); %sigexpand的功能是把短序列擴展成長序列
gt=ones(1,fc*N_sample); %NRZ波形
ht=A*cos(2*pi*fc*t);
figure(1)
subplot(211); %輸入NRZ信號波形(單極性)
d_NRZ=conv(dd,gt);
plot(t,d_NRZ(1:length(t)));
axis([0 10 0 1.2]);grid
ylabel('輸入信號');
d_2psk=2*d_NRZ-1;
s_2psk=d_2psk(1:Lt).*ht;
subplot(212)
plot(t,s_2psk);
axis([0 10 -1.2 1.2]);grid
ylabel('2psk');
figure(2)
subplot(211); %輸入NRZ頻譜
[f,d_NRZf]=T2F(t,d_NRZ(1:length(t))); %T2F的功能是實現二進制序的傅立葉變換
plot(f,10*log10(abs(d_NRZf).^2/Ts));
axis([-15 15 0 30]);grid
ylabel('輸入信號功率譜密度');
subplot(212)
[f,s_2pskf]=T2F(t,s_2psk);
plot(f,10*log10(abs(s_2pskf).^2/Ts));
axis([-15 15 0 30]);grid
ylabel('2PSK功率譜密度');
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -