0% found this document useful (0 votes)
14 views2 pages

DSAP_lab_1

Uploaded by

ashutoshjak88
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views2 pages

DSAP_lab_1

Uploaded by

ashutoshjak88
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Nepal Engineering College

Changunarayan‐04, Bhaktapur
Digital Signal Analysis and Processing (DSAP) Lab
CRN: Name: Semester: Spring 2022

Starting Date: Due Date:

Lab 1: FAMILIARIZATION WITH BASIC DISCRETE-TIME SIGNAL.

Objective:

In this lab session, we will familiarize ourselves with basic discrete-time signals using MATLAB. We
will write MATLAB programs to plot continuous-time sinusoidal signals of different frequencies and
study the different properties of discrete-time sinusoidal signal. We will also write programs to plot
various graphs that will illustrate Fourier series theory.

1. Elementary discrete-time signal


Plot the basic discrete-time signal using MATLAB.
i. Unit Impulse sequence
ii. Unit step sequence
iii. Unit Ramp sequence
Create function m-files of each signals and plot the sequences. Also plot impulse sequence and
ramp sequence using step sequence function and step sequence using impulse sequence function.

2. Continuous-time sinusoidal signal


Care must be taken while plotting continuous-time signal in MATLAB because all signals in
MATLAB are discrete-time, but they will look like continuous-time signals if the sampling rate is
much higher than the Nyquist rate. For example, if we wish to plot continuous-time sinusoid, 𝑥 𝑡
𝐴𝑠𝑖𝑛 2𝜋𝐹𝑡 𝜃 , we must take sampling frequency, Fs ≥ 2F. The MATLAB code to plot above
signal would be:
F = 3; A = 2; th = 0; % Three parameters frequency, amplitude and phase of sinusoid.
Fs = 10*F; % Taking sampling rate is equal to ten times the frequency.
T = 1/Fs; % Time period of sampled sequence.
t = 0:T:1; % Defining time t from zero to one.
xt = A*cos(2*pi*F*t + th); % Defining the signal x(t)
plot(t,x); % Plotting the signal t Vs x(t)

a. Create and run the m-file above, and produce figure.


b. Change the sampling frequency and study the behavior of sinusoid.
c. Try plotting the signal for different frequencies.

3. Discrete-time sinusoidal signal


A discrete-time sinusoidal signal is expressed as,

𝑥𝑛 𝐴𝑐𝑜𝑠 2𝜋𝑓𝑛 𝜃

Where n is an integer variable.

Write a MATLAB program to plot discrete-time sinusoid with frequency f = 0.1.


Study the following properties of discrete-time sinusoidal signal in MATLAB:
Prepared by: Rupesh D. Shrestha, nec
1
Nepal Engineering College
Changunarayan‐04, Bhaktapur
Digital Signal Analysis and Processing (DSAP) Lab
i. A discrete-time sinusoid is periodic only if its frequency f is a rational number.
ii. Discrete-time sinusoids whose frequencies are separated by an integer multiple of 2π
are identical.
iii. The highest rate of oscillation in a discrete-time is attained when ω = π.
4. Fourier series
Fourier series theory states that a periodic wave can be represented as a summation of sinusoidal
waves with different frequencies, amplitudes and phase values.
a. Write a program that plots the signal x(t) for N = 9.
sin 2𝜋𝑛𝑡
𝑥 𝑡
𝑛

b. Write a program that plots the signal x(t) in step (a) but with N = 99 and N = 999.
c. What do you conclude from steps (a) & (b)?
5. Other Signals:
A normally distributed random signal of length N can be generated using the MATLAB command
randn(1,N):
a. Write a program to generate a normally distributed random signal of length 100 samples.
b. Write a program to generate noise sinusoidal signal.

Submission Requirement

You are expected to write a report which consists of:


1. Theory and mathematics that you have to analyze in your code development.
2. MATLAB codes
3. Results obtained from your codes.
4. Graph plot with proper title and labels. The title must include your CRN.
5. Short explanations for your results and codes.
6. Conclusion of the lab.
The Report must be in printed form.

Note:
Submission deadline is the date of next lab. Each student is required to submit a hardcopy report of the
lab by the submission deadline. Failure to do so will not be accepted. Each report must be your own
work. Copied or photo copied report will not be accepted.

Prepared by: Rupesh D. Shrestha, nec


2

You might also like