# EE445S Real-Time Digital Signal Processing Lab - Homework 0 Hints

Homework #0: Assignment in Word and PDF formats.

• Online references on signals and systems:

• For the names of Matlab functions for common signals, please see EE 313 Lecture 2 Slides:
• even symmetric rectangular pulse rect(t) for t in [-1/2, 1/2]: `rectpuls(t)`
• even symmetric triangular pulse tri(t) for t in [-1, 1]: `tripuls(0.5*t)`
• step function u(t) with u(0) = 1: `stepfun(t, 0)`
• sinc pulse sinc(t) = sin(pi t) / (pi t): `sinc(t)`

For GNU Octave, please see the footnote on JSK page viii about what Octave-Forge toolboxes to download with Octave. In Octave, you could define your own rectpuls command by creating a file called `rectpuls.m` with the following contents

```function y = rectpuls(t)
y = (t >= -0.5) & (t < 0.5);
```

and then put the file `rectpuls.m` on the MATLAB path. You can find the directories on the MATLAB path by evaluating

```path
```
You can add `directory` to the MATLAB path by evaluating
```path(path, directory);
```

• Please keep all of the work for each problem together. Please don't put the writeup in one place and plots in another. That makes it much more difficult for the grader to grade them.
• Problem 0.1. There are two common definitions of the Fourier transform for continuous-time signals. In this problem, I am asking you to work the answers in frequency w in units of rad/s. The other common form of the Fourier transform uses frequency f that is in units of Hz.

• Problem 0.1(a). Please see the above note for problem 0.1.

Here is a key Fourier transform property for this part:

```
1
F { x(t) h(t) } = ---- X(w) * H(w)
2 pi
```
That is, multiplication in the time domain is convolution in the frequency domain. The scaling factor of 1/(2 pi) is due to the fact that w = 2 pi f.

Another property that you might need for this problem is that

```              / oo
|
x(t) * d(t) = | x(v) d(t - v) dv = x(t)
|
/ -oo
```
where d(t) is the Dirac delta functional. This is due to the sifting property of the Dirac delta. Likewise,
```                   / oo
|
x(t) * d(t - t0) = | x(v) d(t - t0 - v) dv = x(t - t0)
|
/ -oo
```

• Problem 0.1(b). The Fourier transform will be of the form
```C(w) = F(w) + G(w)
```
To sketch the magnitude response by hand, you can use the following inequality:
```| C(w) | = | F(w) + G(w) | ≤ | F(w) | + | G(w) |
```
The inequality decouples the plotting of | F(w) | and | G(w) |.

When plotting the magnitude response by computer, you can either start in the time domain (with part (a)) or in the frequency domain (with the Fourier transform derived earlier in part (b)). If you start in the time domain, then the MATLAB command `plotspec` command may be helpful. The `plotspec` command is defined in `plotspec.m` that comes with the Software Receiver Design book.

• Problem 0.1(c). Bandwidth is defined as the non-zero extent of the magnitude of the frequency response in positive frequencies. The difficulty is in quantifying non-zero extent. Common ways for quantifying non-zero extent are on lecture 1 slides. The simplest method is to eyeball the bandwidth based on the plot of the magnitude of the Fourier transform given by the `plotspec` function in Matlab.

To plot the continuous-time signal, you'll need to choose a sampling rate fs. From the sampling theorem, fs > 2 fmax.

• Problem 0.3. Please see sections 8.1 to 8.4 of B. P. Lathi's Linear Systems and Signals textbook, or sections 7.2 and 7.3 in M. J. Roberts' Signals and Systems textbook. Other signals and systems textbooks should have similar material in them. Also, see slides 4-4 and 4-5 in this semester's Sampling and Aliasing slides.

• Problem 0.4(a). Block diagrams for discrete-time systems are covered in Section 5.4 of Lathi's book and Section 3.7 of Roberts' book. In your block diagram, as mentioned on the homework assignment, please use a block with z-1 inside to represent a delay of one sample. Here, z-1 represents the transfer function in the z-domain for a linear time-invariant system that delays its input by one sample. Lecture 5 slides may also be of help.

• Problem 0.4(b). The initial conditions for a system refer the values in the system's memory due to inputs and outputs that occurred prior to the time that the system is observed. We generally set the observation time to zero. For discrete-time systems, y[0] is not an initial value, whereas for continuous-time systems, y(0) is an initial value. In the problem, w0 is a constant and not an initial condition.

You are given a difference equation of the form

y[n] = a1 y[n-1] + a2 y[n-2] + b1 x[n-1]

The introduction of the problem says that the impulse response of the linear time-invariant system is a causal sinusoid. So, for input x[n] = d[n] where d[n] is the discrete-time impulse, the output is

cos(w0 n + phi) u[n]
where phi is a constant.

For a causal system, the current output value depends only on previous output values, and current and previous input values.

Since the system is causal, we can start the observation of the system at n = 0, and let time advance to n = 1, n = 2, etc. to determine what the initial conditions are. For n = 0,

y[0] = a1 y[-1] + a2 y[-2] + b1 x[-1]

We can determine the values of the initial conditions as follows. The system is linear, time-invariant and causal. For a system to be linear, the system must be homogeneous and additive. If system were to output y[n] given input x[n], then a linear system would output a y[n] given input a x[n] for any constant a. Let a be zero. This means that if the input is identically zero for all time, then a linear system must produce a output that is identically zero for all time.

Lecture 1 slides may also be of help here.

• Problem 0.4(e). Once you have generated a plot in Mathworks MATLAB, LabVIEW Mathscript or GNU Octave, you can export the plot to another program for editing such as to shrink the plot to save paper. In the Matlab plot window, first select the Edit menu, then select the "Copy Figure" option, and finally paste the plot into a word processing program for editing.

Last updated 01/19/14. Send comments to bevans@ece.utexas.edu