CS3291DigitalSignalProcessing



《CS3291DigitalSignalProcessing》由会员分享,可在线阅读,更多相关《CS3291DigitalSignalProcessing(36页珍藏版)》请在装配图网上搜索。
1、Click to edit Master title style,,Click to edit Master text styles,,Second level,,Third level,,Fourth level,,Fifth level,,Sept '05,,*,CS3291:,D,igital,S,ignal,P,rocessing,Barry Cheetham,,,,,,Section 1: Introduction,,Signal,: time-varying measurable quantity,,whose variation normally conveys informa
2、tion.,,,Quantity,often a voltage obtained from some transducer,,e.g. a microphone.,,,,It is useful to define two types of signal:,,,Continuous time (analogue),,,Discrete time,,,Analogue signals,: continuous functions of time (t) measured in,,seconds. Exist for all values of t in range -,,to +,,
3、.,,,Examples:,,,,(i) 5sin(62.82t) : sine-wave of frequency 62.82 radians/second ( 10 Hz),,,,0 : t < 0,,(ii),u(t,) =,," step-function " signal.,,,,1 : t,,0,,,Graph of analogue signal against time gives continuous 'waveform',:,t,Voltage,0.1,-0.1,5,t,Voltage,1,Discrete-time signals,: exist only
4、at discrete points in time.,,,Often obtained by,sampling,an analogue signal,,,i.e. measuring its value at discrete points in time.,,,Sampling points separated by equal intervals of T seconds.,,,Given analogue signal,x(t,),,,x[n,],= value of,x(t,) when t =,nT,.,,,Sampling process produces a sequence
5、of numbers:,,,{ ..., x[-2], x[-1], x[0], x[1], x[2], ..... },,,Referred to as {,x[n,]} or ' the sequence,x[n,] '.,,,Sequence exists for all integer n in the range -,,to,,.,,Examples of discrete time signals:,,,(i),{..., -4, -2,,0,, 2, 4, 6, ....},,,,sequence whose nth element,,x[n,], is defi
6、ned by :,x[n,] = 2n.,,Underline sample corresponding to n = 0.,,,,(ii),{ ..., -4.75, -2.94,,0,, 2.94, 4.75, 4.76, ...},,,,,sequence with,x[n,] = 5 sin(62.82t) with t=,nT,and T=0.01.,,,,(iii),{ ..., 0, ..., 0. 0,,1,, 1, 1, ..., 1, ...},,,,“ unit step ” sequence whose nth element is:,,,,0 : n < 0
7、,,,u[n,] =,,,,,,,1 : n,,0,,,Discrete time signals represented graphically as shown for example (i):,n,x[n],1 2 3 4,-3 -2 -1,2,-,-2-,clear all;,,T = 0.01;,% sampling interval (seconds),,% Generate 80 samples of a 10 Hz sine-wave of amplitude 5,,% Need 5 sin(2*pi*10
8、*t) with t=nT for n=1,2, ... 200,,for,n=1:80,,s(n) = 5 * sin(2 * pi * 10 * n * T);,,end,;,,plot (s);,MATLAB demonstration1,,To generate & plot 80 samples of a sine-wave:,0,10,20,30,40,50,60,70,80,-5,0,5,Discrete time signals often generated by,ADC,devices.,,,Produce binary numbers from sampled volta
9、ges or currents.,,,Accuracy determined by 'word-length ' of ADC device,,,i.e. number of bits available for each binary number.,,,,,Quantisation,,: Truncating or rounding sampled value to nearest available binary number,,,Resulting sequence of,quantised,nu
10、mbers is a,digital signal,. .,,Digital signal is discrete time signal with each sample,,digitised for arithmetic processing.,Signal Processing:,,,,,Analogue signals "processed" by circuits consisting of resistors, capacitors,
11、inductors, transistors & operational amplifiers.,,,Digital signals "processed" using programmed computers, microcomputers or special purpose digital hardware.,,,,Examples of the type of processing that may be carried out are:,,,,(i) amplification or attenuation.,,(ii) filtering : e.g. 'filtering
12、 out' some unwanted part of the signal.,,(iii) rectification : making waveform purely positive.,,(iv) modulation : multiplying signal by another signal,,,e.g. a high frequency sine wave.,clear all;,,fs = 8000;,%sampling rate in Hz,,T = 1/fs;,% sampling interval (seconds),,% Generate 10000 samples o
13、f 500 Hz sine-wave:-,,for,n=1:10000,,s(n) = 4000 * sin(2 * pi * 500 * n * T);,,end,;,,% Store in a non-formatted (binary) file:-,,OFid=fopen(,'newsin.pcm',,,'wb',);,,fwrite(OFid, s,,'int16',);,,fclose(,'all',);,MATLAB demo2: Store 500 Hz sine-wave block in file,MATLAB demo 3: Amplify sine-wave,cle
14、ar all;,,%Input from file:-,,fs = 8000;,% sampling rate in Hz,,IFid=fopen(,’newsin.pcm',,,'rb',);,,Insin = fread(IFid,,'int16',);,,,%Amplify by 6 dB:-,,for n=1:10000,,Outsin(n) = 2 * Insin(n);,,end;,,,% Output to a file,,OFid=fopen(,'newop.pcm',,,'wb',);,,fwrite(OFid, Outsin,,'int16',);,,fclose(,'al
15、l',);,clear all;,,%Input speech from a file:-,,fs = 8000;,% sampling rate in Hz,,IFid=fopen(,'operamp.pcm',,,'rb',);,,Inspeech = fread(IFid,,'int16',);,,,%Design FIR digital filter:-,,fc = 1000;,% cut-off frequency in Hz,,[a b] = fir1(20, fc/(0.5*fs) );,,freqz(a,b);,,,%Process speech by filtering:-,
16、,Outspeech = filter(a, b, Inspeech);,,,% Output speech to a file,,OFid=fopen(,'newop.pcm',,,'wb',);,,fwrite(OFid, Outspeech,,'int16',); fclose(,'all',);,MATLAB Demo4 Filtering speech,0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,-1000,-800,-600,-400,-200,0,Normalized Frequency (,´,p,rad/sample),Phase
17、(degrees),0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1,-100,-80,-60,-40,-20,0,Normalized Frequency (,´,p,rad/sample),Magnitude (dB),IFid=fopen(,'newop.pcm',,,'rb',);,,speech = fread(IFid,,'int16',);,,maxamp = max(abs(speech));,,SOUND(speech/maxamp,8000,16);,,fclose(,'all',);,MATLAB Demo5: Listen to spe
18、ech in a file,clear all;,,%Input from file:-,,fs = 8000;,% sampling rate in Hz,,IFid=fopen(,’newsin.pcm',,,'rb',);,,Insin = fread(IFid,,'int16',);,,,%Full-wave recify:-,,for n=1:10000,,Outsin(n) = abs ( Insin(n) ) ;,,end;,,,% Output to a file:-,,OFid=fopen(,'newop.pcm',,,'wb',);,,fwrite(OFid, Outsin
19、,,'int16',);,,fclose(,'all',);,,MATLAB demo6 : Rectify sine-wave,for n=1:10000,,Outsin(n) = 2*Insin(n);,,end;,for n=1:10000,,Outsin(n)=abs(Insin(n));,,end;,Outsin = abs(Insin);,Outsin = 2*Insin;,Using MATLAB more efficiently,Slow,Faster,MATLAB exercise 1: Modulation,Generate 320 samples of a 50 Hz
20、 sine wave sampled at 8kHz and multiply this by by a 1kHz sine wave sampled at 8kHz.,,Plot the resulting waveform,MATLAB exercise 2 : Simulate POTS speech quality,,A ‘plain old fashioned telephone’ transmits speech between 300Hz & 3 kHz. Design & implement high- & low- filters to allow the effect
21、of the band-width restriction to be assessed by listening.,clear all; fs = 8000;,,T=1/fs;,,for,n=1:320,,s50(n) = sin(2*pi*50*n*T);,,end,;,,figure(1); plot (s50);,,for,n=1:320,,smod(n) = s50(n)*sin(2*pi*1000*n*T);,,end,;,,figure(2); plot (smod);,Solution to MATLAB Exercise 1,0,50,100,150,200,250,300
22、,350,-1,-0.8,-0.6,-0.4,-0.2,0,0.2,0.4,0.6,0.8,1,% A solution for MATLAB Exercise 2,,clear all;,,%Input speech from a file:-,,fs = 8000;,% sampling rate in Hz,,IFid=fopen(,'operamp.pcm',,,'rb',);,,Inspeech = fread(IFid,,'int16',);,,,%Design FIR band-pass digital filter:-,,fU = 3000;,% upper cut-off f
23、req Hz,,fL = 300;,% lower cut-off freq,,[a b] = fir1(100, [fL/(0.5*fs) fU/(0.5*fs)] );,,freqz(a,b);,,,%Process speech by filtering:-,,Outspeech = filter(a, b, Inspeech);,,,% Output speech to a file,,OFid=fopen(,'newop.pcm',,,'wb',);,,fwrite(OFid, Outspeech,,'int16',); fclose(,'all',);,WARNING,,If
24、 you do experiments and listen to the output generated, be careful not to expose yourself to high levels of sound.,,Avoid listening to sinusoids except at very low volume using speakers (Do not use headphones for sine-waves).,,Avoid the use of headphones with such experiments.,,Do not risk damage to
25、 your hearing.,,And/or falling out with your,neighbours,.,Applications of DSP:,,’Real time' processing :,,A mobile phone contains 'DSP' processor fast & powerful enough to perform the mathematical operations required to filter digitised speech as it is being received.,,‘Non real time’ processing:,,A
26、 PC can perform DSP processing on a stored recording of music & can take as much time as it needs to complete this processing.,,Non real time DSP useful in its own right; e.g for MP3 compression.,,Also used to 'simulate' software for real time DSP systems before they are built into special purpose
27、 hardware, say for a mobile phone.,,Simulated DSP systems may be tested with stored segments of speech.,,,Real time DSP often uses ',fixed point,' microprocessors since they,,consume less power & are less expensive than ',floating point,' devices.,,,A fixed point processor deals with all numbers as
28、integers.,,,Numbers often restricted to a word-length of only 16 bits.,,,Overflow can occur with disastrous consequences to sound quality.,,If we avoid overflow by scaling numbers to keep them small in amplitude,,,we lose accuracy as,quantisation,error is larger proportion of the value.,,Fixed point
29、 DSP programming can be quite a difficult task.,,When we use a PC for non real time DSP, we have,floating point,,operations available with word-lengths that are larger than 16 bits.,,This makes the task much easier.,,When simulating fixed point real time DSP on a PC, we can restrict,,programs to int
30、eger arithmetic, & this is useful.,Examples of signals commonly processed in digital form:,,,Speech, as encountered in telephony, for example.,,Biomedical signals such as heart signals & “brain waves”.,,Sound & music.,,Video & images.,,Radar & sonar signals.,,Advantages of DSP:,,More & more signals
31、are being transmitted & stored in digital form so it makes sense to process them in digital form also.,,DSP systems can be designed & tested in simulation using PCs.,,Accuracy pre-determined by word-length & sampling rate.,,Reproducible as every copy of DSP system will perform identically.,,Characte
32、ristics of system will not drift with temperature or ageing.,,Availability of advanced VLSI technology.,,DSP systems can be reprogrammed without changing hardware.,,Products can be updated via Internet.,,DSP systems can perform functions that would be extremely difficult or impossible in analogue f
33、orm; e.g.,,adaptive filtering,,speech recognition.,Disadvantages of digital signal processing,:,,,DSP designs can be expensive especially for high bandwidth signals where fast analogue/digital conversion is required.,,,Design of DSP systems can be extremely time-consuming & a highly complex and spec
34、ialised activity. There is an acute shortage of computer science and electrical engineering graduates with the knowledge and skill required.,,,Power requirements for digital processing can be high, thus making it unsuitable for battery powered portable devices. Fixed point processing devices are a
35、vailable which are simpler than floating point devices and less power consuming. However the ability to program such devices is a particularly valued and difficult skill.,,Some processes, e.g. amplification, & filtering, are,linear,.,,Processes may also be,time-invariant,.,,,Processes which are bo
36、th,,linear,&,time-invariant,are,LTI,.,,Consider,impulse-responses,of such LTI systems.,,Leads to,frequency-response,&,system function,,,These come from the,Fourier,,,,Laplace,and,z-transforms,, and are all related to,'convolution',.,,These concepts allow us to:,,(i) analyse effects of LTI systems on
37、,analog,& digital signals,,,(ii) understand & employ design methods for such systems.,GAIN,FREQUENCY,1,f,C,Gain-response of a low-pass filter may be derived from its frequency-response,Modern signal processing often programmed on ‘DSP’ microprocessors which are fast enough to compute each output in
38、"real time".,,Consider how a DSP processor differs from a Pentium IV ?,,Analogue signals must be converted into digital form and vice-versa.,,Effects of sampling, ADC & DAC studied in this course.,,Also the Fast Fourier transform (FFT) & its many applications,,,including spectral estimation.,Summar
39、y of Course Objectives:-,,,1 Importance of DSP, its jargon, & meaning of real time processing. Advantages/disadvantages.,,Analogue, discrete time & digital signals.,,Sampling & quantisation in general terms.,,,,2. Brief review of analogue & digital signal processing systems,,,Transfer function and
40、 frequency-response of an analogue filter.,,Low-pass and band-pass analogue filters.,,Butterworth low-pass gain response approximation.,,,3. Discrete LTI signal processing systems.,,Recursive & non-recursive difference equations.,,Signal flow-graphs & their implementation by computer programs.,,Imp
41、ulse-response for discrete time systems.,,FIR & IIR type digital filters.,,Stability and causality. Time-domain convolution.,,Frequency response & DTFT. Gain and phase responses.,,Linear phase and group delay. Inverse DTFT.,,Use of MATLAB for analysing the frequency-response of digital filters.
42、,,,4. Design of FIR digital filters by windowing method & alternative methods.,,5: Introduction to z-transforms & IIR type discrete time filters,,System function, H(z), as z-transform of impulse response.,,Relationship between system function, difference equation, signal flow-graph & software imple
43、mentation of FIR and IIR type digital filters.,,Poles and zeros & distance rule.,,Design of a digital IIR "notch" filter and a resononator by pole/zero placement. Application to these filters to sound recordings.,,6: Design of IIR type digital filters using analogue filter approximations,,Derivati
44、ve approximation & bilinear transformation & other methods .,,7: Digital processing of analogue signals and other data,,Sampling theory, aliasing, effect of quantisation and, sample and hold reconstruction. Oversampling to simplify analogue filters..,,8. Introduction to the DFT,,Relation to DTFT.
45、 Inverse DFT. Effects of windowing & frequency domain sampling. Implementation by the ‘FFT’ algorithm (FFT).,,Use of DFT and FFT for spectral estimation.,,9. Use of MATLAB for implementing digital filters & FFT.,,Background knowledge needed:-,,,Basic maths ( complex numbers, Argand diagram, mo
46、dulus & argument, differentiation, simple integration, sum of an arithmetic series, complex roots of unity, factorisation of quadratic equation, De Moivre's Theorem, exponential function, natural logarithms).,,,,Experience with any high-level computer programming language.,,Material from the 2nd Yr
47、Course CS2232: Signals & Systems useful.,Recommended Book:,,1. S.W. Smith, "Scientist and Engineer's Guide to Digital Signal Processing " California Tech. Publishing, 2nd ed., 1999, available complete at:,Problems:,,1. Why do we call continuous time signals “analogue”.,,2. When could you describe a
48、SIGNAL as being linear?,,3 Give a formula for an analogue signal which is zero until t=0 and then becomes equal to a 50 Hz sine wave of amplitude 1 Volt.,,4. Given that u(t) is an analogue step function, sketch the signal u(t)sin(2.5,,t).,,5. If u(t)sin(5,,t) is sampled at intervals of T=0.1 s
49、econds, what discrete time signal is obtained? What is the sampling frequency?,,6. What is the difference between a discrete time signal and a digital signal?,,7. Define (i) amplification, (ii) filtering, (iii) rectification and (iv) modulation.,,8. From the types of signals listed as being comm
50、only processed by DSP, choose one & describe a form of DSP processing which may usefully be applied to it.,,9. Are there advantages of DSP other than those listed.,,10. Give one further possible disadvantage of DSP?,11. What is meant by “fixed point” and “floating point”?,,12. What does the term “f
51、ilter” normally mean to a Computer Scientist? Explain the terms “analogue filter” and “digital filter”.,,13. What is meant by the term “real time” in DSP?,,14. Think of an application of DSP where the processing of a digitised analogue signal need not be carried out in real time?,,15. There are man
52、y applications of DSP where the digital signal being processed is not obtained by sampling an analogue signal. Give some examples.,,16. Give modulus &argument of the complex numbers: 3+4j and -3e,4j,. Plot these numbers on an Argand diagram & calculate the distance between them.,,17. Analogue sign
53、al: x(t) = 4 cos(,,t) is passed through a circuit that differentiates,,it with respect to t. Give formula for output. Plot amplitude & phase of the,,sinusoid obtained against,,in range 0 to 20 radians/second.,,18. Analogue signal: x(t) = 4 cos(,,t) is passed thro’ circuit that integrates it
54、with respect to t. Give formula for output & plot its amplitude & phase against,,.,,19. Sum the geometric series: 1 + e,-j,,+ e,-2j,,+ e,-3j,,+ … + e,-Nj,,.,,20. Sum the infinite geometric series: 1 + 0.9e,-j,,+ 0.81e,-2j,,+ 0.729e,-3j,,+ …,21. Show that 1 + e,-j,,= 2e,-j,,/2,[cos(,,/2)]
55、 and hence plot the modulus & argument of this complex number against,,in the range 0 to,,.,,22. Find the roots of: x,2,+ 0.9 x + 0.81 = 0 in polar (modulus & argument) form.,,23. The Fourier series for a periodic signal x(t) with period,,radians/s can be written in 3 forms: cos & sin form, ampl
56、itude & phase form & exponential form. If x(t) = 1+sin,,t-(1/2) cos(2,,t)-(1/3)sin(3,,t) +(1/4)cos(4,,t) +(1/5)sin(5,,t)- … convert this to each of the other two forms.,,24. Fourier transform of analogue signal x(t) is complex function of frequency,,(in radians/second) referred to in many t
57、extbooks as X(j,,). Some books call this X(,,) & most Comms books use,f,(freq in Hertz) rather than,,. Give formulae for analogue Fourier transform & its inverse using these 3 forms of notation.,,25. Show that if x(t) is real, then X(-j,,) = X*(j,,) or in other notation X(-,,) = X*(,,) or X
58、((-f)) = X*((f)). Why do we need negative frequencies?,,26. An nth order analogue Butterworth low-pass filter has the gain-response:,,G(,,) = 1 /,,(1 + (,,/,,C,),2n,). Show that its gain is 0 dB at,,=0 & -3 dB at,,=,,C,. Show that gain at,,= 10,,C,for 6th order Butt low-pass filter is -120 dB.,,27. Given sinusoid of frequency,,, if filter A attenuates it by 20 dB & filter B amplifies it by 50 dB, is it true that if x(t) is passed thro’ filter A and the output from filter A is passed through filter B, the overall gain would be 30 dB?,
- 温馨提示:
1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
2: 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
3.本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 装配图网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。