View the step-by-step solution to:

MATLAB Project 1 This project is to be treated as a take-home exam, meaning each student is to due his/her own work. To work the project you will...

MATLAB

1. Problem statement
a) Write the function discrete_pulse_train() to have the following function prototype:
function [x,n] = discrete_pulse_train(W,M,Np,D,N)
% [x,n] = discrete_pulse_train(W,M,Np,D,N)
% Generate a discrete-time pulse train
%================ Inputs =========================================
% W = pulse width in samples
% M = period in samples, M > W
% Np = Number of periods to create (if 0 full out to N samples)
% D = turn-on delay in samples of the first period
% N = total number of samples to create
%================ Outputs ========================================
% x = signal vector (a row vector)
% n = integer time axis corresponding to x
%////////////////////////////////////////////////////////////////
An example plot from this function obtained using the command line
>> [x,n] = discrete_pulse_train(5,18,4,13,200);
MATLAB Project 1 This project is to be treated as a take-home exam, meaning each student is to due his/her own work. To work the project you will need access to M ATLAB and at minimum the signal processing toolbox. Introduction This first MATLAB DSP project will get you acquainted/reacquainted with M ATLAB and then move into the exploration of • Discrete-time signal generation • Sequence convolution and the convolution sum • Linear constant coefficient difference equations (LCCDEs) • The discrete-time Fourier transform (DTFT) A Quick M ATLAB Review Recall that M ATLAB stands for matrix laboratory, so it goes without saying that M ATLAB is very efficient at doing matrix oriented numerical calculations. M ATLAB supports many data types, but the two data types we will work with the most, are scalar numbers (real and complex), and matrices (real and complex). For our signal processing needs the matrices we create will most often be vectors, that is matrices of dimension 1 × m or n × 1 . The default data type for real and complex numbers is double precision. Complex numbers are handled transparently in M ATLAB , so there is no need to worry about these details, for the most part. In fact, when M ATLAB starts-up, it has both i and j defined as 1 - , i.e., at the command window, as shown in Figure 1, enter >> j ans = 0 + 1.0000i Note that if you use i and j for something else, these definitions will be overwritten. The matrix specialization of M ATLAB means that the most efficient programming requires vectorizing. This is an aspect of using M ATLAB that most students master over time. Getting your code to work in some fashion is first and foremost. Writing tight code is something that requires practice.
Background image of page 1
Background image of page 2
Show entire document

Recently Asked Questions

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question