rectpuls(t)
tripuls(0.5*t)
(t >= 0)
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
pathYou can add
directory
to the MATLAB path by
evaluating
path(path, directory);The directory should be surrounded by single quotes.
Here's much of the problem worked out on a marker board using frequencies in Hertz. More information below on different parts of the problem.
Derivation of the Fourier transform of a sine wave.
Here is a key Fourier transform property for this part:
1 F { x(t) h(t) } = ---- X(w) * H(w) 2 piThat 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. See the handout on Continuous-Time Fourier Transforms in w and 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) | / -oowhere d(t) is the Dirac delta functional. This is due to the sifting property of the Dirac delta (see lecture slides 3-5 and 3-6). Likewise,
/ oo | x(t) * d(t - t0) = | x(v) d(t - t0 - v) dv = x(t - t0) | / -oo
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) |.
For the hand sketch, you could draw the spectrum without using a specific numeric value for fc in mind, although fc would have to be larger than the bandwidth of the lowpass signal prior to modulation to get a bandpass spectrum.
When plotting the magnitude response by computer, I'd recommend
plotting in f (Hz).
That will help you to become more accustomed to the Fourier transform
in f, which we'll be using in this course.
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.
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.
You are given a difference equation of the form
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
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,
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.
Generating Sinusoidal Signals slides 1-22 and 1-23 might also be of help here.
heaviside
isn't quite what we need because
it has a value of 0.5 at the origin.
We can generate our own using the > operator in MATLAB.
This operator returns 0 for false and 1 for true.
We can implement u[n] as n >= 0:
n = -5:5; uofn = ( n >= 0 ); stem(n, uofn)
Once you have generated a plot in MATLAB, 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. You can also save the plot as a PNG file and then import it into your Word document.