cos4qam.m
来自「qam的matlab程序。m文件」· M 代码 · 共 28 行
M
28 行
%cos4qam.m: Costas loop for 4qam scale factor test
%crj jr, revised 12/26/02
clear all
clf
% create +/-1 sequence
s1=sign(rand([1,100])-0.5); N=length(s1);
s2=sign(rand([1,100])-0.5);
% zero pad T-spaced symbol sequence to create upsampled T/M-spaced
% sequence of scaled T-spaced pulses (with T = 1 time unit)
M=100; mup1=zeros(1,N*M); mup1(1:M:end)=s1;
mup2=zeros(1,N*M); mup2(1:M:end)=s2;
unp=hamming(M); %unnormalized pulse shape
%unp=srrc(10,0.3,M,0);
%unp=ones(1,M);
p=sqrt(M)*unp/sqrt(sum(unp.^2)); %normalized pulse shape
m1=filter(p,1,mup1); % convolve pulse shape with data
m2=filter(p,1,mup1); % convolve pulse shape with data
figure(1), plotspec(m1,1/M) % baseband signal spectrum
figure(2), plotspec(m2,1/M) % baseband signal spectrum
yo=8*sum((m1.^2).*(m2.^2))/length(m1);
yoyo=sum(((m1.^2)+(m2.^2)).^2)/length(m1);
average_scale_factor=yo-yoyo
terms_ratio=yo/yoyo
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?