www.pudn.com > tiaopin_maichongxinhao-.zip > fh_signal1.m, change:2013-02-27,size:1017b


clc; 
clear; 
hs_B=1000;%M 跳频信号的带宽 
fs=4000;%采样频率 
observe_time=0.002;%s 
hop_v=10000;%hop/s 
hop_T=1/hop_v;%每一跳的驻留时间 
sample_hop=hop_T*fs;%每跳的采样点数 
signal_B=5.12;%信号带宽 
num_hopfre=floor(hs_B/signal_B);%跳频频率总频点数 
hsf_gap=hs_B/num_hopfre; 
for i=1:num_hopfre 
    hs_f(i)=19700+(i-1)*hsf_gap; 
end 
%产生m9随机序列,初始值去000000001,寄存器系数为1021(八进制表示) 
m=[0 0 0 0 0 0 0 0 1]; 
for i=1:511 
    x(i)=m(9); 
    temp=mod(m(5)+m(9),2); 
    m(2:9)=m(1:8); 
    m(1)=temp; 
    f_dot(i)=m(1)*2^8+m(2)*2^7+m(3)*2^6+m(4)*2^5+m(5)*2^4+m(6)*2^3+m(7)*2^2+m(8)*2+m(9); 
    if f_dot(i)>num_hopfre 
        f_dot(i)=f_dot(i)-num_hopfre; 
    end 
    hop_f(i)=hs_f(f_dot(i)); 
end 
hop_num=observe_time/hop_T; 
f_end=[]; 
for i=1:hop_num 
    f_end_1(i)=hop_f(i); 
    f_end_2=ones(1,sample_hop)*f_end_1(i); 
    f_end=[f_end f_end_2]; 
end 
plot(f_end,'b .'); 
axis([0 length(f_end) 19700 22000]); 
title('跳频图案') 
xlabel('sample'); 
ylabel('frequency/MHz');