Topic - Signal and system matlab
Project Description -
The first set of samples is from a signal x1(t) consisting of broadband random noise and some periodic electromagnetic interference (EMI) xe(t). The samples are taken at a rate of fs1 samples/second and fs1 is in your parameter file. The second set of samples is from a signal x2(t) with broadband noise plus a narrowband signal xs(t). The samples are taken at a rate of fs2 samples/second and fs2 is in your parameter file. The parameter file also has information about completing other parts of this project.
I. Sampling Effects
1. Sample the continuous-time signal xct(t) = Asin(2πf0t) to form the discrete-time signal xdt[n], at the sampling rates fsa, fsb and fsc where A, f0, fsa, fsb and fsc are given in your parameter file. Include in your report three graphs of xct(t) vs. t and xdt[n] vs. n for the three sampling rates. For each graph the discrete-time range should be 0 ≤ n ≤ 100 and the continuous-time range should be 0 ≤ t ≤ 100Ts.
2. The set of samples in xxxxxSig1.txt represents the discrete-time signal x1[n], formed by sampling the continuous-time signal x1(t). Find the best approximation to the CTFT X1(f) of x1(t ) using the DFT X1[k] of x1[n]. Treat x1(t) as one period of a periodic signal. Then X1(f) should consist entirely of impulses. There will be many small impulses caused by the random noise background and a smaller number of large impulses caused by the periodic EMI. Make the best estimate you can of the EMI xe(t) by taking the inverse CTFT of the large impulses. In the report include these graphs:
a. The best estimate of x1(t) over the time range in xxxxxSig1.txt.
b. The best estimate of |X1(f)| over the frequency range 0 ≤ f ≤ fs1 / 8 Hz.
c. The best estimate of ∠X1(f) over the frequency range 0 ≤ f ≤ fs1 / 8 Hz.
d. The best estimate of xe(t) over the time range in xxxxxSig1.txt.
Also list the EMI frequencies and the values of X1(f) at those frequencies.
3. Decimate the original x1[n] by a factor of 4, forming a new x1[n] which is a set of samples taken from x1(t) at a sampling rate of fs1/4 samples/second and repeat step 2. For the graphs of |X1(f)| and ∠X1(f), use a frequency range of 0 ≤ f ≤ fs1/ 8 Hz.
4. Decimate the original x1[n] by a factor of 16, forming a new x1[n] which is a set of samples taken from x1(t) at a sampling rate of fs1/ 16 samples/second and repeat step 2. For the graphs of |X1(f)| and ∠X1(f), use a frequency range of 0 ≤ f ≤ fs1/ 32 Hz.
For parts 2, 3 and 4, compare the frequencies of the EMI found in each case. If there are any differences, explain why.
II. Effects of Different Kinds of Filtering
1. Using the Laplace transform, find the time-domain response yL(t) of a system with transfer function
H(s) = 2ζωn/s2+ 2ζωns+ωn2 to the excitation x(t) = Acos(2πf0t)u(t). The values of ζ, ωn, A and f0 are given in your parameter file.
2. Using the CTFT, find the time-domain response yF(t) of a system with transfer function H(s) = 2ζωn/s2+2ζωns+ωn2 to the signal x(t) = Acos(2πf0t). The values of ζ, ωn, A and f0 are the same as in part 1.
Include a graph of yL(t), yF(t) and the excitation x(t). The graph should cover a time range of 0 ≤ t ≤10 / f0.
3. The set of samples in xxxxxSig2.txt represents the discrete-time signal x2[n], formed by sampling the continuous-time signal x2(t). Find the best approximation to the CTFT X2(f) of x2(t) using the DFT X2[k] of x2[n]. Treat x2(t) as one period of a periodic signal. Then X2(f) should consist entirely of impulses. There will be many small impulses caused by the random noise background and a cluster of larger impulses caused by the narrowband signal. Make your best estimate of the lower and upper corner frequencies flo and fhi of the narrowband signal.
4. Then simulate continuous-time filtering x2(t) in two ways:
Method 1 - Frequency-domain Filtering
In this method simply multiply X2(f) by the transfer function of an ideal band-pass filter between flo and fhi to form X2f(f). Then inverse transform the result back to the time domain as x2f(t) . Use X2[k] to approximate X2(f) and use x2[n] to approximate x2(t).
Method 2 - Time-domain Filtering
Simulate time-domain filtering x2(t) with an N = 4 Butterworth band-pass filter using the "butter" command and the "filter" command in MATLAB. Call the result of this filtering x2t(t). In this method get the numerator and denominator coefficients of a digital filter that simulates the desired analog band-pass filter, filter x2[n] with that digital filter and use the filtered x2[n] as an approximation to the filtered x2(t) . Use a command similar to this one to get the coefficients of the digital filter:
[b, a] = butter(4, [flo, fhi]/(fs/2)) ;
where "b" is the set of numerator coefficients, "a" is the set of denominator coefficients of the digital filter, "4" is the filter order, "flo" and "fhi" are flo and fhi in Hz and "fs" is the sampling rate in samples/second. Use a command similar to this one to do the actual digital filtering:
x2t = filter(b,a,x2) ;
where "x2t" is the vector representing the result of the band-pass filtering, "b" is the set of numerator coefficients, "a" is the set of denominator coefficients of the digital filter and "x2" is a vector representing the original signal before filtering.
In the report include these graphs.
a. The best estimate of |X2(f)|dB vs f before filtering. For the graph of |X2(f)|dB use a frequency range of 0 ≤ f ≤ fs2/ 8 Hz.
b. The best estimate of |X2f(f)|dB vs f after filtering. For the graph of |X2f(f)|dB use a frequency range of 0 ≤ f ≤ fs2/ 8 Hz.
c. The best estimate of x2f(t) over the time range in xxxxxSig2.txt.
d. The best estimate of x2t(t) over the time range in xxxxxSig2.txt.
The two results x2f(t) and x2t(t) are very similar, but not identical. x2f(t) looks a lot like a delayed version of x2f(t). Explain why. Also, in the first few milliseconds and in the last few milliseconds, the two signals differ in another way. Explain why.
Textbook - SIGNALS AND SYSTEMS - Analysis Using Transform Methods and MATLAB, Second Edition by M. J. Roberts.
Please check chapter 9, 10 and 11 for code references that will help.
Attachment:- Assignment Files.rar