forked from 2417677728/OFDM
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathshift.m
More file actions
22 lines (17 loc) · 671 Bytes
/
Copy pathshift.m
File metadata and controls
22 lines (17 loc) · 671 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
function [outregi] = shift(inregi,shiftr)
% ****************************************************************
% inrege : 输入序列
% shiftr : 循环右移的位数
% outregi : 输出序列
% ****************************************************************
v = length(inregi);
outregi = inregi;
shiftr = rem(shiftr,v);
if shiftr > 0
outregi(:,1:shiftr) = inregi(:,v-shiftr+1:v); %循环移位
outregi(:,1+shiftr:v) = inregi(:,1:v-shiftr);
elseif shiftr < 0
outregi(:,1:v+shiftr) = inregi(:,1-shiftr:v);
outregi(:,v+shiftr+1:v) = inregi(:,1:-shiftr);
end
%******************************** end of file ********************************