ECE_161A_Project_2023

docx

School

Mt San Jacinto Community College District *

*We aren’t endorsed by this school

Course

128B

Subject

Electrical Engineering

Date

Apr 3, 2024

Type

docx

Pages

5

Uploaded by DeanWater34523

Report
ECE-161A 2023 Mid-Quarter Project 1. The figure below is a block diagram of a FIR filter. 1A. Determine the difference equation coupling the output sequence y(n) to the input sequence x(n). 1B. What is the impulse response of the filter? 1C. Determine the Z-Transform coupling Y(Z) to X(Z) 1D. What is the filter’s closed form Z-transform when the coefficients h 1 (n) = { 1 1 1 1 1}? 1E. For the same h 1 (n), show the pole-zero diagram of the filter. 1F. For the same h 1 (n), what is the closed form expression for the filter’s frequency response? 1G. For the same h 1 (n), on two subplots, show Matlab plots of the normalized to unity gain magnitude and log magnitude frequency responses versus normalized frequency between -0.5 and +0.5. 1H. What is the filter’s closed form Z-transform when the coefficients h 2 (n) = { +1 -1 +1 -1 +1}? 1I. For the same h 2 (n), show the pole-zero diagram of the filter. 1J. For the same h 2 (n), what is the closed form expression for the filter’s frequency response? 1K. For the same h 2 (n), on two subplots, show Matlab plots of the normalized to unity gain magnitude and log magnitude frequency responses versus normalized frequency between -0.5 and +0.5. 2. The figure below is a block diagram of a cascade of two sub filters with both recursive and non- recursive paths. 2A. Write the difference equation connecting w 1 (n) to x(n) and the transfer function W 1 (Z)/X(Z) 2B. Write the difference equation connecting s 1 (n) to w 1 (n) and the transfer function S 1 (Z)/W 1 (Z). 2C. Write the transfer function connecting S 1 (Z) to X(Z) and then the transfer function Y 1 (Z)/X(Z)
2D. Write the difference equation connecting w 2 (n) to y 1 (n) and the transfer function W 2 (Z)/Y 1 (Z) 2E. Write the difference equation connecting s 2 (n) to w 2 (n) and the transfer function S 2 (Z)/W 2 (Z). 2F. Write the transfer function connecting S 2 (Z) to Y 1 (Z) and then the transfer function Y 2 (Z)/Y 1 (Z) 2G. Someone peeked at the Matlab program and found the coefficients of the filter are as shown: They forgot to write down the scaling coefficients b 1,0 and b 2,0 . These coefficients scale their filter’s transfer function to unity gain at DC. Determine the DC gain of the two filters and determine the values of the two scale factors. Replace the incorrect values of the scale factors in the Matlab script below and run the code and plot in two subplots, the impulse response and the log magnitude frequency response. The sample rate for the filter is 1000 Hz. a11=-0.5606; b11=+1.0000; b10=1.0; % not correct scale factor a21=-1.1587; a22=+0.6184; b21=+1.4920; b22=+1.0000; b20=+1.0; % not correct scale factor w1=[0]; % registers for filter 1 w2=[0 0]; % registers for filter 2 x=[1 zeros(1,100)]; % Input time Series y1=zeros(1,101); % output time Series, Filter 1 y2=zeros(1,101); % output time Series, Filter 2 for n=1:100 % for loop sm1=x(n)-a11*w1; % input sum, filter 1 s1 =sm1+b11*w1; % output sum, filter 1 y1(n)=b10*s1; % scale filter output, filter 1 w1=sm1; % update register, filter 1 sm2=y1(n)-a21*w2(1)-a22*w2(2); % input sum, filter 2 s2 =sm2+b21*w2(1)+b22*w2(2); % output sum, filter 2 y2(n)=b20*s2; % scale filter output, filter 2 w2=[sm2 w2(1)]; % update registers, filter 2 end
3. We discovered a problem! The figure in the previous problem and the Matlab script in the same problem were copied from the wrong file. The problem was supposed to have three sub filters, not two! Shown below are the transfer functions of the three sub filters with their missing scale factors. The sample rate was correct, 1000 Hz. 3A. Determine the correct scale factors for the three sub filters 3B. Modify the Matlab script to include three sub filters and insert the scale coefficients, the correct filter coefficients, and the lines of code for the 3 rd subfilter in the script. Run your corrected script and plot the impulse response and frequency response. 3C. As a check to verify your code is correct you can have Matlab determine the impulse response and frequency response and compare the two versions. We found this code that claims to do this. It uses the Matlab function filter . You can use help filter to see how to use filter . Once you have the impulse response you can form the frequency response with the non-windowed (say 1024 or 1000 point) fft. b10=; % determine correct scale factor from numerator and denominator b20=; % determine correct scale factor from numerator and denominator b30=; % determine correct scale factor from numerator and denominator h2=filter(b10*[1.0 1.0 0.0],[1.0 -0.4743 0.0],[1 zeros(1,100)]) h2=filter(b20*[1.0 0.5470 1.0],[1.0 -1.0625 0.3498],h2) h2=filter(b30*[1.0 -0.3959 1.0],[1.0 -1.3811 0.7130],h2) 4. A Dual Tone Multiple Frequency (DTMF) key pad on your telephone hand set uses frequencies 697, 770, 852, and 941 Hz (low band) for the rows of the pad and 1209, 1336, 1477, and 1633 Hz for the columns of the pad (see figure below). We are to design a DTMF signal detector. The input signal is sampled at 8000 Hz with an 8-bit ADC. Since all the frequencies are below the quarter sample rate, we first pass the signal through a low pass filter and down-sample by 2 to reduce the workload for the next filters. The down sampled signal is separated into two bands, the Low and High Band by a low-pass and a high pass filter. The outputs of these two filters are again down sampled 2-to-1 so that the following filters can operate at a reduced sample rate. The reduced sample rate may violate the Nyquist criterion for the tones in the two down-sampled time series and the tones may appear at their aliased spectral positions. The down sampled time series are presented to 4-band-pass filters centered on their four possible tone frequencies: the output of these filters are compared and the two signal components with the largest amplitude are detected.
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help
0 500 1000 1500 2000 0 0.2 0.4 0.6 0.8 1 1.2 Frequency Frequency Response, DTMF Signaling Tones 4A. Show the time domain and un-windowed magnitude spectra of the DTMF signal when you individually depress the keypad keys 1, 5, 9, and D for 100 msec. 4B. Show the time domain and un-windowed magnitude spectrum of the time series formed when you depress the sequence 1, 5, 9, and D for 100 msec each with 100 msec gap intervals between the key strokes. (Will have to plot short segments of the time series to be able to see details.) 4C. Design an IIR low pass cheby2 filter for the first low pass filter. (You will have to determine filter orders yourself. Include a short comment on how you did it) Filter requirements: Pass band ripple: 0.2 dB, Stop band attenuation: 50 dB, Pass-Band 0-1650 Hz Stop Band 2350-4000 Hz Show the pole-zero diagrams of the filter. Show the frequency response of the filter along with the DTMF spectral lines at the input rate. Pass the set of tones through the low pass filter and then reduce sample rate 2-to-1. Show the spectra of the tones at the Input sample rate and at the output sample rate. Determine the center frequencies of the DTFM Tones at the reduced sample rate. 4D. Design the set of IIR low-pass and high pass cheb2 filters to separate the tones in the Low Band and High Band. Filter requirements: Low Pass High Pass Pass band ripple: 0.2 dB 0.2 dB, Stop band attenuation: 50 dB 50 dB, Pass-Band 0-950 Hz 1200-2000 Hz Stop Band 1200-2000 Hz 0-950 Hz
Pass the 2-to-1 down sampled time series from the first low pass filter through the Low pass and high pass filter. Show their spectra at the output prior to the 2-to-1 down sample and then after the 2-to-1 down sample. 4E. Design the set of IIR cheby2 bandpass filters to pass the aliased DTMF signal set. The two sided bandwidth of each filter is 20 Hz and the required stop band attenuation is 50 dB. Show the frequency response and impulse response of the 8-filters. 4F. Generate a time series corresponding to the DTMF signal formed by depressing the first letters of your first names (3-team members) for 100 msec each separated by 100 msec gaps. Show the time series and spectrum of this composite signal. 4G. Pass the DTMF composite signal through your filter bank and show the time response of the filter bank. 4H. Repeat the entire filter design of this problem but this time use Remez FIR filters instead of IIR filters. Show the impulse response, frequency response, and in-band ripple levels of each filter: have IIR and FIR filter response subplots on same figure. Identify number of coefficients for each Impulse response in title for easy comparison. All we want here is the filter designs, not the signal processing of the time series by these filters. We do this to be able to compare relative workload of the two types of filters. “The important thing is not to stop questioning” - Albert Einstein