📄 pr6_50.m
字号:
%Problem 6.50;
% modified minimax sequences;
a=input('input m- or Legendre sequence, a=');
N=length(a); %length of the code;
t=[-1:N+1]; %time scale;
a(1)=-1; a=[a(N),a,a(1:2)]; %continue initial sequence to have convenient plotting;
b=[];
b(1,:)=(a+(1+sqrt(N+1))/N)/(1+(1+sqrt(N+1))/N); b(2,:)=(a+i/sqrt(N))/(1+i/sqrt(N)); %forming modified sequences;
for k=1:2
subplot(2,2,k); stairs(t,[a;real(b(k,:))]'); %plotting initial and modified sequences: for the complex only real part plotted;
ylabel('sequence'); xlabel('t/\Delta'); xlim([-1,N+1]); ylim([-1.2,1.2]); legend('intl','mdfd'); grid;
c=a(1:N); d=b(k,1:N); Ra=real([xcorr(c)/(c*c'); xcorr(d)/(d*d')]); Rp=[Ra(:,N:end),zeros(2,1)]+[zeros(2,1),Ra(:,1:N)]; %calculating PACF of initial and modified sequences;
Rp=[Rp(:,N-1),Rp,Rp(:,2)]; %extendng PACF to have a convenient plot;
subplot(2,2,k+2); plot(t,Rp'); %plotting periodic ACFs of initial and modified sequences;
ylabel('PACF'); xlabel('\tau/\Delta'); xlim([-1,N+1]); ylim([-0.2,1.2]); legend('intl','mdfd'); grid;
end;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -