《DSP using MATLAB》Problem5.23

代码:
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
%% Output Info about this m-file
fprintf('\n***********************************************************\n');
fprintf(' <DSP using MATLAB> Problem 5.23 \n\n');
banner();
%% ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
% -------------------------------------------------------------------
%
%
% -------------------------------------------------------------------
n = [0:6];
x = [1, 2, -3, 4, -5, 0, 0];
N = 7;
x_cir_fold = x(mod(-n, N)+1);
m = -1;
y = cirshftt(x_cir_fold, m, 7);
ny = [0:6];
figure('NumberTitle', 'off', 'Name', 'P5.23 x(n) x((-n)) x((-8-n))')
set(gcf,'Color','white');
subplot(3,1,1); stem(n, x);
xlabel('n'); ylabel('x');
title('x(n), N=7'); grid on;
subplot(3,1,2); stem(n, x_cir_fold);
xlabel('n'); ylabel('');
title('x((-n)), N=7'); grid on;
subplot(3,1,3); stem(ny, y);
xlabel('n'); ylabel('y');
title('x((-8-n)), N=7'); grid on;
运行结果:


牢记:
1、如果你决定做某事,那就动手去做;不要受任何人、任何事的干扰。2、这个世界并不完美,但依然值得我们去为之奋斗。

浙公网安备 33010602011771号