?? ppm_th.m
字號:
%function ppm_th
%ppm_th 跳時脈沖位置調制模擬
%seq 輸入序列,已重復編碼
%fc 采樣頻率
%tc 碼片時間,即跳時碼調制時所乘的時間長度
%ts 重復編碼周期
%dppm ppm調制偏移
%thcode th跳時碼
%thseq 僅有th調制時的輸出脈沖位置
%ppmthseq ppm+th調制時的輸出脈沖位置
function [ppmthseq,thseq]=ppm_th(seq,fc,tc,ts,dppm,thcode)
%step1 implementation of the 2ppm_th modulator
dt=1./fc; %采樣周期
framesamples=floor(ts./dt); %一個脈沖的長度
chipsamples=floor(tc./dt); %跳時碼片的采樣點數
ppmsamples=floor(dppm./dt); %ppm偏移的長度
thp=length(thcode); %跳時碼周期
totlength=framesamples*length(seq); %總采樣點數
ppmthseq=zeros(1,totlength);
thseq=zeros(1,totlength);
%step2 main loop for introducing th and 2ppm
%對每一個輸入比特計算相應脈沖的位置
for k=1:length(seq)
index=1+(k-1)*framesamples; %未調制前脈沖所處位置
%引入th調制
kth=thcode(1+mod(k-1,thp)); %按順序從跳時碼中取出對應的跳時值,在取完后循環至跳時序列的開始
index=index+kth*chipsamples
thseq(index)=1;
%引入2ppm調制
index=index+ppmsamples*seq(k);
ppmthseq(index)=1;
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -