代做ECM3165 Digital Signal Processing调试Matlab程序

ECM3165- Digital Signal Processing - TMA

Note: This assignment carries 10% of the module mark.

Completed work should be handed in using the ELE2 system by the deadlines stated there.

Information on downloading and installing Matlab on your own PC/Mac can be found at

https://www.exeter.ac.uk/departments/it/new/softwarecatalogue/#a8

Note: You must write your Matlab routines as m-files (script. files), rather than input lines individually via the Matlab command window. Using m-files enables you to alter, correct and modify routines more easily and efficiently than if you were to use command line entry.

You must follow the coding suggestions given here (DO NOT use code generated by AI)

You must include comment statements in your m-files too.

Include a copy your m-files as an appendix to your report.

In this TMA we investigate tone generation using marginally-stable IIR digital filters, and the use of such techniques for the generation of DTMF signals as used with touch-tone keypads.

2.1 Tone generation using marginally-stable digital filters (60 marks)

(a) The aim of a tone generator is to produce a sinewave type signal. A digital (discrete-time) sinewave, let’s call it s(n), can be described as

s(n) = sin(Ω0n) = sin(w0nTs)

where the symbols have their usual meaning.

If we assume that the signal s(n) is to be generated by a DTLTI system (i.e. it will be the output from the DTLTI system), then the impulse response of this system is simply equal to s(n), i.e.

ℎ(n) = sin(Ω0n)

Now that we know h(n) for the DTLTI tone generator, we can find its transfer function using the z-transform, since H(z) = ZT{h(n)}, where ZT{} represents the z-transform. operation.

We can show that H(z) for the above tone generator can be written as

Draw, in block diagram form, a DTLTI system to implement this transfer function H(z) and write down the numerical value for the system’s multiplier coefficients, assuming Ω0 = π/4. (15 marks)

(b) The next step is to implement the filter from part (a) using the filter function in Matlab, to then input into that filter an impulse signal, and, finally, to plot the resulting output of the filter (the output should of course be the tone signal!).

The filter function is described in Matlab as follows (found by typing ‘help filter’ in the command window)

filter - 1-D digital filter

This MATLAB function filters the input data x using a rational transfer

function defined by the numerator and denominator coefficients b and a.

y = filter(b,a,x)

The b and a coefficients should be those you found in part (a) above (but – remember Matlab needs an extra ‘zeroth-order’ a coefficient that is always set to 1).

To form. the impulse signal that we are going to use for the input to this filter, we need to generate a signal that has one sample value equal to 1, and all other samples values equal to zero. Let’s assume a sampling frequency of 10 kHz and use the value for the tone frequency from part (a) above, i.e. Ω0 = π/4 (or f0 = Ω0fS/(2π)).

We can now set up the impulse signal in Matlab using the following code:

fs=10000; omega_o = pi/4; fo=omega_o*fs/(2*pi); % set sampling and tone frequency

t=0:1/fs:1; % set suitable time range (here up to max of 1 second)

x=zeros(1,length(t)); % create an input signal of all zeros

x(1)=1; % set first value of input signal equal to 1, to generate an impulse

Once you have set up the input (impulse) signal to your filter as above, find and plot the filter output signal using Matlab’s filter function appropriately. Your output should be a sinusoidal tone with a frequency equal to f0 (or 1250 Hz). If it isn’t, you have done something wrong! (Note that you may have to adjust the time range over which you plot your signal to see the sinewave properly).

Next, confirm that your output signal is a 1250 Hz tone by finding (and plotting) its amplitude spectrum using Matlab’s fft routine. Make sure you normalise the amplitude spectrum properly

Finally, in this section, plot the pole-zero diagram for the tone generator system.

You should plot the pole-zero diagram using the fvtool command, as shown below:

fvtool(b, a, 'polezero'); %find and plot the poles and zeros of a DTLTI system defined by coeffs b and a

Comment on the position of the poles for this tone generator system, and the resulting stability, or otherwise, of this particular DTLTI system. (45 marks)

2.2 DTMF Tone generation (40 marks)

Tone generation similar to that used above finds practical application in dual-tone multifrequency signal (DTMF) generation used for touch-tone keypads on telephones, mobile phones etc.

The standard DTMF system is shown Figure 1 below.

When the number 5 is pressed, for example, a dual-frequency tone consisting of 770 Hz and 1336 Hz is generated (and used by the telephone switching system to identify which number to call/record).

In the second part of this TMA your task is to write a Matlab script. (m-file) that can, in response to a user input of a number from 1 to 9, generate the correct DTMF tones. Use the same sampling frequency as in 2.1 part (c) above (i.e. 10 kHz)

You must use the method of tone generation developed in part 2.1 above (i.e. use digital filters of the type in 2.1 but with appropriate coefficient values, to generate the tones).

Note that you can input a number and assign it to a variable in Matlab using something along the following lines:

number = input(‘input a keypad number 1 to 9‘); % prompts user to input a number 0 to 9

Figure 1: Tone generation in the DTMF keypad system

You should verify that your program is working by carrying out the following:

 Selecting a keypad number to input to your generator program (a single number will suffice)

 Generating the required DTMF tone and plotting its waveform. (i.e. time-domain plot of the DTMF tone generated)

 Calculating and plotting the amplitude spectrum of the DTMF tone, and confirming that it contains the required frequencies

Reminder, you only have to demonstrate the above for a single pressed number, not all of them!

The part below, on listening to the tones you generate, is NOT ASSESSED – it is only there for you to look at if you so wish.

If you wish to listen to the tones you generate (they should sound the same as those generated by your mobile phone), you can convert a signal to an audio output in Matlab using the sound command, as described below (but note that generating sounds is just for fun – not an assessed part of this TMA)

sound(Y,FS) sends the signal in vector Y (with sample frequency

FS) out to the speaker on platforms that support sound. Values in

Y are assumed to be in the range -1.0 <= y <= 1.0. Values outside

that range are clipped.

sound(Y) plays the sound at the default sample rate of 8192 Hz.

Example:

load handel

sound(y,Fs)

You should hear a snippet of Handel's Hallelujah Chorus. (40 marks)

Your Report

You should write a formal report covering all of your findings from the above investigation.

Reports must be word-processed not handwritten (though you can include handwritten equations).

Be concise, though not at the expense of omitting important information/results.

Plots generated in Matlab should be exported to a suitable file format and pasted into you report where appropriate (screenshots/photos acceptable if of suitable quality).

Remember that all graphs should always have axes appropriately numbered and labelled - otherwise they are effectively meaningless!

All figures (i.e. graphs etc.) should also have a figure number, and all figures should be referred to somewhere in the text (a basic report writing 'norm').

The report should include all the results requested in the script, an appropriate level of discussion and an answer to any questions posed in the script.

You must include your Matlab m-files (script. files) as an appendix to your report.






热门主题

课程名

mktg2509 csci 2600 38170 lng302 csse3010 phas3226 77938 arch1162 engn4536/engn6536 acx5903 comp151101 phl245 cse12 comp9312 stat3016/6016 phas0038 comp2140 6qqmb312 xjco3011 rest0005 ematm0051 5qqmn219 lubs5062m eee8155 cege0100 eap033 artd1109 mat246 etc3430 ecmm462 mis102 inft6800 ddes9903 comp6521 comp9517 comp3331/9331 comp4337 comp6008 comp9414 bu.231.790.81 man00150m csb352h math1041 eengm4100 isys1002 08 6057cem mktg3504 mthm036 mtrx1701 mth3241 eeee3086 cmp-7038b cmp-7000a ints4010 econ2151 infs5710 fins5516 fin3309 fins5510 gsoe9340 math2007 math2036 soee5010 mark3088 infs3605 elec9714 comp2271 ma214 comp2211 infs3604 600426 sit254 acct3091 bbt405 msin0116 com107/com113 mark5826 sit120 comp9021 eco2101 eeen40700 cs253 ece3114 ecmm447 chns3000 math377 itd102 comp9444 comp(2041|9044) econ0060 econ7230 mgt001371 ecs-323 cs6250 mgdi60012 mdia2012 comm221001 comm5000 ma1008 engl642 econ241 com333 math367 mis201 nbs-7041x meek16104 econ2003 comm1190 mbas902 comp-1027 dpst1091 comp7315 eppd1033 m06 ee3025 msci231 bb113/bbs1063 fc709 comp3425 comp9417 econ42915 cb9101 math1102e chme0017 fc307 mkt60104 5522usst litr1-uc6201.200 ee1102 cosc2803 math39512 omp9727 int2067/int5051 bsb151 mgt253 fc021 babs2202 mis2002s phya21 18-213 cege0012 mdia1002 math38032 mech5125 07 cisc102 mgx3110 cs240 11175 fin3020s eco3420 ictten622 comp9727 cpt111 de114102d mgm320h5s bafi1019 math21112 efim20036 mn-3503 fins5568 110.807 bcpm000028 info6030 bma0092 bcpm0054 math20212 ce335 cs365 cenv6141 ftec5580 math2010 ec3450 comm1170 ecmt1010 csci-ua.0480-003 econ12-200 ib3960 ectb60h3f cs247—assignment tk3163 ics3u ib3j80 comp20008 comp9334 eppd1063 acct2343 cct109 isys1055/3412 math350-real math2014 eec180 stat141b econ2101 msinm014/msing014/msing014b fit2004 comp643 bu1002 cm2030
联系我们
EMail: 99515681@qq.com
QQ: 99515681
留学生作业帮-留学生的知心伴侣!
工作时间:08:00-21:00
python代写
微信客服:codinghelp
站长地图