一、离散信号的产生。
数字信号处理一般构建在下图的架构中,以FPGA/DSP为核心,以ADC和DAC为桥梁处理外部的模拟信号。
其中FPGA/DSP都处理数字信号,数字信号是离散信号。
数字信号:时间、宽度都是离散的。
离散信号:时间离散,宽度可以是离散的或连续的。
二、基本的离散信号。
2.1、单位脉冲序列。
clear close all; clc; N=15; n=-N : N; x=zeros (1,2 * n1 ); x(n1 )=1; stem(n,x );
2.2、单位薪级序列。
clear close all; clc; N=15; n=-N : N; x=zeros (1,2 * n1 ); x(n1:2*n1 )=1; stem(n,x );
2.3、矩形序列。
clear close all; clc; N=15; M=5; n=-N : N; x=zeros (1,2 * n1 ); x(n1:n1m )=1; stem(n,x );
2.4、复指数序列。
clear close all; clc; N=15; n=-N : N; x=exp((-0.10.5I ) *pi*n/8 ); xreal=real(x; ximag=imag(x ); XABS=ABS(x; xangle=angle(x; subplot(221 ) stem(n ) n,xReal; subplot(222 ) stem(n,xImag ); subplot(223 ) stem(n,xAbs ); subplot(224 ) stem(n,xAngle );
将x变更为x=exp(0.5I*pi*n/8 )时
2.5、正弦序列。
clear close all; clc; N=15; n=-N : N; x=sin(0.5*pi*n/8 ); stem(n,x );
三、序列的基本运算。
3.1序列反演。
clear close all; clc; N=15; n=-N : N; x=Zeros(1,length(n ) n ); forI=1:5x(In )=i; endsubplot(211 ) stem(n ) n,x ); subplot(212 ) stem(n ) n,flip(x ) x );
3.2序列平移。
clear close all; clc; N=15; n=-N : N; x=Zeros(1,length(n ) n ); forI=1:5x(In )=i; endsubplot(211 ) stem(n ) n,x ); subplot(212 ) stem(n,circshift(x ) x,3 );
3.3数组插值。
clear close all; clc; N=15; n=-N : 1 : N; m=-N : 0.5 : N; x=Zeros(1,length(n ) n ); forI=1:3x(In )=i; endsubplot(211 ) stem(n ) n,x ); subplot(212 ) y=interp1(n,x,m,' nearst ' ); % linear,splinestem(m,y );
3.4序列提取。
clear close all; clc; N=15; M=3; n=-N : N; m=-N : M : N; x=Zeros(1,length(n ) n ); forI=1:10x(In )=i; endsubplot(211 ) stem(n ) n,x ); subplot(212 ) y=downsample(x ) x,m ); stem(m,y );
3.5系列卷积。
clear close all; clc; N=15; n=-N : N; m=-2*N : 2*N; x=Zeros(1,length(n ) n ); y=Zeros(1,length(n ) n ); forI=1:3x(In )=i; y(In )=1; endsubplot(311 ) stem(n ) n,x; subplot(312 ) stem(n ) n,y; subplot(313 ) stem(m ) m,conv(x ) x,y ); axis ([-15,15,0,10 ];
3.6序列自相关。
clear close all; clc; N=15; n=-N : N; x=Zeros(1,length(n ) n ); forI=1:3x(In )=i; endsubplot(211 ) stem(n ) n,x ); subplot(212 ) [a,b]=xcorr(x ) x,' unbiased ' ); stem(b,a ) axis ([-15,15,0,1 ];
3.7序列相互关系。
互相关可根据一个混合信号确定它是否包括任何信号。 例如,判断从某种音乐包含的正弦信号是否包含1kHz。
clear close all; clc; N=15; n=-N : N; m=-2*N : 2*N; x=Zeros(1,length(n ) n ); y=Zeros(1,length(n ) n ); forI=1:3x(In )=i; y(In )=1; endsubplot(311 ) stem(n ) n,x; subplot(312 ) stem(n ) n,y; [a,b]=xcorr(x,y,' unbiased ' ); subplot(313 ) stem(b ) b,a ) axis ) [-15,15,0,1 ];
四、离散系统的分类。
4.1线性和非线性系统。
系统只有同时具有均匀特性和叠加特性,才是线性系统。
4.2时变和非时变系统。
非时变系统:对于固定的输入,其输出也是固定的,与输入的作用时刻无关。
4.3因果与非因果系统。
有输入才会有输出,这是因果关系的系统。 输入不能比输出更先进。 有因才有果。
4.4稳定和不稳定系统。
对于任意有界输入,其输出都是有界的,是稳定系统。
五、工程应用。
输入信号x作用于系统h,从而获得输出信号y。 那么,
知道x和h,求y。 是分析。 用于分析系统的特性。
知道y和h,求x。 是控件。 用于闭环控制系统,请参考《自动控制原理》。
知道x和y,求h。 是设计。 用于设计数字滤波器等满足需求的系统。