” ESE531程序 辅导、 写作Matlab程序、Matlab编程语言ESE531 Spring 2018University of PennsylvaniaDepartment of Electrical and System EngineeringDigital Signal ProcessingESE531, Spring 2018 Final Project: Adaptive Filtering Friday, Mar. 30Due: Tuesday, April 24th, 11:59pmProject Teams: You can work in groups of no more than 2 for this project. You may workalone. Each group must turn in one report with the clear contributions of each memberclearly delineated. Everyone is responsible for understanding the design and report in itsentirety, And the instructor reserves the right to interview the students to verify this.You are to complete all three parts of the handout: Part A, Part B, and Part C. Part D maybe turned in for extra credit.1. Part A: ADAPTIVE NOTCH FILTER.DO NOT use high level Matlab commands that may be available in the Signal Processingand other Matlab toolboxes for adaptive filtering in this part. It is easy and much moreinstructive to write your own Matlab code to implement these.A simple real IIR Notch filter is a second order filter with two conjugate zeros on theunit circle and two conjugate poles inside the unit circle,The notch is at real frequency 0 and the closeness of the poles to the unit circledetermines the notch sharpness. This filter can be used to reject a strong interferingsinusoid that is Contaminating a desired signal. For unknown interfering frequency wewant to build an adaptive notch filter, based on the principle that the filter output isminimized when the notch is at the correct location. Note that the adaptation is withrespect to the parameter value a, with r generally set at a fixed value. Since this isnot an FIR filter, we cannot directly apply the LMS algorithm derived for adaptiveFIR filters. However it is possible to develop a simple algorithm for the adaptive notchfilter.We can decompose H(z) as a cascade of the FIR part followed by the all-pole filter,and we can write the output Sequence y[n] when input sequence is x[n] in terms of anintermediate sequence e[n]:ESE531 Spring 2018The gradient of y[n]2 with respect to a is 2y[n]dy[n]da where the derivative is not simple;thus, as an approximation we replace dy[n]da with de[n]da = x[n1]. To minimize E(y[n]2),we approximate its gradient as 2y[n]x[n 1]. The adaptive notch filter update of theparameter a (for fixed choice of r) is therefore: a[n + 1] = a[n] y[n]x[n 1]. Sincea = 2cos(0) we have 2 a 2 . We should impose this constraint for the updatesand reset a[n] = 0 if it is out of bounds.(a) Create a simple simulation of an adaptive notch filter for a desired signal withunwanted additive sinusoidal interference. The desired signal may be some realsequence perhaps with a small amount of additive noise; you can use a singlefrequencydesired signal as one possibility, but experiment with other types ofdesired signal also. The interference will be a single strong frequency (low signalto-interferencepower ratio). Start with a = 0 (0 =2, mid-point of frequencyband). Consider different small values of , different fixed values of r (of theorder of 0.85 to 0.98), Different interfering frequencies and powers. Note that will have to be quite small. Give plots and results on frequency response,convergence, spectra, etc. to show how well your adaptive filter works.(b) Consider one case where the single interfering sinusoid has a frequency that ischanging slowly. For example, you might define the interference as a sinusoidwith a slowly linearly increasing frequency or some other slowly changing profile.Examine the tracking Ability of the adaptive notch filter and give your results andcomments. (Note that the instantaneous frequency of a sinusoid cos(2 (t)) isddt )(c) Can you extend your scheme of part (a) to a filter scheme creating two notchesto reject two sinusoidal components? In particular, you might consider a cascadeof two single-notch second-order notch filters, and adapt the a parameter of each(i.e. a = a1 and a = a2). Explain your approach and give your results for a testcase of two interfering sinusoids on a desired signal.2. Part B: ADAPTIVE EQUALIZATIONDO NOT use high level Matlab commands that may be available in the Signal Processingand other Matlab toolboxes for adaptive filtering in this part. It is easy and much moreinstructive to write your own Matlab code to implement these.Here you will use adaptive filtering to equalize or invert an unknown channel, with (1)the help of a training sequence and also (2) blindly, without training.Training Mode Equalization:Consider a source sending continuous-time pulses of amplitude A or A to representbits 1 and 0. The sequence of such pulses passing through a channel can undergodistortion causing them to spread out and overlap with each other, creating whatis called inter-symbol interference or ISI. In addition, any front-end filtering at thereceiver may cause further pulse spreading.The channel may Be modeled in discrete-time as follows: an input sequence s[n] (randomsequence) of A amplitudes passes through a discrete-time LTI system (channel)2ESE531 Spring 2018with unit-sample response sequence h[n] to produce the observed sequence of channeloutput samples x[n] in the presence of noise. Thus we have x[n] = h[n] s[n] + w[n]where w[n] is a sequence of zero-mean, independent, Gaussian variates representingadditive noise. The channel may be assumed to be an FIR channel of order L (lengthL + 1), and its unit-sample response h[n] is unknown. At the channel output we usean FIR adaptive equalizer filter of larger length M + 1 operating on x[n] to try toinvert the channel, to ideally get at its output a delayed version of the original inputsequence s[n], after the adaptive filter has converged. In order to implement the LMStraining algorithm for the equalizer, we need a copy of the actual input sequence foruse as the desired (delayed) output signal during an initial training phase. After thetraining phase, the equalizer should have converged to a good approximation of aninverse filter.(a) Produce a random 1 amplitude training sequence of length 1000. Assumesome channel unit-sample response h[n]; you may use for example something likeh = [0.3, 1, 0.7, 0.3, 0.2] for your initial trials, but you should also test your implementationfor different unknown channels of such short lengths ( 7). Atthe output of the channel (after convolution of input sequence with h[n]) addGaussian noise to simulate a more realistic noisy output condition. You may usean SNR of around 20-35 dB. Now implement an adaptive filter operating on thenoisy channel Output x[n], using a training sequence which is an appropriatelydelayed version of the input sequence. The delay will take care of any unknownchannel delay (for example, for the channel given above the channel delay maybe 2 units,) and equalizer filter delay. Examine the performance you get with differentcombinations of equalizer filter order M (choose this between 10 and 30),filter step-size , adaptive filter initialization, SNR, channel impulse responseh[n], etc.Examine the impulse and frequency response and pole-zero plot of the channel,and the impulse and frequency responses of the equalizer upon convergence, andprovide plots and results that show how well your adaptive equalizer works underdifferent channel and noise conditions. Plot also the impulse response and frequencyresponse of the equivalent LTI system between input and output, i.e. theresult of the channel and equalizer in cascade, after the equalizer has reached reasonableconvergence. Determine if output decisions about the transmitted bits arebetter after equalization, compared to the un-equalized case. (You can check theoutput of the system using the equalizer obtained after convergence, by sendingseveral thousand further inputs into the channel.) Comment on your findings.Blind Equalization:It is not always possible to Have an initial training phase, during which an equalizerat the receiver knows the input, to form an error to drive its LMS training algorithm.The transmitter may be continuously sending data through a channel, and it may beleft to the receiver to figure out for itself how to equalize the channel, without thebenefit of a known training input sequence.3ESE531 Spring 2018In the context of the simple scenario of part 3(a), the situation now is that the receiverknows only that the transmitted pulse amplitudes are two-level 1 values (moregenerally A amplitudes). It has to use only this general knowledge about the natureof the input to learn how to equalize the channel. It has no knowledge of an explicittransmitted sequence that it can use for training, and we say it is operating in theblind mode.A simple approach to blind equalization in this setting is based on the use of theconstant- modulus property of the input; the modulus or absolute value of the inputamplitude sequence is a constant (= 1 or more generally A). The constant-modulus(CM) blind equalization algorithm attempts to equalize the channel by iterative adjustmentsto the equalizer with the Objective of minimizing a measure of deviation ofthe equalizer output modulus values from a constant modulus value.Referring to the LMS adaptive algorithm description, we now have input sequencex[n] to an equalizer that produces output y[n].coefficient vector at time n. Differentiating this with respect to gn we easily findthat the gradient de2ndgnis proportional to (|y[n]|2 1)y[n]xn. Thus the correspondingstochastic gradient algorithm becomes gn+1 = gn (|y[n]|2 1)y[n]xn.(b) Implement this blind adaptive equalizer. Does the blind equalizer converge to areasonably equalized condition? You will have to try different settings for andequalizer order M. (You will need possibly many tens of thousands of iterations,and will need to experiment with rather small value of , perhaps of the orderof 104 depending on the specifics of your other parameters.) Use short channelimpulse response lengths (around 5) and dont use equalizer lengths that are toolong (around 20 maximum). Try different SNRs, but expect poor results if theSNR is not high.Provide plots and results, and give explanations/comments as in the case of part(a) above. Also provide a one-dimensional scatter plot of the output amplitudesafter equalizer convergence, to get a visual sense of how well the equalizer is ableto bring the output amplitudes close to the desired two amplitudes.3. Part C: FILTER DESIGN USING LMS ALGORITHMDO NOT use high level Matlab commands that may be available in the Signal Processingand other Matlab toolboxes for adaptive filtering in this part. It is easy and much moreinstructive to write Your own Matlab code to implement these.Suppose a desired frequency response Hd(ej) is specified (with even magnitude andodd phase function). You want to design a real, causal, FIR impulse response {h[0], h[1], …, h[M]}for an M-th order FIR filter which gives a good approximation to this Hd(ej). Thedesired frequency response may not be of a standard type such as a low-pass or bandpassspecification. For this we may form a long, real, test input signal sequence{xin[n], n = 0, 1, …, K} consisting of a large number L of individual frequencies spanningthe range (0, 0.5) . The corresponding ideal desired output {xd[n], n = 0, 1, …, K}4ESE531 Spring 2018is obtained using the magnitude scaling and phase shift specified by Hd(ej) for eachsuch input frequency. The impulse response coefficients of an FIR filter of order Mmay then be adaptively learned using the LMS algorithm to get approximately thisdesired output sequence xd[n] when driven by the test input sequence xin[n] .(a) Let the desired magnitude response be:and the FIR filter of order M is to have linear phase.Form reasonable test input and corresponding desired output sequences, containingan appropriate number L of individual frequencies spread over the (0,0.5)interval. Use the LMS adaptive FIR filter scheme to find a good design for acausal FIR filter of order M that will produce a good approximation of the desiredoutput. Note that you will have to experiment with different combinations ofstep-size (this has to be Generally small), filter length M, number of test frequenciesL, and length of the test sequences N (this will generally be large). Give plotsof your designed filter(s) characteristics (impulse response, frequency response).Discuss briefly/comment on any specific aspects of your method or results thatyou want to highlight.(b) Now suppose the desired response isHd(ej2f ) = (j2f, for 0 |f| 0.30, for 0.3 |f| 0.5any additional linear phase term is allowed. The real FIR filter of order M approximatingthis is to have generalized linear phase. Repeat your procedure ofpart (a) for this case. After you have obtained your FIR filter, test it on someinteresting inputs.4. Part D: MULTI-CHANNEL FIR FILTER-BANK.You are to implement a perfect reconstruction filter-bank (PR-FB) using Matlab, andapply it to images. You can use Matlab routines such as firpr2chfb and mfilt.firdecim,etc., for this purpose. Image Processing and related toolbox functions in Matlab maybe useful (e.g. imread, imshow, mat2gray, hist, imhist, etc.)(a) Design a one-dimensional 2-channel PR-FB. This can be applied for separable(rows and columns) sub-band analysis/synthesis of two-dimensional images. Forimage processing, strict spatial frequency separation may not be as critical as inother applications. Experiment with a small filter order (between 6 and 12) anda longer one. Use a reasonable choice for filter band-edge. Your design will yieldthe analysis and synthesis filters H0, H1, G0, and G1. (You might want to firsttest the filter bank on some simple one-dimensional test signal.)5ESE531 Spring 2018(b) You will now use a grayscale 8-bit, 512×512 image to test image sub-band decomposition.A couple of possible test images (man.gif, owl.gif) are postedon the course calendar; any other reasonable test image can be used. Apply your2-channel analysis filter bank of part (a) to your test image(s), to get decompositioninto (256×256) sub-band components (Low-Low or LL, Low-High, HighLow,and High-High). The image filtering can be implemented as separable rowcolumnfiltering operations. Test for exact reconstruction when synthesizing theimage back from these four sub-bands.(c) Perform reconstruction or synthesis as above, but this time with all pixels ofthe LH, HL, and HH Sub-band images set to 0. Comment on the nature of thereconstruction you see.(d) Now instead of using single zero levels as in (c) for all pixels of the LH, HL,and HH sub-band images, experiment with less severe compression by using onebit (two levels) per pixel quantization for these three sub-band images, and alsowith three level (and, if you want, four level or 2-bit) per pixel quantization. Todesign reasonable quantization schemes (levels and thresholds) you may considerhistograms of pixel values for the sub-bands.(e) Do a further decomposition of the Low-Low (LL) image obtained in part (b) byapplying the same 2-channel analysis filter bank to it. (This corresponds for 1-D signals to octave- Band filtering into 3 sub-bands). Now apply considerationssimilar to those of parts (c) and (d) to see if reasonable reconstructions can beobtained with simple quantization. Note: There can be different delays or shiftsfor different sub-band octave components.6ESE531 Spring 2018Project Submission: Your report submission for this project will consist of two parts. Project Report:You should submit by the due date a single filed report (preferably pdf) explaining whatyou did and the results you obtained, including figures, test cases, interpretations andcomments, as well as responses to any specific questions asked above. Please explainbriefly your Matlab code; Include a copy of all your Matlab code in your report in anAppendix. The report must be uploaded to Canvas by midnight on the due date. MATLAB Code and Other Soft Files: Also submit (upload) by the due date throughthe Assignments Area on the ESE 531 Canvas Site all supporting material (all yourMatlab code files, test input/output files, and any other results files). Ideally allplaced in a compressed .zip file. Please make sure you follow the proper procedure forsubmitting files through Canvas.如有需要,请加QQ:99515681 或邮箱:99515681@qq.com
“
添加老师微信回复‘’官网 辅导‘’获取专业老师帮助,或点击联系老师1对1在线指导。