You are on page 1of 12

# Digital Signal Processing Lab#1

Abstract understanding the concept of continuous-time and discrete-time signals and systems allows engineers to analyze and to employ those signals through acquisition, representation, manipulation, and transformation in a wide range of practical applications. Key Termssample, amplitude, periodic signal, pulse and step functions, complex signal, sequence, MATLAB, convolution, continuous signal, discrete signal, digital signal.

I. INTRODUCTION Signals are physical quantities that transmit information in their patterns of deviation. To simplify the analysis and design of signal processing systems is vital to represent signals by mathematical functions of one or more independent variables. The essential mathematical aspects of signal processing deal with ideal discrete-time signal processing systems, and ideal A/D and D/A converters. Digital signal processing involves the conversion of analog signals into digital, processing the obtained sequence of finite precision numbers using a digital signal processor or general purpose computer, and if necessary, converting the resulting signal sequence back into analog form. The most widely used for analysis and design is MATLAB, a numerical computing environment. MATLAB uses the a computer algebra system symbolic engine for graphical multi-domain simulation and model-based design of dynamic and embedded systems. II. GENERATION DATA USING MATLAB A. Unit amplitude rectangular window for 51 samples: The rectangular window with unit amplitude may be defined by [ ] { (1)
Fig.1. The rectangular window.

[ ]

( )

(2)

where k is the number of samples per half of sinusoid period. A plot of the square wave appears in Fig.2 with 10 samples ON and 10 samples OFF; total of three cycles. C. Delta function: The delta function that represents impact of the unitimpulse on some signal x[n] is represented by Eq.3.

where M is the window length in samples. A plot of the rectangular window appears in Fig.1 for length M=25. B. Square-wave with 20 samples per cycle: The square wave with amplitude 1 may be defined by
Fig.2. The square wave.

[ ]

[ ]

(3)

## where [n] is the unit-impulse that may be defined by [ ] { . (4)

A plot of the delta function with the impulses at n=0, n= 30, n= 90 appears in Fig. 3. D. Sinusoid with 40 samples per cycle: The sinusoid function is built by [ ] (5)

[ ]

(7)

where A is an amplitude, is an angular frequency of x[n]. A plot of the real and imaginary exponential sequence appears in Fig. 5. F. Triangle sequence: The triangular pulse with 10 samples may be represented by [ ] | ( ) | (8)

where n is the number of sample from some sampling range, represents how many samples is taken per period, and is a phase shift. A plot of the sinusoid appears in Fig. 4.

## E. Complex exponential: The complex exponential sequence [ ] may be defined by ( ) (6)

G. Hamming, Blackman, Hanning: A window function is a mathematical function that is zerovalued outside of some chosen interval. The Hamming window may be defined by [ ] (9)

where M is chosen interval (51 samples). A plot of the Hamming window appears in Fig. 7. The Blackman window may be defined by [ ] ( ) (10)

where M is chosen interval (51 samples). A plot of the Blackman window appears in Fig. 8. The Hanning window may be defined by [ ] ( ) (11)

where M is chosen interval (51 samples). A plot of the Hanning window appears in Fig. 9.

## Fig. 9. The Hanning window.

III. ANALYSIS OF SIGNALS A. Family of continuous-time sinusoids: The continuous-time sequence is a sequence whose value y(t) is defined for every value of the independent variable t (time). The general representation of such sequence is denoted by Eq.12. (12) where A is amplitude, angular frequency (rad/sec), phase shift (rad). A plot of the family of the continuous-time sinusoids at frequencies A a d app ar Fg B. Family of discrete-time sinusoids: The discrete-time sequence is a sequence whose value y[n] is defined only at a discrete set of values of the independent variable n (usually the set of integers). The general representation of such sequence is denoted by Eq.13. (13) where A is amplitude, angular frequency (rad/sample), phase shift (real constant). A plot of the family of the discrete-time sinusoids at frequencies =0, =0.1, =0.2, =0.4, =1, =1.1, =1.2 appears in Fig.11. The Fig.11 represents Bizarre property #2 according to which, frequencies in the neighborhood of =0 or 2k are called low frequencies, whereas, frequencies in the neighborhood of = 0r (2k+1) are called high frequencies. C. Convolution: Convolution is a mathematical way of combining two signals to form a third signal. Using the strategy of impulse decomposition, systems are described by a signal called the impulse response. Convolution is important because it

## Fig. 8. The Blackman window.

relates the three signals of interest: the input signal, the output signal, and the impulse response. The implementation of such technic is represented at Fig.12.a trough Fig.12.f.

## Fig. 12.f. The convolution of delta*square.

D. Convolution properties: From a mathematical viewpoint the roles of h[n] and x[n] in the convolution sum are equivalent. However, in the context of linear time-invariant systems, the roles played by the impulse response and the input are not equivalent. The nature of h[n] determines the effect of the system on the input signal x[n]. Since all linear time-invariant systems are described by a convolution sum, Fig.13.a through Fig.13e represents the properties of convolution to study their properties and determine the impulse response of interconnected systems.

## h[n] (x1[n] + x2[n] ) = h[n]* x1[n] + h[n]* x2[n].

E. Answers to the book problems: Problem #2.35 (a) y(t) = x(t 1) + x(2 t) Answer: linear, time-invariant, noncausal, stable. (b) y(t) = dx(t)/dt Answer: linear, time-invariant, causal, stable. (c) y(t) = Answer: linear, time-varying, noncausal, unstable. (d) y(t) = 2x(t) + 5. Answer: nonlinear, time-invariant, causal, stable. The solutions are presented in the Appendix A. Problem #2.40
Fig. 13.d.The associative property

## F. Discrete-time system input-output relation: Given the discrete-time system is defined by [ ] [ ]

[ ] [ ]

(14)

For the input x[n]=au[n] with y[-1]=1 as n, where a is a positive number, the system represents square root of the a. The system is time-invariant because of [ ] [ ]
[ [ ] ]

. (15)

The test for linearity states that the system is nonlinear; a solution is presented in the Appendix B. A plot of the system input and output relation appears at Fig.14.
Fig. 14.The input-output relation of [ ] [ ]
[ ] [ ]

[ ] [ ]

for linearity.