资源简介
基于matlab的循环普算法,给出了各种仿真图,很详细
代码片段和文件信息
clear
clc
% bark1=[1111-1-1111-11-111111-1-1111-11-111111-1-1111-11-11-1111-11-11-1111-11-11];
bark1=[-11-11-1-11-11-11-11-11-11-1-11-11-11-1-11-1-11-1-11-11-11-11-11-11-11-11-1111-11-111111-1-1111-11-111111-1-1111-11-111111-1-1111-11-11-1111-11-11-1111-11-11];
bark=[bark1 bark1 bark1];
% length(bark)
% barklen=length(bark)
fs=1;%采样频率
Ts=1/fs;
fb=1/8;
Tb=1/fb;
% N=13*fs/fb;
N=1024;
for t=1:N
x(t) = bark(ceil(t/Tb));
end
% for t=1:20
% k=(t-1)*8+1;
% if x(k)==1
% x(k)=-1;
% else
% x(k)=1;
% end
% end
% for t=21:50
% k=(t-1)*8+1;
% if x(k)==1
% x(k)=-1;
% x(k+1)=-1;
% else
% x(k)=1;
% x(k+1)=1;
% end
% end
% for t=51:120
% k=(t-1)*8+1;
% if x(k)==1
% x(k)=-1;
% x(k+1)=-1;
% else
% x(k)=1;
% x(k+1)=1;
% end
% end
%
snr=10;
noise=randn(1N);
AN=sqrt(std(noise)^2*10^(snr/10));
x=AN*x+noise;
save phase x;
% [ba] = butter(50.65);
% x=filter(bax);
%%%%%%%%%%%%%%%%%%%%%%%%%%
%求循环谱%
%%%%%%%%%%%%%%%%%%%%%%%%%%
alpha_len=(-0.5:1/N:0.5-1/N);
M=N/16;
X=fft(x);
Y=X;
% figure(5);
% plot(abs(X));
X=fftshift(X);
figur
评论
共有 条评论