VISUALIZATION: DISCRETE-TIME SIGNALS By L.G.Hassebrook EE630 2011

advertisement
VISUALIZATION: DISCRETE-TIME SIGNALS
By L.G.Hassebrook
EE630
2011
TURN IN PRINTOUTS OF ALL YOUR MATLAB CODE AND RESULTS. No electronic form please.
1. Kronecker Delta function: Generate and Kronecker Delta and reproduce the plots in Figs. 1 and 2.
The D-T delta function is
⎡1 for n = 0
⎣0 for n ≠ 0
δ [n ] = ⎢
And is plotted in Fig. 1 for n from 0 to 63.
Figure 1: Finite length Kronecker delta function for N=64.
The function fftshift() can be used to shift sequences circularly half the sequence length as shown in Fig.
2. This is particularly helpful in the fourier domain but also for viewing functions symmetric or antisymmetric about zero.
1 Figure 2: Use of fftshift. Note the time index did not shift with the function.
2. Discrete Fourier Transform: Take the DFT of the Kronecker Delta in Fig. 1 and reproduce the
plots in this step. The N-point DFT is defined as
X [k ] =
N −1
∑ x[n ]exp(− j 2π k n / N )
n =0
Where k=0, 1, …. (N-1) and the inverse DFT is
x[n ] =
1
N
N −1
∑ X [k ]exp( j 2π n k / N )
k =0
DFT the Kronecker in Fig. 1 and plot the real and imaginary components in the same plot as in Fig. 3.
Figure 3: Blue line is real part of DFT and green is imaginary part. 2 Shift the delta function to position 16 as shown in Fig. 4 and then DFT result and plot real, imaginary, amplitude and phase of the DFT and show in Fig. 5. Figure 4: Delta shifted by 16 units. Figure 5: The top red line is amplitude and the ramp is the phase divided by 16 in radians. The triangle waveforms are actually sampled sine waves representing the real and imaginary components. 3. D‐T Differential and Convolution using the DFT: An analogy to the differentiation in D‐T is the difference formed by convolving a positive and negative kronecker delta with a function such that h[n ] = δ [n ] − δ [n − 1] 3 Such that the difference response to x[n] is y [n ] = x[n ]* h[n ] = x[n ] − x[n − 1] Create h[n] and a D‐T cosine function in matlab as x[n]=cos(2*pi*kc*t/N) where N=1024, t=0:(N‐1); and kc=16. Then convolve h[n] with x[n] by using the matlab code y=ifft(fft(h).*fft(x)); The result of x[n] and y[n] are shown in Fig. 6. NOTE: you will need to plot real(y[n]) because it will be a complex sequence with all the information in the real part. Figure 6: Blue line is input cosine and green line is differential (sine wave). 4. Note that in Fig. 6 the differential is not the same magnitude as the input cosine wave. Show in C‐T differentiation, what the scaling coefficient should be to make the differential be equal in magnitude to the input cosine? Show that your scaling works. The result is in Fig. 7. 4 Figure 7: Blue is the cosine waveform and green is the normalized differential. 5 
Download