• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
清风醉明月 slp_art
博客园    首页    新随笔    联系   管理    订阅  订阅

序列循环移位

image

function m = mod(n,N)
%computes m = mod(n mod N)
%___________________
%m = mod(n,N)
m = rem(n,N);
m = m+N;
m = rem(m,N);

function y = cirshiftt(x,m,N)
%circular shift of  m samples wrt size N in sequnce x:
%-----------------------------------------------------
%[y] = cirshiftt(x,m,N)
%y = output sequence containing the circular shift
%;x = input sequence of length <= N
% m = simple shift
% N = size of circular buffer
% method: y(n)=x((n-m) mod N)
% check for length of x
if length (x)> N
        error('N must be >= the length of X')
end
x = [x ,zeros(1,N - length(x))];
n = [0:1:N-1];
n = mod(n-m,N);
y = x(n+1);

n = 0:10 ;
x = 10*(0.8).^n;
y = cirshiftt(x,6,15);
n = 0: 14;
x = [x,zeros(1,4)];
subplot(2,1,1);
stem(n,x);
title('oringnal signal');
subplot(2,1,2);
stem(n,y);
title('x((n-m) mod 15)');

posted @ 2011-07-02 15:59  清风醉明月 slp_art  阅读(1188)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3