Professional Documents
Culture Documents
OBJECTIVE:
To recall the basic MATLAB functions that will be used in Digital Signal Processing experiments
along with the TMS230C6416 DSK. In this regard following topics needs to be covered.
THEORY:
Sinusoidal sequence.
x ( t ) A sin(t )
BASIC OPERATIONS ON D.T SIGNALS:
Let x(n) be a sequence with finite length.
1. Amplitude manipulation
2. Time manipulation
Arithmetic Operations
* Matrix multiplication
clc:
CLC Clear command window.
clear all:
Clear variables and functions from memory. CLEAR removes all variables from the workspace.
CLEAR VARIABLES does the same thing.
close all:
Close figure. CLOSE, by itself, closes the current figure window. CLOSE ALL closes all the open
figure windows.
exp:
EXP Exponential. EXP(X) is the exponential of the elements of X, e to the X.
input:
INPUT Prompt for user input.
R = INPUT('How many apples') gives the user the prompt in the text string and then waits for
input from the keyboard. The input can be any MATLAB expression, which is evaluated, using
the variables in the current workspace, and the result returned in R. If the user presses the
return key without entering anything, INPUT returns an empty matrix.
linspace:
LINSPACE Linearly spaced vector.
LINSPACE(X1, X2) generates a row vector of 100 linearly equally spaced points between X1 and
X2.
rand:
The rand function generates arrays of random numbers whose elements are uniformly
distributed in the interval (0,1).
ones:
ONES(N) is an N-by-N matrix of ones.
ONES(M,N) or ONES([M,N]) is an M-by-N matrix of ones.
zeros:
ZEROS(N) is an N-by-N matrix of Zeros.
ZEROS(M,N) or ZEROS([M,N]) is an M-by-N matrix of zeros
plot:
PLOT Linear plot.
PLOT(X,Y) plots vector Y versus vector X. If X or Y is a matrix, then the vector is plotted versus
the rows or columns of the matrix, whichever line up.
subplot:
SUBPLOT Create axes in tiled positions.
H = SUBPLOT(m,n,p), or SUBPLOT(mnp), breaks the Figure window into an m-by-n matrix of
small axes, selects the p-th axes for the current plot, and returns the axis handle. The axes are
counted along the top row of the Figure window, then the second row, etc.
stem:
STEM Discrete sequence or "stem" plot.
STEM(Y) plots the data sequence Y as stems from the x axis terminated with circles for the data
value.
STEM(X,Y) plots the data sequence Y at the values specified in X.
title:
TITLE Graph title.
TITLE('text') adds text at the top of the current axis.
xlabel:
XLABEL X-axis label.
XLABEL('text') adds text beside the X-axis on the current axis.
ylabel:
YLABEL Y-axis label.
YLABEL('text') adds text beside the Y-axis on the current axis.
ALGORITHM/PROCEDURE:
TASK 1: Write MATLAB programs to generate the following waveforms in Continuous Time
Domain and Discrete Time Domain.
Source codes:
Continuous time domain Discrete time domain
Graphs:
2. Unit step sequence.
Source code:
Graphs:
3. Unit ramp sequence.
Source code:
Continuous time domain Discrete time domain
Graphs:
4. Sinusoidal sequence.
Source code:
Graphs:
TASK 2: Write a MATLAB program to show the amplitude manipulation on a Discrete Time
Signal. Show that the following amplitude manipulation has occurred on a signal.
Signal amplification
Signal attenuation
Signal amplitude reversal
NOTE: Take scaling factors of your choice but it must be shown on a graph.
Source code:
Graphs:
Observation:
TASK 3 : Write a MATLAB program to show the Time manipulation on a Discrete Time Signal.
Show that the following Time manipulation has occurred on a signal.
Source code:
Graphs:
Observation: