J = sqrt(-1);
x3 = [ 1+2*J 3+4*J 5+3*J 3+4*J 6+1*J 8+2*J 3+3*J 9+2*J];
x4 = [ 4+1*J 6+4*J 4+3*J 3+4*J 7+1*J 8+3*J 3+4*J 1+2*J];
x_sum = 2*x3 + 6*x4;
fft_x_sum = fft( x_sum, 8 ); % 序列之和的FFT
fft_x3 = fft( x3, 8 );
fft_x4 = fft( x4, 8 );
figure(3);
subplot(3,2,1);
stem( x_axis, abs(fft_x_sum) );
title( '序列之和的幅度谱' );
subplot(3,2,2);
stem( x_axis, angle(fft_x_sum) );
title( '序列之和的相位谱' );
fft_sum = 2*fft_x3 + 6*fft_x4; % 序列FFT 的和
subplot(3,2,3);
stem( x_axis, abs(fft_sum), 'k*' );
title( '序列DFT 之和的幅度谱' );
subplot(3,2,4);
stem( x_axis, angle(fft_sum), 'k*' );
title( '序列DFT 之和的相位谱' );
figure(3);
subplot(3,2,5);
stem( x_axis, abs(fft_x_sum) ); hold on;
stem( x_axis, abs(fft_sum), 'k.' );
xlabel( '频率 k' ); ylabel( '幅度' );
title( '幅度谱' );
subplot(3,2,6);
stem( x_axis, angle(fft_x_sum) ); hold on;
stem( x_axis, angle(fft_sum), 'k.' );
xlabel( '频率 k' ); ylabel( '相位(弧度)' );
title( '相位谱' );
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%