DSP Practice homework
This homework will not be collected. You are advised to complete
these problems early, so that we can discuss them in class
if needed.
Use MATLAB to do all plots/graphs unless the question specifies differently.
If a frequency range is given, assume that the negative frequencies are
also present. For example, if a signal is said to have frequencies between
10 and 20 MHz, you should assume that the signal has frequencies between
-10 and -20 MHz, too.
1). Floating point (real) numbers are stored in binary with finite precision on
computers.
a). For MATLAB on our server, what is the smallest number that we can
store? In other words, we can store 1/(2^n) in a variable
when n is small, but how large can n be before the variable is considered zero?
b). What is the largest number that we can store? In other words, we can
store 2^n in a variable, but how big can n be? What happens when n is too large?
c). What about the number 1+1/(2^n), how large can n be? Is your answer
the same as in part a? Why or why not?
2). Suppose you want to sample a signal with a frequency range from
14 kHz to 20 kHz. What is the lowest sampling frequency that you can use?
3). Suppose you have a signal of frequencies between 1 kHz and 22 kHz,
and there is noise between 100 kHz and 102 kHz.
a). If you sample at 44,000 samples/second, does the noise interfere
with the signal?
b). If you sample at 30,000 samples/second, there is a problem. What is
the problem?
4). Suppose we have a signal with frequencies between 17,500 Hz and
22,500 Hz. If we sampled the signal such that there would be 2
replicas of the signal (between -17,500 Hz and +17,500 Hz), what would
our sampling frequency be?
5). Compare the run time of MATLAB's FFT and my DFT programs, for a
random signal of 10, 50, 100, 500, 1000, and 1500 samples. Which is
faster? Why? Is MATLAB's FFT routine compiled or interpreted, and how
would this affect the outcomes?
6). The analog signal, x(t), is:
x(t) = 3cos(2pi*2000t+pi/4) + 2cos(2pi*5000t) + cos(2pi*11000t-pi/7)
a) plot each frequency component separately
b) graph this function
c) represent x(t) in terms of a fundamental frequency, amplitudes and phases.
d) what is the bandwidth of x(t)?
e) what is the equation for x[n]?
7). Assume the signal:
x(t) = 3cos(2pi*2000t+pi/4) + 2cos(2pi*5000t) + cos(2pi*11000t-pi/7)
is sampled at 10 kHz.
a) what does the x[n] equation become?
b) plot x[n]
c) if x(t) is sampled at 10 kHz, draw the "shark's tooth" diagram for each
of the 3 frequency components in x(n). What aliases does the 5 kHz signal
have?
d) what is the critical Nyquist frequency?
8). Suppose we have a system where y[n] = x[n] - 2x[n-1].
a) Is this system Linear?
b) Is this system Time-Invariant?
c) Is it causal?
9). Take your first name, and sum each character minus the
ASCII value for either 'A' or 'a', plus 1.
(E.g., Sam would be 'S' - 'A' + 1 + 'a' - 'a' + 1 + 'm' - 'a' + 1.)
How is this number stored as a double?
Show how this number is stored in hexadecimal, and binary.