《DSP using MATLAB》示例Example5.19
代码:
n = 0:9; x = n+1; h = [1,0,-1]; N = 6; y = ovrlpsav(x,h,N); nh = 0:1:length(h)-1; ny = 0:1:length(y)-1; %% ----------------------------------------------------------------- %% START a %% ----------------------------------------------------------------- figure('NumberTitle', 'off', 'Name', 'Exameple5.19 ') set(gcf,'Color','white'); subplot(3,1,1); stem(n,x); title('sequence x(n)'); %axis([0,5,0,5]); xlabel('n'); ylabel('x(n)'); grid on; subplot(3,1,2); stem(nh,h); title('impulse sequence h(n)'); %axis([0,5,0,5]); xlabel('n'); ylabel('h(n)'); grid on; subplot(3,1,3); stem(ny,y); title('Linear Convolution sequence x3(n)'); %axis([0,10,-3,5]); xlabel('n'); ylabel('y(n)'); grid on; %% ----------------------------------------------------------------- %% END a %% -----------------------------------------------------------------
运行结果:
牢记:
1、如果你决定做某事,那就动手去做;不要受任何人、任何事的干扰。2、这个世界并不完美,但依然值得我们去为之奋斗。