Professional Documents
Culture Documents
Problem 1
y[1] = 0 (1)
y[2] = 2
determine G.
Solution
(b) We find the homogeneous solution of the difference equation by first de-
termining the z-transform and then solving for the roots of the second order
polynomial as follows:
Y (z)[1 2z 1 + 0.5z 2 ] = 0
with homogeneous solution of the form:
1
1 2
1 2z1,2 + 0.5z1,2 = 0 (3)
2
z1,2 2z1,2 + 0.5 = 0
2
42
z1,2 = = 1 2/2 (4)
2
z1 = 1 + 2/2
z2 = 1 2/2
We now solve for a1 , a2 using the conditions on y[0] and y[1] giving:
a1 + a2 = 1 (6)
a1 a2 = 2/ 2 = 2
1+ 2
a1 =
2
1 2
a2 =
2
giving the final solution as:
! !n ! !n
1+ 2 2 1 2 2
y[n] = 1+ + 1
2 2 2 2
(c) We solve for G as:
y[n]
G = lim (7)
n y[n 1]
2y[n 1] 0.5y[n 2]
= lim
n y[n 1]
0.5
= 2 lim
n y[n 1]/y[n 2]
= 2 0.5/G
2
G2 2G + 0.5 = 0 (8)
G = 1 2/2 G = 1 + 2/2 = 1.707
Problem 2
An input signal, x[n], defined over the region < n < , is passed through
a cubic non-linearity yielding the output signal
y[n] = (x[n])3
(a) If the input to the system is of the form
1 cos(2x)
cos2 (x) = +
2 2
cos(3x) 3 cos(x)
cos3 (x) = +
4 4
(b) If the input to the system is the signal
Solution
3
Figure 1: Magnitude spectrum of cubed cosine wave.
4
Problem 3
Solution
(a) The system function is found by taking z-transforms of the difference equa-
tion giving:
h[n] = n u[n]
where we used the fact that
X 1
rn = , |r| < 1
n=0
1r
X
X
n
H(z) = x[n]z = (z 1 )n
n=0 n=0
5
()0.002/T = e1
T
ln =
2 103
= exp[500T ]
Problem 4
Solution
(a) The digital signal,x1 [n], resulting from sampling xa (t), with sampling
rate FS = 10000 Hz, can be written in the form:
6
Figure 3: Frequency responses of the two signals.
Problem 5
1. accept an arbitrary speech filename and load the file (filename.wav) using
the loadwav command given on the webpage, or the native MATLAB
wavload command.
2. listen to the speech file using the MATLAB sound command. (Pay atten-
tion to the required scaling for the speech file). Write down the sentence
that you heard.
7
3. plot the sample values of the speech at N msec/line, 4 lines/page, where
N is specified at run time.
Use the file s3.wav (from the website) as your test, with N equivalent to 250
msec of speech per line.
Solution
% homework 1--plot_speech_file.m
% speech_waveform_plotting_program.m
% read in waveform for a speech file and plot the samples, 4 lines to a page
%
% [xin,fs,mode,format]=loadwav(ah_truncated.wav);xin)
filename=input(enter speech filename:,s);
[xin,fs,mode,format]=loadwav(filename);
8
% create vector of indices for each line
ns=(vstart:vstart+n-1);
The speech utterance in the file s3.wav is the sentence Add the sum to the
product of these three, spoken by a female talker. Plots of the waveform
with 250 msec per line are shown below, along with a strips plot of the entire
waveform on a single plot.
9
file: s3, starting sample: 1
1
1
200 400 600 800 1000 1200 1400 1600 1800 2000
1
1
2200 2400 2600 2800 3000 3200 3400 3600 3800 4000
1
1
4200 4400 4600 4800 5000 5200 5400 5600 5800 6000
1
1
6200 6400 6600 6800 7000 7200 7400 7600 7800 8000
1
0
1
1.02 1.04 1.06 1.08 1.1 1.12 1.14 1.16 1.18 1.2
4
x 10
1
0
1
1.22 1.24 1.26 1.28 1.3 1.32 1.34 1.36 1.38 1.4
4
x 10
1
0
1
1.42 1.44 1.46 1.48 1.5 1.52 1.54 1.56 1.58 1.6
4
x 10
10
file: s3, starting sample: 16001
1
0
1
1.62 1.64 1.66 1.68 1.7 1.72 1.74 1.76 1.78 1.8
4
x 10
1
0
1
1.82 1.84 1.86 1.88 1.9 1.92 1.94 1.96 1.98 2
4
x 10
1
0
1
2.02 2.04 2.06 2.08 2.1 2.12 2.14 2.16 2.18 2.2
4
x 10
1
0
1
2.22 2.24 2.26 2.28 2.3 2.32 2.34 2.36 2.38 2.4
4
x 10
file: s3, sampling rate: 8000, starting sample: 1 number of samples 24000
2000
4000
6000
8000
samples offset
10000
12000
14000
16000
18000
20000
22000
11