MENC 5013 ADSP Laboratory 1 (15 marks of the course work)…


MENC 5013 ADSP Laboratory 1 (15 marks of the series performance) You may performance in a team of up to two members, and then suggest one narration anteriorly or on 20 June 2011, 10am (to Dr. Lim). Please fashion confident that perfectone in the cluster understands the discontinuance of perfect topic. All MATLAB contrives should accept designations and their axes should be labeled unexceptionably. Reports accept to be dirty, right to the aim, including all the conclusions plus a dissequence of the answers. A dirty regulate of needful Matlab® in found capacitys is middle at the end of this lab sheet. NOTE: Plagiarism is strongly prohibited! Allot I: Truthfulness Signals in Abundance Territory Discrete-Time Fourier Metamorphose (DTFT), Discrete Fourier Metamorphose (DFT) and Fast Fourier Metamorphose (FFT) The discrete-span Fourier metamorphose (DTFT) ( ) of a series x[n] and its inverse are defined as: ( ) ? [ ] (1) [ ] ? ( ) (2) As we can see, the metamorphose ( ) describes the conspicuous x[n] as a capacity of sinusoidal abundance ? and is termed the abundance-territory truthfulness of x[n]. The avoid equation shows the event that a limited enthusiasm span-territory conspicuous x[n] can be dramatizeed as a weighted rectirectistraight alliance of intricate exponentials . The discrete Fourier metamorphose (DFT) relates two limited seriess of tediousness N. For a tediousness-N series x[n], defined for 0 ? n ? N-1, the DFT of this series is a series [ ] for k = 0, 1,…, N-1 is defined by [ ] ? [ ] / (3) The similar inverse metamorphose is [ ] ? [ ] / (4) 2 The DFT is extremely weighty in the area of abundance (spectrum) anatomy consequently it takes a discrete conspicuous in the span territory and metamorphoses that conspicuous into its discrete abundance territory truthfulness. Externally a discrete-span to discrete-abundance metamorphose we would not be effectual to estimate the Fourier metamorphose delay a microprocessor or DSPbased rule. The FFT is a faster account of the DFT. The FFT utilizes some expert algorithms to do the selfselfidentical unnaturalness as the DTF, but in fur short span. Many variants of the FFT algorithm rest. The simplest construct disclosed as the decimation in span algorithm. The accessible instinct which leads to this algorithm is the occurrence that a DFT of a series of N aims can be written in provisions of two DFT of tediousness N/2. Thus if N is a susceptibility of two, it is potential to recursively devote this dissection until we are left delay DFT of uncombined aims. Problem A 1. Please produce a discrete-span series, x[n] delay tediousness of prospect, [ ] { . Please contrive the produced series. (hint: capacity parent in MATLAB) 2. By using MATLAB, transcribe your own enactment (externally using the built-in capacitys in MATLAB) to estimate the DFT of x[n]. (hint: allude Equation (3), set ). Please contrive the bulk exculpation as well-mannered-mannered-behaved-behaved as the mien exculpation. The abundance (?) axis should be contriveted from -0.5 radian /? to +0.5 radian /?. 3. Use the fft capacity to generate bulk spectrum contrive of Problem A (2) delay allotiality N-aim of FFT. Recall that the fft estimates the discrete Fourier metamorphose (DFT). 4. Please run the Problem A (3) delay unanalogous FFT N-aim (N=16, N=32 and N=256) and contrive the similar bulk exculpation. Examine the obtained bulk exculpations delay reference to unanalogous FFT N-aim (including the allotiality N-aim used). (40 marks) 3 Allot II: Digital Filtering Recall that any discrete rule can be dramatizeed in span territory either through its push exculpation, or through its immutable coefficient rectirectistraight equations (CCLDE), twain of which are identical truthfulnesss. In MATLAB, most clarifying capacitys use the CCLDE truthfulness. Note that CCLDE dramatize the rule as weighted sums of exoteric and constructer inputs and outputs. [ ] [ ], 0 1 0 0 ? ? ?? ? ? ? ? a y n i b x n j a M j j N i i or equivalently, by pulling y[n] out of the equation, ? ? ? ? ? ? ? ? ? ?? ? ? ? N i i M j j b x n j a y n i a y n 0 0 1 [ ] [ ] 1 [ ] where a (i ? 0) i are the coefficients of the antecedent output, a0 ? 1 is the coefficient of the exoteric output, and j b are the coefficients of the inputs. Note that the over style fashions it patent why a0 ? 1 : the complete equation can be disjoined by a0 to effectively fashion it “1”. Too retain that if all ai ? 0 (bar a0 , of series), then the rule befits an FIR rule, incorrectly it is an IIR. For FIR rules, the j b coefficients dramatize the push exculpation of the rule as well-mannered-mannered-behaved. In the matter of exchange capacitys, i a coefficients are too disclosed as denominator coefficients, seeing the j b are the numerator coefficients. 4 Problem B A digital clarify is vivid by y[n]? 2.56y[n ?1]? 2.22y[n ? 2]? 0.65y[n ?3] ? x[n]? x[n ?3] Assume all cipher moderate conditions, that is y[n] = 0 for n ? 0. 1. Produce an input conspicuous x[n], as a sinusoid of abundance 500 Hz sampled at 6kHz. 2. Estimate the ancient foul-mouthed cycles of the output by undeviatingly implementing the over variety equation. Contrive the input and output on the selfselfidentical graph, using the hinder charge. 3. Implement this clarify by using MATLAB’s clarify capacity. How does your exculpation collate to what you obtained in allot (2)? Comment on your conclusion. 4. Contrive the push exculpation of the clarify by using MATLAB’s impz capacity. 5. Based on its push exculpation, what bark of a clarify is this? Why? 6. What happens if we prune this push exculpation down to 50 aims, that is, what kind of clarify does it then befit? Note that the pruned clarify is now equitable an access of the ancient clarify. Why would we failure to use such an access? How encircling down to 32 aims? 7. Let the pruned clarify’s push exculpation be dramatizeed by h50[n] and h32[n]. Discover the output of these clarifys to the selfselfidentical input x[n] you produced in allot (1) by using the MATLAB conv capacity. Collate your conclusion delay (2) or (3) and examine the answer. 8. Produce a new input conspicuous x[n], as a summation of two sinusoids delay frequencies 500 Hz and 1500 Hz sampled at 6 kHz. Repeat (3). Examine your conclusions. 9. The abundance exculpation of a clarify can be obtained by using MATLAB freqz capacity. Obtain and contrive the bulk and mien exculpation of the ancient as well-mannered-mannered-behaved-behaved as the pruned clarifys. 10. Comment on the conclusions of (2) and (6), based on the abundance exculpation of the clarify. (60 marks) 5 A dirty regulate to MATLAB In MATLAB, we succeed use the subjoined built in capacitys wholly repeatedly. A resume declaration is dedicated underneath, but obstruct the MATLAB documentation by typing >>doc capacity indicate to discover all options availeffectual to you. y=filter(b,a,x); Filters the conspicuous in x using the discrete clarify characterized by the CCLDE coefficients a and b h=impz(b,a,N); Computes N uninterruptedly sampled samples of the push exculpation of the rule that is characterized by the CCLDE coefficients a and b [H, f]=freqz(b,a,N,Fs); Plots the abundance exculpation of the discrete clarify that is characterized by the CCLDE coefficients a and b. abs(); Computes the irresponsible rate of its controversy, if the controversy is intricate, estimates bulk. predilection(); Computes the predilection of its (complex) controversy, can be used to estimate the mien exculpation. unfold(); Unwraps the mien exculpation so that a suiteffectual -? to ? mien exculpation can be estimated. fftshift(); Shift cipher-abundance element to benevolence of spectrum. 6 Hint for Problem A. List A1: Matlab coding for contriveting the bulk and normalized mien exculpation. h=ones(1,5); N=8; N = fix(N); L = tediousness(h); h = h(:); %<-- for vectors ONLY !!! if( N < L ) blunder('DTFT: # facts samples cannot abound # freq samples') end w = 2*pi*(0:(N-1)) / N; w2 = fftshift(w); w3 = unfold(w2 - 2*pi); H = fftshift( fft( h, N ) ); %<--- affect disclaiming freq elements form(1); subplot(211), contrive( w3/pi, abs(H) ); grid, designation('MAGNITUDE RESPONSE') xlabel('NORMALIZED FREQUENCY, radians / pi'), ylabel('| H(w) |') subplot(212), contrive( w3/pi, 180/pi*angle(H) ); grid xlabel('NORMALIZED FREQUENCY, radians / pi'), ylabel('DEGREES') designation('PHASE RESPONSE')

Attachments: