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

Homework #0: Assignment in Word and PDF formats.

• Convolution review

• Fourier transform review

• For the names of Matlab functions for common signals, please see Common Signals in Matlab:
• 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)`

If your Matlab version does not have the `rectpuls` command, then you could define it 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 search 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);
```
The directory should be surrounded by single quotes.

• Please keep all of the work for each problem together. This makes it much easier for the grader to give you the appropriate full or partial credit due for the solution.

• 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 section 7.1 in Oppenheim & Willsky's 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] + b0 x[n] + 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] + b0 x[0] + b1 x[-1]

In order for a system to be linear and time-invariant, it must be at rest. At rest, in the case, means that the initial conditions must be zero.

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/22/19. Send comments to bevans@ece.utexas.edu