Program_2_1.m
资源名称:speech.rar [点击查看]
上传用户:ay_070428
上传日期:2014-12-04
资源大小:11427k
文件大小:1k
源码类别:
语音合成与识别
开发平台:
Matlab
- % Program_2_1
- % Generation of complex exponential sequence
- %
- clf;
- a = input('Type in real exponent = ');
- b = input('Type in imaginary exponent = ');
- c = a + b*i;
- K = input('Type in the gain constant = ');
- N = input ('Type in length of sequence = ');
- % Generate the sequence
- n = 0:N-1;
- x = K*exp(c*n);
- % Plot the real and imaginary parts
- subplot(2,1,1);
- stem(n,real(x));grid
- xlabel('Time index n');ylabel('Amplitude');
- title('Real part');
- subplot(2,1,2);
- stem(n,imag(x));grid
- xlabel('Time index n');ylabel('Amplitude');
- title('Imaginary part')