《差分方程与滤波.ppt》由会员分享,可在线阅读,更多相关《差分方程与滤波.ppt(38页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、Chapter 3-4.Discrete-Time Signals and SystemsMain ContentsnImportant types of signals and their operationsnLinear and shift-invariant systemnEasier to analyze and implementnThe convolution and difference equation representationsnRepresentations and implementation of signal and systems using MATLABDi
2、screte-time signalsnAnalog and discrete signalsnanalog signal nt represents any physical quantity,time in sec.nDiscrete signal:discrete-time signalnN is integer valued,represents discrete instances in timesDiscrete-time signalnIn Matlab,a finite-duration sequence representation requires two vectors,
3、and each for x and n.nExample:nQuestion:whether or not an arbitrary infinite-duration sequence can be represented in MATLAB?Types of sequencesnElementary sequence for analysis purposesn1.Unit sample sequencenRepresentation in MATLABFunction x,n=impseq(n0,n1,n2)nA:n=n1:n2;nx=zeros(1,n2-n1+1);x(n0-n1+
4、1)=1;nB:n=n1:n2;x=(n-n0)=0;stem(n,x,ro);nProgram P1_12.Unit step sequenceA:n=n1:n2;x=zeros(1,n2-n2+1);x(n0-n1+1:end)=1;B:n=n1:n2;x=(n-n0)=0;3.Real-valued exponential sequenceFor Example:n=0:10;x=(0.9).n;stem(n,x,ro);MATLAB中中数组、矩阵基本运算符数组、矩阵基本运算符n 运算运算 符号符号 举例举例n加法,加法,a+b +1 2+3 4 1,2+3n减法,减法,a-b -1 2
5、-3 4 1,2-3n乘法,乘法,a*b *1,2*3 1,2*3,4n a.*b .*1,2.*3,4=3,8n逆乘,左乘逆乘,左乘 ax=b x=ab=inv(a)*bn 右乘右乘 /xa=b x=b/a=b*inv(a)n乘幂,方阵的幂乘幂,方阵的幂 a2=a*an 元素的幂元素的幂 .a.2 x.34.Complex-valued exponential sequenceAttenuation:衰减因子frequency in radians:For Example:n=0:10;x=exp(2+3j)*n);5.Sinusoidal sequencePhase in radiansF
6、or Example:n=0:10;x=3*cos(0.1*pi*n+pi/3)+2*sin(0.5*pi*n)6.Random sequencenRand(1,N)nGenerate a length N random sequence whose elements are uniformly distributed between 0,1nRandn(1,N)nGenerate a length N Gaussian random sequence with mean 0 and variance 1.en 0,17.Periodic sequencenA sequence x(n)is
7、periodic if x(n)=x(n+N)nThe smallest integer N is called the fundamental periodnFor examplenA:xtilde=x,x,x,xnB:xtilde=x*ones(1,P);xtilde=xtilde(:);xtilde=xtilde;transpositionOperations on sequencen1.Signal additionnSample-by-sample additionnx1(n)+x2(n)=x1(n)+x2(n)3.Scalingnax(n)=ax(n)5.foldingny(n)=
8、x(n-k)nm=n-k;y=x;4.Shiftingny(n)=x(-n)ny=fliplr(x);n=-fliplr(n);6.Sample summation ss=sum(x(n1:n2);7.Sample production sp=prod(x(n1:n2);8.Signal energy se=sum(x.*conj(x);or se=sum(abs(x).2);9.Signal powerSome useful resultsnUnit sample synthesisnAny arbitrary sequence can be synthesized as a weighte
9、d sum of delayed and scaled unit sample sequence.nEven and odd synthesis nEven(symmetric):xe(-n)=xe(n)nOdd(antisymmetric):xo(-n)=-xo(n)nAny arbitrary real-valued sequence can be decomposed into its even and odd component:x(n)=xe(n)+xo(n)The geometric seriesnA one-side exponential sequence of the for
10、m an,n=0,where a is an arbitrary constant,is called a geometric series.nExpression for the sum of any finite number of terms of the seriesCorrelations of sequencesnIt is a measure of the degree to which two sequences are similar.Given two real-valued sequences x(n)and y(n)of finite energy,nCrosscorr
11、elationnAutocorrelationThe index l is called the shift or lag parameter.The special case:y(n)=x(n)Discrete SystemsnMathematically,an operation T.ny(n)=T x(n)nx(n):excitation,input signalny(n):response,output signalnClassificationnLinear systemsnNonlinear systemsLinear operation L.nIff L.satisfies th
12、e principle of superpositionnThe output y(n)of a linear system to an arbitrary input x(n)n is called impulse response,and is denoted by h(n,k)h(n,k):the time-varying impulse responseLinear time-invariant(LTI)systemnA linear system in which an input-output pair is invariant to a shift n in time is ca
13、lled a linear times-invariant systemny(n)=Lx(n)-y(n-k)=Lx(n-k)nThe output of a LTI system is call a linear convolution sumnAn LTI system is completely characterized in the time domain by the impulse response h(n).Properties of the LTI systemnStabilitynA system is said to be bounded-input bounded-out
14、put(BIBO)stable if every bounded input produces a bounded output.nCondition:absolutely summablenTo avoid building harmful systems or to avoid burnout or saturation in system operationProperties of the LTI systemnCausalitynA system is said to be causal if the output at index n0 depends only on the in
15、put up to and including the index n0nThe output does not depend on the future values of the inputnCondition:h(n)=0,n 0nSuch a sequence is termed a causal sequence.nTo make sure that systems can be built.ConvolutionnConvolution can be evaluated in many different waysnIf the sequences are mathematical
16、 functions,then we can analytically evaluate x(n)*h(n)for all n to obtain a functional form of y(n)nGraphical interpretation,folded-and-shifted versionFunction form of convolutionThree different conditions under which u(n-k)can be evaluated:Case 1:n0%the nonzero values of x(n)and y(n)do not overlap.
17、Case 2:0=n=9%completely overlapsFolded-and-shiftedSignals x=x(1),x(2),x(3),x(4),x(5)System Impulse Response:h=h(1),h(2)h(3),h(4)ny=conv(x,h)ny(1)=x(1)*h(1);y(2)=x(1)*h(2)+x(2)*h(1)ny(3)=x(1)*h(3)+x(2)*h(2)+x(3)*h(1);x(1),x(2),x(3),x(4),x(5)h(4),h(3),h(2),h(1)Note that the resulting sequence y(n)has
18、a longer length than both the x(n)and h(n)sequence.Sequence correlations revisitednThe correlation can be computed using the conv function if sequences are of finite duration.nExample 2.8nThe meaning of the crosscorrelationnThis approach can be used in applications like radar signal processing in id
19、entifying and localizing targets.Difference EquationnAn LTI discrete system can also be described by a linear constant coefficient difference equation of the formnIf aN=0,then the difference equation is of order NnIt describes a recursive approach for computing the current output,given the input val
20、ues and previously computed output values.Solution of difference equationny(n)=yH(n)+yP(n)nHomogeneous part:yH(n)nParticular part:yP(n)nAnalytical approach using Z-transform will be discussed in the funturenNumerical solution with Matlabny=filter(b,a,x)Zero-input and Zero-state responsenIn DSP the d
21、ifference equation is generally solved forward in time from n=0.Therefore initial conditions on x(n)and y(n)are necessary to determine the output for n=0.nSubject to the initial conditions:Solution:Zero-input and Zero-state responsenyZI(n):zero-input solutionnA solution due to the initial conditions
22、 alonenyZS(n):zero-state solutionnA solution due to input x(n)aloneDigital filternDiscrete-time LTI systems are also called digital filter.nClassificationnFIR filter&IIR filternFIR filternFinite-duration impulse response filternCausal FIR filternh(0)=b0,h(M)=bMnNonrecursive or moving average(MA)filt
23、ernDifference equation coefficients,bm and a0=1nImplementation in Matlab:Conv(x,h);filter(b,1,x)IIR filternInfinite-duration impulse response filternDifference equationnRecursive filter,in which the output y(n)is recursively computed from its previously computed valuesDigital frenquencyDigital frenquencynExample 2.8A digital signal is defined as xn=cos(2n).Is this digital sequence periodic?