《DSP using MATLAB》示例Example5.12

时间:2021-05-22 05:53:00

《DSP using MATLAB》示例Example5.12

代码:

n = 0:10; x = 10*(0.8) .^ n; y = cirshftt(x,6,15);
n = 0:14; x = [x, zeros(1,4)];
%% -----------------------------------------------------------------
%% START a
%% -----------------------------------------------------------------
figure('NumberTitle', 'off', 'Name', 'Exameple5.12 ')
set(gcf,'Color','white');
subplot(2,1,1); stem(n,x); title('Original sequence x(n)'); axis([-1,15,-1,11]);
xlabel('n'); ylabel('x(n)'); grid on;
subplot(2,1,2); stem(n,y); title('Circularly shifted sequence , N = 15'); axis([-1,15,-1,11]);
xlabel('n'); ylabel('x((n-6) mod 15'); grid on; %% -----------------------------------------------------------------
%% END a
%% -----------------------------------------------------------------

  运行结果:

《DSP using MATLAB》示例Example5.12