ECE 520.435: Digital Signal Processing, Fall 1997

updated on September 24, 1997 ___

For DSP students, please send me your email address at chenyang@jhu.edu and have "DSP" as your subject. I will use email to broadcast further instructions in the future.

___ ___

Introduction

This is the Laboratory Web Site developed by the Electrical and Computer Engineering Department for the Johns Hopkins University undergraduate/graduate Digital Signal Processing course, ECE 520.435. Our goal is to provide an online service for the students to get the lab assignments and download some useful functions for the lab.

The reference book for DSP lab is Computer-Based Exercises for Signal Processing Using MATLAB (CBESP) by Burrus et al. Prentice-Hall, 1994. The class is taught by Howard L. Weinert. Dr. Weinert is a faculty member in the Electrical and Computer Engineering department at the Johns Hopkins University. The TA for DSP this semester is Chenyang Xu who is a research assistant at Image Processing and Communication lab.

note: all page numbers used in the projects assignment refer to CBESP; the subplot command is strongly recommended to be used whenever a lot of plots are required. For those who never use subplot before, try typing "help subplot" inside MATLAB and you should be able to learn how to use it easily.

Download the functions in the CBESP. All of these files are also available from their official distribution site via anonymous FTP (eedsp.gatech.edu or IP address 130.207.226.24) in the directory pub/MATLAB and also as a disk distributed through the MathWorks, Inc., makers of the MATLAB software.


Lab Announcements


Lab Assignments

  1. Ch. 1 - Signals - Exer. 1.1, 1.2, 1.3, 1.4, 2.1. Ch. 1 - Fourier Transform - Exer. 1.1, 1.2, 1.3, 3.1, 3.2, 3.3, 5.1, 5.2. Ch. 1 - Basic Sampling Theory - Exer. 1.1, 3.1, 3.2, 3.3. Due Sept. 29.
  2. Ch. 2 - DFT Properties - Exer. 1.1, 1.2, 1.3, 3.1, 3.2, 5.1, 5.2, 5.3, 5.4. Ch. 2 - DFT as a Matrix - Exer 1.1, 1.2, 2.1. Ch. 2 - Convolution - Exer. 1.1, 1.2, 1.3. Due Oct. 14
  3. Ch. 9 - Cooley-Tukey FFT - Exer. 2.1, 2.2. Ch. 9 - Prime Factor FFTs - Exer. 1.1, 1.2, 1.3. Ch. 9 - General Length FFTs - Exer. 2.1, 2.2, 2.5. Due Oct. 27
  4. Ch. 3 - Spectral Windows - Exer. 1.1, 1.2, 1.3, 2.1, 2.2, 3.1, 3.2, 3.3. Due Nov. 12
  5. Ch. 8 - Discrete Design of FIR Filters - Exer. 1.1, 2.1, 2.2, 3.1, 3.5. Ch. 8 - Least-Squares Design of FIR Filters - Exer. 3.1, 3.3. Due Dec. 8.
Each project assignment turned in should consist of three parts:
  1. A brief report including math manipulation or answers to questions for each exercise.
  2. An attached print out of your figures and source code (.m file) plus auxillary functions you wrote. The figures could also be embedded in your report instead of being attached at the end. All the figures and source code must be correctly labelled and referred in the report.
  3. A disk which consists of all your source code and functions necessary for me to execute it. The disk should include a README file which explains how I could run through your project. Please make sure the disk has your name on it. If you are working on a UNIX workstation, you can go to any PC in the HAC and ftp your programs from your workstation and save to your disk. In your README file please note that your machine is a UNIX workstation. NOTE: If you don't know how to use ftp, please ask the HAC assistant or let me know so I can help you.

General Questions and Answers

  1. How to write a matlab program?

    A matlab program is a collection of MATLAB statements which is saved as .m file on the disk. One could use any text editor to compose the .m program. For example, paste the following MATLAB code into a file and save as hello.m

    	     disp('Hello MATLAB');
    	     a = 3	
    	     b = a*a
             
    Make sure the hello.m is saved in the current directory. Now type hello inside the MATLAB. hello.m will be executed sequentially just as if one typed in by hand. ".m" file is very useful for us to organize MATLAB code in our DSP project.

  2. How to write a matlab function?

    A matlab function is a special type of .m file which has a special statement (funcion ...) as its first line. Examples of functions which return one and two variables are listed below.

             ---------- onevar.m -------------------------------
             function d = onevar(x,y)
    	 % this is a comment which will show up
             % when one type "help onevar" in the matlab.
             % this is a useful way to write help message 
             % for your function
    
             % this is a local comment which will not show 
             % up when "help onevar" is typed. 
        
    	 d = sqrt(x.*x+y.*y);
             ---------------------------------------------------
             
    Now one can call onevar inside the matlab as following:
             x = 3
    	 y = 5
             d = onevar(x,y)
             x = [1 2 3]
    	 y = [-1 -2 -3]
    	 d = onevar(x,y)
             
             ---------- twovars.m -------------------------------
             function [s,d] = twovars(x,y)
    	 % function [s,d] = twovars(x,y)
             %   compute the sum and difference between x and y
             %   The sum and difference are stored in s and d 
             %   respectively.
    
             % Here the program starts
        
    	 s = x+y;    % compute the sum
    	 d = x-y;    % compute the difference
             ----------------------------------------------------
             
    Now one can call twovars inside the matlab as following:
             x = 3
    	 y = 5
             [s,d] = twovars(x,y)
             x = [1 2 3]
    	 y = [-1 -2 -3]
    	 [s,d] = twovars(x,y)
             

  3. How to generate a delta signal? The following two MATLAB code segments are equivalent in generating delta signals
    	        x[n] = delta(n), and
    	        y[n] = delta(n-5)
    	   
    Judge the use of each method by yourself.
               METHOD 1
               n = -10:10;
    	   x = zeros(size(n));
    	   x(11) = 1;
               y = zeros(size(n));
    	   y(16) = 1;
    
               METHOD 2 
               n = -10:10;
    	   x = zeros(size(n));
    	   x(n==0) = 1;
               y = zeros(size(n));
    	   y(n==5) = 1;
               

Questions and Answers regarding the project

Questions asked by DSP students and my answers will be posted here regularly. If you have a question regarding the project, please read this area first to see whether it has been answered (this is very likely to be the case). If you do not see your anwser here, you can then send me your question through email with "DSP question" as the subject line. Upon receiving it, I will usually answer it within a day.

Project 1

[Q]:
> I have started working on the Matlab homework, but I am confused in
> certain places whatg you want us to turn in for a grade. For example
> part b on page 6. It says compare the result to formula 1-6. Do we 
> have to write up the comparisson? 

Just compute the sum in two ways and output the results to see whether 
they match each other. The material to turn in for this part is your 
MATLAB code for computing two sums and the output of your code.

[Q]:
> Also for part a), what is it asking us to turn in? 

Matlab code and the plot of x[n] = (0.9)^n,  0<=n<=20.

[Q]:
> In the cases where it asks for a function (I assume a .m file), 
> do we print that up and staple it with our other work?

Yes.

[Q]:
> For our plots, how do you want them labled? ( problem 1.2 part a). 

Just say 'Time index [n]' is fine.

[Q]:
> In cases where it says "Show", how should we turn in our work
> (store the work in a .mat file and  mail it to you) ?  

If you work in the Windows 95 or Mac, you may be able to use Matlab 
Notebook to write your report which includes any discussion or
mathematic manipulation required as well as pictures generated by 
your program. As for the implementation code, you can attach them 
at the end. But their names need to be properly labeled and referred 
in your report. 

If you work in the X windows environment, you could type any
analysis, discussions, and math manipulations using any text
editor. Attach all your figures and programs at the end. Make sure 
all the programs and figures are properly labelled and referred in 
your report. 

As for mailing me matlab program, I think this is a very good
idea. This may happen for the later projects. However for project 1,
written report is required.

Online MATLAB Resources


Created by Chenyang Xu