Professional Documents
Culture Documents
SSUET
Familiarization with the Common Sequences: Unit Impulse, Unit Step, and Unit Ramp To understand generation of sinusoidal and exponential sequence To understand the periodicity property of Digital frequency (frequency of discrete time sinusoid) To understand Amplitude Modulation using Square Wave with a Cosine Wave
Place a check mark in the Assigned column next to the exercises your instructor has assigned to you. Attach this cover sheet to the front of the packet of materials you submit following the laboratory. Activities Pre-lab Exercises In-lab Exercises Take Home Exercises Any Other Remarks Signature
SSUET
A system can be represented mathematically as a transformation between two signal sets, as in x[n] S1 y[n] = T{x[n]}
S2
Depending on the nature of the signals on which the system operates, different basic types of systems may be identied: Analog or continuous-time system: the input and output signals are analog in nature. Discrete-time system: the input and output signals are discrete. Digital system: the input and outputs are digital. Mixed system: a system in which different types of signals (i.e. analog, discrete and/or digital) coexist. Signals can be either continuous-time (CT) or Discrete-time (DT). Signals normally occurring in nature (e.g. speech) are continuous in time as well as amplitude. Such signals are called Analog signals. DT signals have values defined at only discrete instants of time. These time instants need not be equidistant, but in practice, they are usually taken at equally spaced intervals for computational convenience and mathematical tractability. If amplitude of DT signal is also made discrete through process of quantization or rounding off, then this becomes a Digital Signal. Digital Signal Processing (DSP) is concerned with digital processing of signals.
SSUET
An analog signal is denoted as x(t). To emphasize its discrete time nature, a DT signal is denoted as x(n), instead of x(t). A discrete-time signal x(n) is a function of an independent variable n, which is an integer. A discrete-time signal is not defined at instants between two successive samples. A discretetime signal is represented as a sequence of numbers, called samples. A sample value of a typical discrete-time signal or sequence {x[n]} is denoted as x[n] with the argument n being an integer in the range and . The following methods are in use to illustrate the Digital signals
where the bar on top of symbol 1 indicates origin of time (i.e. n = 0) Graphical Representation
Mathematical expression:
Sequence Representation
Tabular Representation
A set of rules that transforms one discrete signal into another is known as an algorithm and this transformation is what we call Discrete-time signal processing or Digital signal processing (DSP).
SSUET
Section A
GENERATION OF UNIT SAMPLE AND UNIT SEPT SIGNALS
SSUET
Matlab Notes: K=input(text) Request user input and it prompt the use in the text string and then waits for input from the keyboard. The value entered by the user is assigned to k. B=zeros(n) return an n-by-n matrix of zeros similarly for ones.
SSUET
Unit Ramp
The ramp function, denoted by ur( n) is a signal whose amplitude increases proportionally as time increases
Exponential Sequence
Another basic discrete-time sequence is the exponential sequence. Such a sequence can begenerated using the MATLAB operators .^ and exp. The exponential sequence is a signal whose amplitude exponentially increases or exponentially decreases, depending on the value of a, as time approaches infinity. x(n) = a
n
for n 0
DSP Lab # 2 Discrete-Time (DT) Signals Time Domain Representation Generation of a Real Exponential Sequence
% Generation of a real exponential sequence clf; n = 0:35; a = 1.2; K = 0.2; x = K*a.^n; stem(n,x); xlabel('Time index n');ylabel('Amplitude'); legend('Real Exponential') title('Real Exponential Sequence');
SSUET
when, a = re then the complex exponentia l signal becomes : x(n) = r cos(2f + )n + j sin (2f + )n
n j ( 2f +
both seperately
x(n) = A(n) = r
is the magnitude function of the complex signal is the phase function of the complex signal
SSUET
Sinusoidal Sequence
Another very useful class of discrete-time signals is the real sinusoidal sequence. Such sinusoidal sequences can be generated in MATLAB using thetrigonometric operators cos and sin x[n] = A cos[(0 + 2 r )n + ] = A cos(0n + ).
SSUET
without
n=[0:1023] %1024 samples freq1=pi/4; %frequency x1=2*sin(freq1*n) %sine wave of 1024 samples, pi/4 radian/sample frequency and amplitude of 2 figure(1);stem(n(1:30),x1(1:30)); grid freq2=9*pi/4; %(2*pi+freq1)condition of periodicity x2=2*sin(freq2*n); %sine wave of 1024 samples, 9*pi/4 radian frequency figure(2); subplot(2,1,1); stem(n(1:30),x1(1:30)); ylabel('x1');grid subplot(2,1,2); stem(n(1:30),x2(1:30)); ylabel('x2');grid; %compression of x1 & x2 xlabel('n');
SSUET
LAB Assignments
1. Practice all the examples in the Lab Manual 2. Generate a delayed unit sample sequence ud[n] with adelay of 11 samples. Run the modied program and display the sequence generated. 3. 4. Generate a delayed unit step sequence sd[n] with an advance of 7 samples. Run the modied program and display the sequence generated. Create a simple m-file that creates a unit sample, unit step, and unit ramp function for a sequence of length 15. Use a for loop to generate the ramp sequence. Then plot them all on the same axes with a stem plot. legend('sample','step','ramp') Add a legend. The final result should be as shown below. Note that the legend command for a stem plot is given as:
5. Generate the complex-valued exponential sequence. Which parameter controls the rate of growth or decay of this sequence? Which parameter controls the amplitude of this sequence? What will happen if the parameter c is changed to (1/12)+(pi/6)*i 6. Generate a sinusoidal sequence of length 50, frequency 0.08, amplitude 2.5, and phase shift 90 degrees and display it. What is the period of this sequence?Now display result using stem, plot and stairs commands. Comment on your results. 7. What is the difference between the arithmetic operators ^and. ^?
10
SSUET
10. Generate amplitude modulation using Square Wave with a Sin Wave and plot your results.
11