文档库 最新最全的文档下载
当前位置:文档库 › 数字信号处理答案9

数字信号处理答案9

数字信号处理答案9
数字信号处理答案9

Chapter 9 Solutions 9.1 Substituting h[n] for y[n] and δ[n] for x[n]: h[n] = 0.1δ[n] + 0.5δ[n –1] + 0.9δ[n –2] + 0.5δ[n –3] + 0.1δ[n –4]

The impulse response has a finite number of non-zero terms and is therefore FIR. The length of the impulse response is 5, which is one greater than the maximum delay in the filter. This is a general relationship for all impulse responses that start at n = 0: the length of the impulse response is one sample larger than the maximum delay in the filter. 9.2 (a) ()]6n [x ]5n [x ]4n [x ]3n [x ]2n [x ]1n [x ]n [x 71]n [y -+-+-+-+-+-+=

(b) ()]6n []5n []4n []3n []2n []1n []n [71]n [h -δ+-δ+-δ+-δ+-δ+-δ+δ=

(c) ()6

5

4

3

2

1

z

z z

z

z

z

171

)z (H ------++++++=

(d) ()Ω

-Ω-Ω

-++++++=

Ω6j 5j 4j 3j 2j j e

e

e

e

e e

17

1)(H

9.3 (a) From question 2,

()Ω

-++++++=

Ω6j 5j 4j 3j 2j j e

e

e

e

e

e

17

1)(H

(b) In the pass band, which lies within the first “bump” of the magnit ude spectrum, the phase spectrum follows a straight line. This means the phase is linear in this region, which in turn means that no distortion will occur. 9.4 (a) The difference equation for a three-term moving average filter is

()]2n [x ]1n [x ]n [x 3

1]n [y -+-+=

The filter finds the average of each group of three input samples. The first sixteen outputs are:

|H(Ω)| Ω

The filter has the effect of smoothing out the large spikes in the input. Boundary effects are evident in the first few samples of the output. (b) The frequency response for the three-term moving average filter is

Ω

-+

+

=

Ω2j j e

3

1e

3

13

1)(H

The magnitude response for the filter shows a cut-off frequency at approximately 1 radian. This point defines the pass band edge for this simple filter. (c) To examine the phase response in the pass band, phases between 0 and 1 radian are calculated in small steps.

The values in the table certainly appear to describe a straight line. The true phase response, plotted below, confirms that phase is linear in the pass band.

9.5 For this pass band edge frequency the impulse response for an ideal low pass filter is

(

)()n 5.0sin n 1n sin n 1]n [h 11π

=

Ωπ

=

The sample values are given in the table. Note that at n = 0, it is easiest to evaluate h 1[n] if it is re-expressed as

()())n 5.0sinc 5.0n

5.0n 5.0sin n n 5.0]n [h 1π

=

At n = 0, the sinc function has the value 1, so h 1[0] = 0.5/π.

9.6 (a)

The impulse response for the ideal low pass filter is given by

()??

?

??π=??? ??ππ=

Ωπ

=

4n inc s 414n sin n 1

n sin n 1]n [h 1

1

The samples of the impulse response between n = –3 and n = 3 are After truncation, the impulse response for the non-deal low pass filter consists of the seven non-zero samples listed in the table and zero samples for other values of n. The figure below shows the truncated impulse response.

(b) The impulse response must be shifted three steps to the right to make it causal. The causal impulse response is shown in the figure. Its equation is

h[n] = 0.0750δ[n] + 0.1592δ[n –1] + 0.2251δ[n –2] + 0.2500δ[n –3]

+ 0.2251δ[n –4] + 0.1592δ[n –5] + 0.0750δ[n –6]

(c) The frequency response for the impulse response is:

Ω

-Ω-Ω-+++=Ω3j 2j j e

2500.0e 2251.0e 1592.00750.0)(H Ω

-+++6j 5j 4j e

0750.0e

1592.0e

2251.0

An ideal low pass filter with a cut-off frequency of π/4 radians and a pass band gain identical to the non-ideal filter is superimposed on the plot.

9.7 (a) The pass band ripple is the maximum deviation from unity gain in the pass band. The minimum gain the pass band is 0.962; the maximum is 1.078. Thus, the pass band ripple is δp = 0.078.

(b) The gain at the top of the firsts bump in the stop band is 0.1005. This is the stop band ripple δs.

(c) Since the pass band ripple is 0.078, the gain at the edge of the pass band is 1 –

0.078 = 0.922, or –0.705 dB.

(d) The gain at the edge of the stop band is 0.1005, or –19.96 dB.

(e) The stop band attenuation is the difference between the gain at the edge of the pass band and the gain at the edge of the stop band, in dB. The stop band attenuation is –

0.705 – (–19.96) = 19.26 dB.

(f) The pass band ripple defines the edge of the pass band. It occurs at the frequency

0.672 rads. The edge of the stop band is the first frequency at which the filter gain drops below the stop band ripple. This frequency is 0.892 radians. The transition width is the difference between the stop band edge and the pass band edge, or 0.22 radians.

(The magnitude response shown uses a 27-term rectangular window to create a low pass filter with its pass band edge at π/4 radians.)

9.8 (a) The pass band ripple is practically zero. The exact value of the gain at the edge of the pass band is 20log(1–δp) = –0.019 dB, for a pass band ripple of δp = 0.002. (b) The stop band ripple is determined by the gain at the edge of the stop band, set by the highest side lobe. From the graph it appears to be about –52 dB. The exact value is –51.5 dB. Therefore 20logδs = –51.5, which gives δs = 0.0027.

(c) The bandwidth is set by the –3 dB frequencies. Their exact values are 1.608 and

2.478 radians, though they cannot be identified with this much precision from the graph. Using f S = 22000, these convert to analog frequencies 5630 and 8677 Hz, for a bandwidth of 3047 Hz.

(d) The stop band attenuation is the negative of the gain at the edge of the stop band, or –51.5 dB.

(e) The center frequency is 2.04 radians, or 7143 Hz.

(f) The upper edge of the pass band, where the gain is 20log(1–δp) = –0.019 dB, occurs at 2.365 radians. The frequency at the edge of the stop band occurs at 2.661 radians. Thus, the upper pass band and stop band edges lie at 8281 and 9317 Hz, for a transition width of 1036 Hz.

(The magnitude response shown uses a 71-term hamming window to create a band pass filter with pass band edges at 0.5π and 0.8π radians.)

(b) Gain at the edge of pass band = –0.72 dB means 1 –δp = 0.92, or δp = 0.08, which is also the required pass band ripple. Stop band attenuation of 25 dB is the same as stop band gain of –

9.10

(a)

(c) (d)

9.11 (a)

(b)

(c)

(d)

9.12 (a) A rectangular window gives the required stop band attenuation. Since N =

0.91(12000)/1000 = 10.92, N = 11 is the best choice.

(b) A Hamming window is the best choice. Since N = 3.44(5000)/2000 = 8.6, N = 9 is the best choice.

(c) As in (b), a Hamming window is the best choice. Since N = 3.44(5000)/500 =

34.4, N = 35 terms are needed.

(d) The stop band attenuation is the difference between the pass band and stop band gains, or 40 dB. A Hanning window gives the required attenuation. The transition width is the distance in frequency between the stop band and pass band edges, or 1.5 kHz. From the table, N = 3.32(22000)/1500 = 48.7. Since the number of terms must be odd, N = 49 is the best choice.

9.13 (a)(i) Some pass band ripple is added to the sketch to show it exists.

(ii) A Hanning window can be used to meet the specifications. The transition width is 2.5 – 1 = 1.5 kHz. N = 3.32 (12000)/1500 = 26.6, or 27 terms must be included.

(iii) The pass band edge frequency used in the design should be (desired pass band edge) + (transition width/2) = 1000 + (1500/2) = 1750 Hz.

(b)(i) Some pass band ripple is added to the sketch to show it exists.

(ii) A rectangular window can meet the specifications. N = 0.91(2000)/330 = 5.52. To be sure the specifications are met, choose N = 7.

(iii) To obtain a pass band edge at 500 Hz, the design must proceed with the pass band edge frequency 500 + 330/2 = 665 Hz.

9.14 (a) 50 zeros, 50 poles, 51 coefficients (b) 100 zeros, 100 poles, 101 coefficients

9.15 The transition width is 500 Hz. To get the pass band edge in the right place, the pass band edge frequency for the design should be pass band edge + transition width/2 = 3000 + 500/2 = 3250 Hz. The matching digital frequency is Ω1 = 2πf/f S =

2π(3250)/12000 = 0.5417π rads. Thus, the equation for the ideal low pass filter with the correct pass band edge is h 1[n] = sin(n Ω1)/(n π) = sin(0.5417πn)/(n π). This function is straightforward to evaluate, except at n = 0, where h 1[0] = (Ω1/π)sinc(n Ω1) = 0.5417.

The required stop band attenuation of 20log(0.01) = –40 dB points to the Hanning

window. This window’s stop band attenuation leads to a stop band ripple of 10(–43/20) = 0.0071 which satisfies the stop band ripple requirements. The pass band ripple for this window is –0.06 dB or 0.007, which also satisfies the specifications. The transition width for the filter is 500 Hz. The number of terms required is 3.32(12000)/500 = 79.7. Using 79 terms will produce a filter slightly poorer than the one specified. Using 81 terms will produce a filter that exceeds the specifications. For this case, select 79 terms. The

window function is w[n] = 0.5 + 0.5cos(2πn/N –1) = 0.5 + 0.5cos(2πn/78), defined for n = –39 to n = 39. The impulse response samples are given by

h 1[n]w[n] =

???

?

?π+π78n 2cos 5.05.0n )n 5417.0sin(

It is defined between n = –39 and n = 39. This set of samples is shifted to the right, so the final impulse response is defined between n = 0 and n = 78.

9.16 (a) For a rectangular window, N = 0.91f S /T.W., so T.W. = 0.91(20000)/25 = 728 Hz.

(b) For the rectangular window, the gain at the edge of the pass band is about –0.9 dB, and the gain at the edge of the stop band is –21 dB. The pass band edge occurs at 2 kHz and the stop band edge at 2.728 kHz.

9.17 To obtain linear phase in the pass band, an FIR design should be used. The transition width is 1.5 kHz, so the pass band edge frequency 4500 + 1500/2 = 5250 Hz, or 2π(5250)/16000 = 0.6563π rads must be used in the design. The impulse for the ideal low pass filter with this pass band edge frequency is h1[n] = sin(nΩ1)/(nπ) =

sin(0.6563πn)/(nπ), where h1[0] = 0.6563.

A Blackman window will meet the stop band attenuation requirements. The number of terms should be 5.98(16000)/1500 = 63.8, or 63. The window w[n] = 0.42 + 0.5cos(2πn/62) + 0.08cos(4πn/62) is defined between n = –31 and n = 31.

The impulse response sample values are calculated from h1[n]w[n] and shifted right by 31 steps for causality. The calculations are shown for n = 0 to n = 31. The impulse response for negative values of n is a mirror image of the impulse response for positive values of n. The figure below shows the entire causal impulse response for the specified filter.

9.18 (a) From the table, N = 4.33f S/T.W., so T.W. = 4.33(11025)/79 = 604 Hz.

(b) The stop band edge is a transition width away from the pass band edge, at 6000 + 604 = 6604 Hz.

(c) From the table, the stop band attenuation is 64 dB. Since the pass band gain is 0 dB, the gain at the edge of the stop band is –64 dB.

9.19 The required stop band attenuation can be provided by a rectangular window. For the pass and stop band edges given, the transition width is 1 kHz. This gives N =

0.91f S/T.W. = 0.91(10000)/1000 = 9.1 or 9 terms.The window function is w[n] = 1, defined from n = –4 to n = 4.

The pass band edge frequency 2000 + 1000/2 = 2500 Hz, or 2π(2500)/10000 = 0.5π rads must be used in the design. The impulse for the ideal low pass filter with this pass band edge frequency is h1[n] = sin(nΩ1)/(nπ) = sin(0.3πn)/(nπ), where h1[0] = 0. 3.

The impulse response sample values are calculated from h1[n]w[n] and shifted right by 4 steps for causality. The impulse response is calculated in the table.

Using the impulse response samples,

y[n] = –0.1061x[n–1] + 0.3183x[n–3] + 0.5x[n–4]

+ 0.3183x[n–5] – 0.1061x[n–7]

9.20 (a) To get a pass band edge at 1.75 kHz, a pass band edge frequency of 1750 + 1500/2 = 2500 Hz must be used in the design. Ω1 = 2π(2500)/8000 = 0.625π, and the impulse for the ideal low pass filter with this pass band edge frequency is h1[n] =

sin(nΩ1)/(nπ) = sin(0.625πn)/nπ, with h1[0] = 0.625.

A Hamming window must be used to meet the stop band attenuation requirements. For a transition width of 1.5 kHz, N = 3.44(8000)/1500 = 18.3 or 19 terms are needed. The window function w[n] = 0.54 + 0.46cos(2πn/18), defined between n = –9 and n = 9.

The impulse response is calculated from h[n] = h1[n]w[n], as shown in the following table.

From the table, the impulse response can be written as:

h[n] = -0.0026δ[n] + 0.0079δ[n–2] – 0.0116δ[n–3] – 0.0112δ[n–4]

+ 0.0493δ[n–5] - 0.0313δ[n–6] – 0.1004δ[n–7] + 0.2859δ[n–8]

+ 0.6250δ[n–9] + 0.2859δ[n–10] – 0.1004δ[n–11]

– 0.0313δ[n–12] + 0.0493δ[n–13] - 0.0112δ[n–14]

– 0.0116δ[n–15] + 0.0079δ[n–16] – 0.0026δ[n–18]

The difference equation may be deduced directly from this impulse response: y[n] = -0.0026x[n] + 0.0079x[n–2] – 0.0116x[n–3] – 0.0112x[n–4]

+ 0.0493x[n–5] - 0.0313x[n–6] – 0.1004x[n–7] + 0.2859x[n–8]

+ 0.6250x[n–9] + 0.2859x[n–10] – 0.1004x[n–11] – 0.0313x[n–12]

+ 0.0493x[n–13] - 0.0112x[n–14] – 0.0116x[n–15] + 0.0079x[n–16]

– 0.0026x[n–18]

(b) The transfer function H(z) and the frequency response H(Ω) can be found from the difference equation. The magnitude response is given by |H(Ω)| when plotted against digital frequencies between 0 and π radians. When plotted against frequencies between 0 and 4000 Hz instead, the magnitude response is called |H(f)|.

The designed filter matches the specifications reasonably well.

|H(f)|

f

9.21 A low pass filter is needed. For reasonable stop band attenuation, a Hanning window may be used. For reasonably steep roll-off, N = 71 terms are selected. Since N = 3.32f S/T.W., this gives a transition width of T.W. = 3.32(10)/71 = 0.47 Hz. Thus, the pass band edge frequency for design should be 1 + 0.47/2 = 1.235 Hz. The digital frequency that corresponds to this pass band edge is Ω1 = 2π(1.235)/10 = 0.247π rads, and the impulse response for the ideal low pass filter is h1[n] = sin(nΩ1)/(nπ) = sin(0.247πn)/(nπ), with h1[0] = 0.247. The window function is w[n] = 0.5 + 0.5cos(2πn/70), defined for n = –35 to n = 35, so the impulse response for the low pass filter is h[n] = h1[n]w[n]. The impulse response is made causal through shifting to the right by 35 samples, to give samples between n = 0 and n = 70.

9.22 Since the number of terms is odd, the low pass filter’s impulse response is obtained by negating alternate terms:

h[n] = 0.0101δ[n] + 0.2203δ[n–1] + 0.5391δ[n–2]

+ 0.2203δ[n–3] + 0.0101δ[n–4]

9.23 The required band pass filter shape is first shifted back to an equivalent low pass filter. The low pass filter has center frequency 0 kHz, pass band edge 1 kHz and transition width 900 Hz. Thus, the pass band edge frequency for design should be 1000 + 900/2 = 1450 Hz. The digital frequency that corresponds to this pass band edge is Ω1 = 2π1450/16000 = 0.18125π rads, and the impulse response for the ideal low pass filter is h1[n] = sin(nΩ1)/(nπ) = sin(0.18125πn)/(nπ), with h1[0] = 0.18125.

The Hanning window gives the required stop band attenuation. The transition width is achieved with N = 3.32(16000)/900 = 59 terms. Thus, the window function is

w[n] = 0.5 + 0.5cos(2πn/58), defined for n = –29 to n = 29.

The center frequency f0 4 kHz gives a digital frequency Ω0 = 2π(4000)/16000 = 0.5π rads. To shift the low pass filter to the correct band pass position in the frequency domain requires multiplying by cos(nΩ0) = cos(0.5πn) in the time domain.

The impulse response for the band pass filter is given by h[n] =

h1[n]w[n]cos(nΩ0). Half of the samples are shown in the table. The entire impulse response is plotted in the figure.

数字信号处理实验二报告

实验二 IIR数字滤波器设计及软件实现 1.实验目的 (1)熟悉用双线性变换法设计IIR数字滤波器的原理与方法; (2)学会调用MATLAB信号处理工具箱中滤波器设计函数(或滤波器设计分析工具fdatool)设计各种IIR数字滤波器,学会根据滤波需求确定滤波器指标参数。 (3)掌握IIR数字滤波器的MATLAB实现方法。 (3)通过观察滤波器输入输出信号的时域波形及其频谱,建立数字滤波的概念。 2.实验原理 设计IIR数字滤波器一般采用间接法(脉冲响应不变法和双线性变换法),应用最广泛的是双线性变换法。基本设计过程是:①先将给定的数字滤波器的指标转换成过渡模拟滤波器的指标;②设计过渡模拟滤波器;③将过渡模拟滤波器系统函数转换成数字滤波器的系统函数。MATLAB信号处理工具箱中的各种IIR数字滤波器设计函数都是采用双线性变换法。第六章介绍的滤波器设计函数butter、cheby1 、cheby2 和ellip可以分别被调用来直接设计巴特沃斯、切比雪夫1、切比雪夫2和椭圆模拟和数字滤波器。本实验要求读者调用如上函数直接设计IIR数字滤波器。 本实验的数字滤波器的MATLAB实现是指调用MATLAB信号处理工具箱函数filter对给定的输入信号x(n)进行滤波,得到滤波后的输出信号y(n)。 3. 实验内容及步骤 (1)调用信号产生函数mstg产生由三路抑制载波调幅信号相加构成的复合信号st,该函数还会自动绘图显示st的时域波形和幅频特性曲线,如图1所示。由图可见,三路信号时域混叠无法在时域分离。但频域是分离的,所以可以通过滤波的方法在频域分离,这就是本实验的目的。 图1 三路调幅信号st的时域波形和幅频特性曲线 (2)要求将st中三路调幅信号分离,通过观察st的幅频特性曲线,分别确定可以分离st中三路抑制载波单频调幅信号的三个滤波器(低通滤波器、带通滤波器、高通滤波器)的通带截止频率和阻带截止频率。要求滤波器的通带最大衰减为0.1dB,阻带最小衰减为

数字信号处理实验报告

实验一MATLAB语言的基本使用方法 实验类别:基础性实验 实验目的: (1)了解MATLAB程序设计语言的基本方法,熟悉MATLAB软件运行环境。 (2)掌握创建、保存、打开m文件的方法,掌握设置文件路径的方法。 (3)掌握变量、函数等有关概念,具备初步的将一般数学问题转化为对应计算机模型并进行处理的能力。 (4)掌握二维平面图形的绘制方法,能够使用这些方法进行常用的数据可视化处理。 实验内容和步骤: 1、打开MATLAB,熟悉MATLAB环境。 2、在命令窗口中分别产生3*3全零矩阵,单位矩阵,全1矩阵。 3、学习m文件的建立、保存、打开、运行方法。 4、设有一模拟信号f(t)=1.5sin60πt,取?t=0.001,n=0,1,2,…,N-1进行抽样,得到 序列f(n),编写一个m文件sy1_1.m,分别用stem,plot,subplot等命令绘制32 点序列f(n)(N=32)的图形,给图形加入标注,图注,图例。 5、学习如何利用MATLAB帮助信息。 实验结果及分析: 1)全零矩阵 >> A=zeros(3,3) A = 0 0 0 0 0 0 0 0 0 2)单位矩阵 >> B=eye(3) B = 1 0 0 0 1 0 0 0 1 3)全1矩阵 >> C=ones(3) C = 1 1 1 1 1 1 1 1 1 4)sy1_1.m N=32; n=0:N-1; dt=0.001; t=n*dt; y=1.5*sin(60*pi*t); subplot(2,1,1), plot(t,y); xlabel('t'); ylabel('y=1.5*sin(60*pi*t)'); legend('正弦函数'); title('二维图形'); subplot(2,1,2), stem(t,y) xlabel('t'); ylabel('y=1.5*sin(60*pi*t)'); legend('序列函数'); title('条状图形'); 00.0050.010.0150.020.0250.030.035 t y = 1 . 5 * s i n ( 6 * p i * t ) 二维图形 00.0050.010.0150.020.0250.030.035 t y = 1 . 5 * s i n ( 6 * p i * t ) 条状图形

数字信号处理答案解析

1-1画出下列序列的示意图 (1) (2) (3) (1) (2)

(3) 1-2已知序列x(n)的图形如图1.41,试画出下列序列的示意图。 图1.41信号x(n)的波形 (1)(2)

(3) (4) (5)(6) (修正:n=4处的值为0,不是3)(修正:应该再向右移4个采样点)1-3判断下列序列是否满足周期性,若满足求其基本周期 (1) 解:非周期序列; (2) 解:为周期序列,基本周期N=5; (3)

解:,,取 为周期序列,基本周期。 (4) 解: 其中,为常数 ,取,,取 则为周期序列,基本周期N=40。 1-4判断下列系统是否为线性的?是否为移不变的? (1)非线性移不变系统 (2) 非线性移变系统(修正:线性移变系统) (3) 非线性移不变系统 (4) 线性移不变系统 (5) 线性移不变系统(修正:线性移变系统)1-5判断下列系统是否为因果的?是否为稳定的? (1) ,其中因果非稳定系统 (2) 非因果稳定系统 (3) 非因果稳定系统 (4) 非因果非稳定系统

(5) 因果稳定系统 1-6已知线性移不变系统的输入为x(n),系统的单位脉冲响应为h(n),试求系统的输出y(n)及其示意图 (1) (2) (3) 解:(1) (2) (3)

1-7若采样信号m(t)的采样频率fs=1500Hz,下列信号经m(t)采样后哪些信号不失真? (1) (2) (3) 解: (1)采样不失真 (2)采样不失真 (3) ,采样失真 1-8已知,采样信号的采样周期为。 (1) 的截止模拟角频率是多少? (2)将进行A/D采样后,的数字角频率与的模拟角频率的关系如何? (3)若,求的数字截止角频率。 解: (1) (2) (3)

数字信号处理实验程序2.

2.1 clc close all; n=0:15; p=8;q=2; x=exp(-(n-p.^2/q; figure(1; subplot(3,1,1; stem(n,x; title('exp(-(n-p^2/q,p=8,q=2'; xk1=fft(x,16; q=4; x=exp(-(n-p.^2/q; subplot(3,1,2; xk2=fft(x,16; stem(n,x; title('exp(-(n-p^2/q,p=8,q=4'; q=8; x=exp(-(n-p.^2/q;

xk3=fft(x,16; subplot(3,1,3; stem(n,x; title('exp(-(n-p^2/q,p=8,q=8';%时域特性figure(2; subplot(3,1,1; stem(n,abs(xk1; title('exp(-(n-p^2/q,p=8,q=2'; subplot(3,1,2; stem(n,abs(xk2; title('exp(-(n-p^2/q,p=8,q=4'; subplot(3,1,3; stem(n,abs(xk3; title('exp(-(n-p^2/q,p=8,q=8';%频域特性%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%% p=8;q=8; figure(3; subplot(3,1,1; stem(n,x; title('exp(-(n-p^2/q,p=8,q=8';

xk1=fft(x,16; p=13; x=exp(-(n-p.^2/q; subplot(3,1,2; xk2=fft(x,16; stem(n,x; title('exp(-(n-p^2/q,p=13,q=8'; p=14; x=exp(-(n-p.^2/q; xk3=fft(x,16; subplot(3,1,3; stem(n,x; title('exp(-(n-p^2/q,p=14,q=8';%时域特性figure(4; subplot(3,1,1; stem(n,abs(xk1; title('exp(-(n-p^2/q,p=8,q=8'; subplot(3,1,2; stem(n,abs(xk2; title('exp(-(n-p^2/q,p=13,q=8'; subplot(3,1,3;

数字信号处理实验作业

实验6 数字滤波器的网络结构 一、实验目的: 1、加深对数字滤波器分类与结构的了解。 2、明确数字滤波器的基本结构及其相互间的转换方法。 3、掌握用MA TLAB 语言进行数字滤波器结构间相互转换的子函数及程序编写方法。 二、实验原理: 1、数字滤波器的分类 离散LSI 系统对信号的响应过程实际上就是对信号进行滤波的过程。因此,离散LSI 系统又称为数字滤波器。 数字滤波器从滤波功能上可以分为低通、高通、带通、带阻以及全通滤波器;根据单位脉冲响应的特性,又可以分为有限长单位脉冲响应滤波器(FIR )和无限长单位脉冲响应滤波器(IIR )。 一个离散LSI 系统可以用系统函数来表示: M -m -1-2-m m m=0 012m N -1-2-k -k 12k k k=1 b z b +b z +b z ++b z Y(z)b(z)H(z)=== =X(z)a(z) 1+a z +a z ++a z 1+a z ∑∑ 也可以用差分方程来表示: N M k m k=1 m=0 y(n)+a y(n-k)=b x(n-m)∑∑ 以上两个公式中,当a k 至少有一个不为0时,则在有限Z 平面上存在极点,表达的是以一个IIR 数字滤波器;当a k 全都为0时,系统不存在极点,表达的是一个FIR 数字滤波器。FIR 数字滤波器可以看成是IIR 数字滤波器的a k 全都为0时的一个特例。 IIR 数字滤波器的基本结构分为直接Ⅰ型、直接Ⅱ型、直接Ⅲ型、级联型和并联型。 FIR 数字滤波器的基本结构分为横截型(又称直接型或卷积型)、级联型、线性相位型及频率采样型等。本实验对线性相位型及频率采样型不做讨论,见实验10、12。 另外,滤波器的一种新型结构——格型结构也逐步投入应用,有全零点FIR 系统格型结构、全极点IIR 系统格型结构以及全零极点IIR 系统格型结构。 2、IIR 数字滤波器的基本结构与实现 (1)直接型与级联型、并联型的转换 例6-1 已知一个系统的传递函数为 -1-2-3 -1-2-3 8-4z +11z -2z H(z)=1-1.25z +0.75z -0.125z 将其从直接型(其信号流图如图6-1所示)转换为级联型和并联型。

数字信号处理实验一

一、实验目的 1. 通过本次实验回忆并熟悉MATLAB这个软件。 2. 通过本次实验学会如何利用MATLAB进行序列的简单运算。 3. 通过本次实验深刻理解理论课上的数字信号处理的一个常见方法——对时刻n的样本附近的一些样本求平均,产生所需的输出信号。 3. 通过振幅调制信号的产生来理解载波信号与调制信号之间的关系。 二、实验内容 1. 编写程序在MATLAB中实现从被加性噪声污染的信号中移除噪声的算法,本次试验采用三点滑动平均算法,可直接输入程序P1.5。 2. 通过运行程序得出的结果回答习题Q1.31-Q1.33的问题,加深对算法思想的理解。 3. 编写程序在MATLAB中实现振幅调制信号产生的算法,可直接输入程序P1.6。 4. 通过运行程序得出的结果回答习题Q1.34-Q1.35的问题,加深对算法思想的理解。 三、主要算法与程序 1. 三点滑动平均算法的核心程序: %程序P1.5 %通过平均的信号平滑 clf; R=51; d=0.8*(rand(R,1)-0.5);%产生随噪声 m=0:R-1; s=2*m.*(0.9.^m);%产生为污染的信号 x=s+d';%产生被噪音污染的信号 subplot(2,1,1); plot(m,d','r-',m,s,'g--',m,x,'b-.');

xlabel('时间序号n');ylabel('振幅'); legend('d[n]','s[n]','x[n]'); x1=[0 0 x];x2=[0 x 0];x3=[x 0 0]; y=(x1+x2+x3)/3; subplot(2,1,2); plot(m,y(2:R+1),'r-',m,s,'g--'); legend('y[n]','s[n]'); xlabel('时间序号n');ylabel('振幅'); 2. 振幅调制信号的产生核心程序:(由于要几个结果,因此利用subplot函数画图) %程序P1.6 %振幅调制信号的产生 n=0:100; m=0.1;fH=0.1;fL=0.01; m1=0.3;fH1=0.3;fL1=0.03; xH=sin(2*pi*fH*n); xL=sin(2*pi*fL*n); y=(1+m*xL).*xH; xH1=sin(2*pi*fH1*n); xL1=sin(2*pi*fL1*n); y1=(1+m1*xL).*xH; y2=(1+m*xL).*xH1; y3=(1+m*xL1).*xH; subplot(2,2,1); stem(n,y); grid; xlabel('时间序号n');ylabel('振幅');title('m=0.1;fH=0.1;fL=0.01;'); subplot(2,2,2); stem(n,y1); grid; xlabel('时间序号n');ylabel('振幅');title('m=0.3;fH=0.1;fL=0.01;'); subplot(2,2,3); stem(n,y2); grid; xlabel('时间序号n');ylabel('振幅');title('m=0.3;fH=0.3;fL=0.01;'); subplot(2,2,4); stem(n,y3); grid;

数字信号处理实验报告一

武汉工程大学 数字信号处理实验报告 姓名:周权 学号:1204140228 班级:通信工程02

一、实验设备 计算机,MATLAB语言环境。 二、实验基础理论 1.序列的相关概念 2.常见序列 3.序列的基本运算 4.离散傅里叶变换的相关概念 5.Z变换的相关概念 三、实验内容与步骤 1.离散时间信号(序列)的产生 利用MATLAB语言编程产生和绘制单位样值信号、单位阶跃序列、指数序列、正弦序列及随机离散信号的波形表示。 四实验目的 认识常用的各种信号,理解其数字表达式和波形表示,掌握在计算机中生成及绘制数字信号波形的方法,掌握序列的简单运算及计算机实现与作用,理解离散时间傅里叶变换,Z变换及它们的性质和信号的频域分

实验一离散时间信号(序列)的产生 代码一 单位样值 x=2; y=1; stem(x,y); title('单位样值 ') 单位阶跃序列 n0=0; n1=-10; n2=10; n=[n1:n2]; x=[(n-n0)>=0]; stem(n,x); xlabel('n'); ylabel('x{n}'); title('单位阶跃序列');

实指数序列 n=[0:10]; x=(0.5).^n; stem(n,x); xlabel('n'); ylabel('x{n}'); title('实指数序列');

正弦序列 n=[-100:100]; x=2*sin(0.05*pi*n); stem(n,x); xlabel('n'); ylabel('x{n}'); title('正弦序列');

随机序列 n=[1:10]; x=rand(1,10); subplot(221); stem(n,x); xlabel('n'); ylabel('x{n}'); title('随机序列');

数字信号处理实验作业

实验5 抽样定理 一、实验目的: 1、了解用MA TLAB 语言进行时域、频域抽样及信号重建的方法。 2、进一步加深对时域、频域抽样定理的基本原理的理解。 3、观察信号抽样与恢复的图形,掌握采样频率的确定方法和插公式的编程方法。 二、实验原理: 1、时域抽样与信号的重建 (1)对连续信号进行采样 例5-1 已知一个连续时间信号sin sin(),1Hz 3 ππ=0001f(t)=(2f t)+6f t f ,取最高有限带宽频率f m =5f 0,分别显示原连续时间信号波形和F s >2f m 、F s =2f m 、F s <2f m 三情况下抽样信号的波形。 程序清单如下: %分别取Fs=fm ,Fs=2fm ,Fs=3fm 来研究问题 dt=0.1; f0=1; T0=1/f0; m=5*f0; Tm=1/fm; t=-2:dt:2; f=sin(2*pi*f0*t)+1/3*sin(6*pi*f0*t); subplot(4,1,1); plot(t,f); axis([min(t),max(t),1.1*min(f),1.1*max(f)]); title('原连续信号和抽样信号'); for i=1:3; fs=i*fm;Ts=1/fs; n=-2:Ts:2; f=sin(2*pi*f0*n)+1/3*sin(6*pi*f0*n); subplot(4,1,i+1);stem(n,f,'filled'); axis([min(n),max(n),1.1*min(f),1.1*max(f)]); end 程序运行结果如图5-1所示:

原连续信号和抽样信号 图5-1 (2)连续信号和抽样信号的频谱 由理论分析可知,信号的频谱图可以很直观地反映出抽样信号能否恢复原模拟信号。因此,我们对上述三种情况下的时域信号求幅度谱,来进一步分析和验证时域抽样定理。 例5-2编程求解例5-1中连续信号及其三种抽样频率(F s>2f m、F s=2f m、F s<2f m)下的抽样信号的幅度谱。 程序清单如下: dt=0.1;f0=1;T0=1/f0;fm=5*f0;Tm=1/fm; t=-2:dt:2;N=length(t); f=sin(2*pi*f0*t)+1/3*sin(6*pi*f0*t); wm=2*pi*fm;k=0:N-1;w1=k*wm/N; F1=f*exp(-j*t'*w1)*dt;subplot(4,1,1);plot(w1/(2*pi),abs(F1)); axis([0,max(4*fm),1.1*min(abs(F1)),1.1*max(abs(F1))]); for i=1:3; if i<=2 c=0;else c=1;end fs=(i+c)*fm;Ts=1/fs; n=-2:Ts:2;N=length(n); f=sin(2*pi*f0*n)+1/3*sin(6*pi*f0*n); wm=2*pi*fs;k=0:N-1; w=k*wm/N;F=f*exp(-j*n'*w)*Ts; subplot(4,1,i+1);plot(w/(2*pi),abs(F)); axis([0,max(4*fm),1.1*min(abs(F)),1.1*max(abs(F))]); end 程序运行结果如图5-2所示。 由图可见,当满足F s≥2f m条件时,抽样信号的频谱没有混叠现象;当不满足F s≥2f m 条件时,抽样信号的频谱发生了混叠,即图5-2的第二行F s<2f m的频谱图,,在f m=5f0的围,频谱出现了镜像对称的部分。

数字信号处理试题和答案 (1)

一. 填空题 1、一线性时不变系统,输入为x(n)时,输出为y(n);则输入为2x(n)时,输出为2y(n) ;输入为x(n-3)时,输出为y(n-3) 。 2、从奈奎斯特采样定理得出,要使实信号采样后能够不失真还原,采样频率fs与信号最高频率f max关系为:fs>=2f max。 3、已知一个长度为N的序列x(n),它的离散时间傅立叶变换为X(e jw),它的N点离散傅立叶变换X(K)是关于X(e jw)的N 点等间隔采样。 4、有限长序列x(n)的8点DFT为X(K),则X(K)= 。 5、用脉冲响应不变法进行IIR数字滤波器的设计,它的主要缺点是频谱的交叠所产生的现象。 6.若数字滤波器的单位脉冲响应h(n)是奇对称的,长度为N,则它的对称中心是(N-1)/2 。 7、用窗函数法设计FIR数字滤波器时,加矩形窗比加三角窗时,所设计出的滤波器的过渡带比较窄,阻带衰减比较小。 8、无限长单位冲激响应(IIR)滤波器的结构上有反馈环路,因此是递归型结构。 9、若正弦序列x(n)=sin(30nπ/120)是周期的,则周期是N= 8 。 10、用窗函数法设计FIR数字滤波器时,过渡带的宽度不但与窗的类型有关,还与窗的采样点数有关 11.DFT与DFS有密切关系,因为有限长序列可以看成周期序列的主值区间截断,而周期序列可以看成有限长序列的周期延拓。 12.对长度为N的序列x(n)圆周移位m位得到的序列用x m (n)表示,其数学表达式为 x m (n)= x((n-m)) N R N (n)。 13.对按时间抽取的基2-FFT流图进行转置,并将输入变输出,输出变输入即可得到按频率抽取的基2-FFT流图。 14.线性移不变系统的性质有交换率、结合率和分配律。 15.用DFT近似分析模拟信号的频谱时,可能出现的问题有混叠失真、泄漏、栅栏效应和频率分辨率。

数字信号处理实验报告(实验1_4)

实验一 MATLAB 仿真软件的基本操作命令和使用方法 实验容 1、帮助命令 使用 help 命令,查找 sqrt (开方)函数的使用方法; 2、MATLAB 命令窗口 (1)在MATLAB 命令窗口直接输入命令行计算3 1)5.0sin(21+=πy 的值; (2)求多项式 p(x) = x3 + 2x+ 4的根; 3、矩阵运算 (1)矩阵的乘法 已知 A=[1 2;3 4], B=[5 5;7 8],求 A^2*B

(2)矩阵的行列式 已知A=[1 2 3;4 5 6;7 8 9],求A (3)矩阵的转置及共轭转置 已知A=[1 2 3;4 5 6;7 8 9],求A' 已知B=[5+i,2-i,1;6*i,4,9-i], 求B.' , B' (4)特征值、特征向量、特征多项式 已知A=[1.2 3 5 0.9;5 1.7 5 6;3 9 0 1;1 2 3 4] ,求矩阵A的特征值、特征向量、特征多项式;

(5)使用冒号选出指定元素 已知:A=[1 2 3;4 5 6;7 8 9];求A 中第3 列前2 个元素;A 中所有列第2,3 行的元素; 4、Matlab 基本编程方法 (1)编写命令文件:计算1+2+…+n<2000 时的最大n 值;

(2)编写函数文件:分别用for 和while 循环结构编写程序,求 2 的0 到15 次幂的和。

5、MATLAB基本绘图命令 (1)绘制余弦曲线 y=cos(t),t∈[0,2π]

(2)在同一坐标系中绘制余弦曲线 y=cos(t-0.25)和正弦曲线 y=sin(t-0.5), t∈[0,2π] (3)绘制[0,4π]区间上的 x1=10sint 曲线,并要求: (a)线形为点划线、颜色为红色、数据点标记为加号; (b)坐标轴控制:显示围、刻度线、比例、网络线 (c)标注控制:坐标轴名称、标题、相应文本; >> clear;

数字信号处理实验1认识实验

实验1认识实验-MATLAB语言上机操作实践 一、实验目的 ㈠了解MATLAB语言的主要特点、作用。 ㈡学会MATLAB主界面简单的操作使用方法。 ㈢学习简单的数组赋值、运算、绘图、流程控制编程。 二、实验原理 ㈠简单的数组赋值方法 MATLAB中的变量和常量都可以是数组(或矩阵),且每个元素都可以是复数。 在MATLAB指令窗口输入数组A=[1 2 3;4 5 6;7 8 9],观察输出结果。然后,键入:A(4,2)= 11 键入:A (5,:) = [-13 -14 -15] 键入:A(4,3)= abs (A(5,1)) 键入:A ([2,5],:) = [ ] 键入:A/2 键入:A (4,:) = [sqrt(3) (4+5)/6*2 –7] 观察以上各输出结果。将A式中分号改为空格或逗号,情况又如何?请在每式的后面标注其含义。 2.在MATLAB指令窗口输入B=[1+2i,3+4i;5+6i ,7+8i], 观察输出结果。 键入:C=[1,3;5,7]+[2,4;6,8]*i,观察输出结果。 如果C式中i前的*号省略,结果如何? 键入:D = sqrt (2+3i) 键入:D*D 键入:E = C’, F = conj(C), G = conj(C)’ 观察以上各输出结果, 请在每式的后面标注其含义。 3.在MATLAB指令窗口输入H1=ones(3,2),H2=zeros(2,3),H3=eye(4),观察输出结果。 ㈡、数组的基本运算 1.输入A=[1 3 5],B= [2 4 6],求C=A+B,D=A-2,E=B-A 2.求F1=A*3,F2=A.*B,F3=A./B,F4=A.\B, F5=B.\A, F6=B.^A, F7=2./B, F8=B.\2 *3.求B',Z1=A*B’,Z2=B’*A 观察以上各输出结果,比较各种运算的区别,理解其含义。 ㈢、常用函数及相应的信号波形显示 例1:显示曲线f(t)=2sin(2πt),(t>0) ⅰ点击空白文档图标(New M-file),打开文本编辑器。 ⅱ键入:t=0:0.01:3; (1) f=2*sin(2*pi*t); (2) plot(t,f); title(‘f(t)-t曲线’); xlabel(‘t’),ylabel(‘f(t)’);

数字信号处理实验及参考程序

数字信号处理实验实验一离散时间信号与系统及MA TLAB实现 1.单位冲激信号: n = -5:5; x = (n==0); subplot(122); stem(n, x); 2.单位阶跃信号: x=zeros(1,11); n0=0; n1=-5; n2=5; n = n1:n2; x(:,n+6) = ((n-n0)>=0); stem(n,x); 3.正弦序列: n = 0:1/3200:1/100; x=3*sin(200*pi*n+1.2); stem(n,x); 4.指数序列 n = 0:1/2:10; x1= 3*(0.7.^n); x2=3*exp((0.7+j*314)*n); subplot(221); stem(n,x1); subplot(222); stem(n,x2); 5.信号延迟 n=0:20; Y1=sin(100*n); Y2=sin(100*(n-3)); subplot(221); stem(n,Y1); subplot(222); stem(n,Y2);

6.信号相加 X1=[2 0.5 0.9 1 0 0 0 0]; X2=[0 0.1 0.2 0.3 0.4 0.5 0.6 0.7]; X=X1+X2; stem(X); 7.信号翻转 X1=[2 0.5 0.9 1]; n=1:4; X2=X1(5-n); subplot(221); stem(n,X1); subplot(222); stem(n,X2); 8.用MATLAB计算序列{-2 0 1 –1 3}和序列{1 2 0 -1}的离散卷积。a=[-2 0 1 -1 3]; b=[1 2 0 -1]; c=conv(a,b); M=length(c)-1; n=0:1:M; stem(n,c); xlabel('n'); ylabel('幅度'); 9.用MA TLAB计算差分方程 当输入序列为时的输出结果。 N=41; a=[0.8 -0.44 0.36 0.22]; b=[1 0.7 -0.45 -0.6]; x=[1 zeros(1,N-1)]; k=0:1:N-1; y=filter(a,b,x); stem(k,y) xlabel('n'); ylabel('幅度') 10.冲激响应impz N=64; a=[0.8 -0.44 0.36 0.22];

数字信号处理习题及答案

==============================绪论============================== 1. A/D 8bit 5V 00000000 0V 00000001 20mV 00000010 40mV 00011101 29mV ==================第一章 时域离散时间信号与系统================== 1. ①写出图示序列的表达式 答:3)1.5δ(n 2)2δ(n 1)δ(n 2δ(n)1)δ(n x(n)-+---+++= ②用δ(n) 表示y (n )={2,7,19,28,29,15} 2. ①求下列周期 ②判断下面的序列是否是周期的; 若是周期的, 确定其周期。 (1)A是常数 8ππn 73Acos x(n)??? ? ??-= (2))8 1 (j e )(π-=n n x 解: (1) 因为ω= 73π, 所以314 π2=ω, 这是有理数, 因此是周期序列, 周期T =14。 (2) 因为ω= 81, 所以ω π2=16π, 这是无理数, 因此是非周期序列。 ③序列)Acos(nw x(n)0?+=是周期序列的条件是是有理数2π/w 0。 3.加法 乘法 序列{2,3,2,1}与序列{2,3,5,2,1}相加为__{4,6,7,3,1}__,相乘为___{4,9,10,2} 。 移位 翻转:①已知x(n)波形,画出x(-n)的波形图。 ② 尺度变换:已知x(n)波形,画出x(2n)及x(n/2)波形图。 卷积和:①h(n)*求x(n),其他0 2 n 0n 3,h(n)其他03n 0n/2设x(n) 例、???≤≤-=???≤≤= ②已知x (n )={1,2,4,3},h (n )={2,3,5}, 求y (n )=x (n )*h (n ) x (m )={1,2,4,3},h (m )={2,3,5},则h (-m )={5,3,2}(Step1:翻转)

数字信号处理第二章上机作业

第二章上机作业 1、ljdt(A,B)函数定义 function ljdt(A,B) p=roots(A); q=roots(B); p=p'; q=q'; x=max(abs([p q 1])); x=x+0.1; y=x; clf hold on axis([-x x -y y]) w=0:pi/300:2*pi; t=exp(i*w); plot(t) axis('square') plot([-x x],[0 0]) plot([0 0],[-y y]) text(0.1,x,'jIm[z]') text(y,1/10,'Re[z]') plot(real(p),imag(p),'x') plot(ral(q),imag(q),'o') title('pole-zero diagram for discrete system') hold off 例2.26 a=[3 -1 0 0 0 1]; b=[1 1]; ljdt(a,b) p=roots(a) q=roots(b) pa=abs(p) 程序运行结果如下: P= 0.7255+0.4633i 0.7255+0.4633i -0.1861+0.7541i -0.1861-0.7541i -0.7455 q=

-1 pa= 0.8608 0.8608 0.7768 0.7768 0.7455 例2.27 b=[0 1 2 1];a=[1 -0.5 -0.005 0.3]; subplot 311 zplane(b,a);xlabel('实部');ylabel('虚部'); num=[0 1 2 1];den=[1 -0.5 -0.005 0.3]; h=impz(num,den); subplot 312

数字信号处理上机实验代码

文件名:tstem.m(实验一、二需要) 程序: f unction tstem(xn,yn) %时域序列绘图函数 %xn:被绘图的信号数据序列,yn:绘图信号的纵坐标名称(字符串)n=0:length(xn)-1; stem(n,xn,'.'); xlabel('n');ylabel('yn'); axis([0,n(end),min(xn),1.2*max(xn)]); 文件名:tplot.m(实验一、四需要) 程序: function tplot(xn,T,yn) %时域序列连续曲线绘图函数 %xn:信号数据序列,yn:绘图信号的纵坐标名称(字符串) %T为采样间隔 n=0;length(xn)-1;t=n*T; plot(t,xn); xlabel('t/s');ylabel(yn); axis([0,t(end),min(xn),1.2*max(xn)]); 文件名:myplot.m(实验一、四需要)

%(1)myplot;计算时域离散系统损耗函数并绘制曲线图。function myplot(B,A) %B为系统函数分子多项式系数向量 %A为系统函数分母多项式系数向量 [H,W]=freqz(B,A,1000) m=abs(H); plot(W/pi,20*log10(m/max(m)));grid on; xlabel('\omega/\pi');ylabel('幅度(dB)') axis([0,1,-80,5]);title('损耗函数曲线'); 文件名:mstem.m(实验一、三需要) 程序: function mstem(Xk) %mstem(Xk)绘制频域采样序列向量Xk的幅频特性图 M=length(Xk); k=0:M-1;wk=2*k/M;%产生M点DFT对应的采样点频率(关于pi归一化值) stem(wk,abs(Xk),'.');box on;%绘制M点DFT的幅频特性图xlabel('w/\pi');ylabel('幅度'); axis([0,2,0,1.2*max(abs(Xk))]); 文件名:mpplot.m(实验一需要)

数字信号处理第二章上机题作业

数字信号处理作业实验题报告 第一章16.(1) 实验目的: 求解差分方程所描述的系统的单位脉冲响应和单位阶跃响应。 实验要求: 运用matlab求出y(n)=0.6y(n-1)-0.08y(n-2)+x(n)的单位脉冲响应和单位阶跃响应的示意图。 源程序: B1=1;A1=[1, -0.6, 0.08]; ys=2; %设差分方程 xn=[1, zeros(1, 20)]; %xn=单位脉冲序列,长度N=31 xi=filtic(B1, A1, ys); hn1=filter(B1, A1, xn, xi); %求系统输出信号hn1 n=0:length(hn1)-1; subplot(2, 1, 1);stem(n, hn1, '.') title('单位脉冲响应'); xlabel('n');ylabel('h(n)') xn=ones(1, 20); sn1=filter(B1, A1, xn, xi); %求系统输出信号sn1 n=0:length(sn1)-1; Subplot(2, 1, 2); stem(n, sn1, '.') title('单位阶跃响应'); xlabel('n'); ylabel('s(n)')

运行结果: 实验分析: 单位脉冲响应逐渐趋于0,阶跃响应保持不变,由此可见,是个稳定系统。

第二章31题 实验目的: 用matlab判断系统是否稳定。 实验要求: 用matlab画出系统的极,零点分布图,输入单位阶跃序列u(n)检查系统是否稳定。 源程序: A=[2, -2.98, 0.17, 2.3418, -1.5147]; B=[0, 0, 1, 5, -50]; subplot(2,1,1); zplane(B,A); %求H(z)的极点 p=roots(A); %求H(z)的模 pm=abs(p); if max(pm)<1 disp('系统因果稳定'), else,disp('系统因果不稳定'),end un=ones(1,800); sn=filter(B, A, un); n=0:length(sn)-1; subplot(2, 1, 2);plot(n, sn) xlabel('n');ylabel('s(n)')

数字信号处理习题及答案

三、计算题 1、已知10),()(<<=a n u a n x n ,求)(n x 的Z 变换及收敛域。 (10分) 解:∑∑∞ =-∞ -∞=-= = )()(n n n n n n z a z n u a z X 1 111 )(-∞=--== ∑ az z a n n ||||a z > 2、设)()(n u a n x n = )1()()(1--=-n u ab n u b n h n n 求 )()()(n h n x n y *=。(10分) 解:[]a z z n x z X -=? =)()(, ||||a z > []b z a z b z a b z z n h z H --=---= ?=)()(, ||||b z > b z z z H z X z Y -= =)()()( , |||| b z > 其z 反变换为 [])()()()()(1n u b z Y n h n x n y n =?=*=- 3、写出图中流图的系统函数。(10分) 解:2 1)(--++=cz bz a z H 2 1124132)(----++= z z z z H 4、利用共轭对称性,可以用一次DFT 运算来计算两个实数序列的DFT ,因而可以减少计算量。设都是N 点实数序列,试用一次DFT 来计算它们各自的DFT : [])()(11k X n x DFT = []) ()(22k X n x DFT =(10分)。 解:先利用这两个序列构成一个复序列,即 )()()(21n jx n x n w +=

即 [][])()()()(21n jx n x DFT k W n w DFT +== []()[]n x jDFT n x DFT 21)(+= )()(21k jX k X += 又[])(Re )(1n w n x = 得 [])(})({Re )(1k W n w DFT k X ep == [] )())(()(2 1*k R k N W k W N N -+= 同样 [])(1 })({Im )(2k W j n w DFT k X op == [] )())(()(21*k R k N W k W j N N --= 所以用DFT 求出)(k W 后,再按以上公式即可求得)(1k X 与)(2k X 。 5、已知滤波器的单位脉冲响应为)(9.0)(5n R n h n =求出系统函数,并画出其直接型 结构。(10分) 解: x(n) 1-z 1-z 1-z 1-z 1 9.0 2 9.0 3 9.0 4 9.0 y(n) 6、略。 7、设模拟滤波器的系统函数为 31 11342)(2+-+=++=s s s s s H a 试利用冲激响应不变法,设计IIR 数字滤波器。(10分) 解 T T e z T e z T z H 31111)(-------=

数字信号处理实验

子程序: function myplot(B,A) %myplot(B,A) %时域离散系统损耗函数绘图 %B为系统函数分子多项式系数向量 %A为系统函数分母多项式系数向量 [H,W]=freqz(B,A,1000); m=abs(H); plot(W/pi,20*log10(m/max(m)));grid on; xlabel('\omega/\pi');ylabel('幅度(dB)') axis([0,1,-80,5]);title('损耗函数曲线'); function tplot(xn,T,yn) %时域序列连续曲线绘图函数 % xn:信号数据序列,yn:绘图信号的纵坐标名称(字符串) % T为采样间隔 n=0:length(xn)-1;t=n*T; plot(t,xn); xlabel('t/s');ylabel(yn); axis([0,t(end),min(xn),1.2*max(xn)]) 程序: %实验4程序exp4.m % IIR数字滤波器设计及软件实现 clear all;close all Fs=10000;T=1/Fs; %采样频率 %调用信号产生函数mstg产生由三路抑制载波调幅信号相加构成的复合信号st st=mstg; %低通滤波器设计与实现========================================= fp=280;fs=450; wp=2*fp/Fs;ws=2*fs/Fs;rp=0.1;rs=60; %DF指标(低通滤波器的通、阻带边界频)[N,wp]=ellipord(wp,ws,rp,rs); %调用ellipord计算椭圆DF阶数N和通带截止频率wp [B,A]=ellip(N,rp,rs,wp); %调用ellip计算椭圆带通DF系统函数系数向量B和A y1t=filter(B,A,st); %滤波器软件实现 % 低通滤波器设计与实现绘图部分 figure(2);subplot(3,1,1); myplot(B,A); %调用绘图函数myplot绘制损耗函数曲线 yt='y_1(t)'; subplot(3,1,2);tplot(y1t,T,yt); %调用绘图函数tplot绘制滤波器输出波形 %带通滤波器设计与实现==================================================== fpl=440;fpu=560;fsl=275;fsu=900; wp=[2*fpl/Fs,2*fpu/Fs];ws=[2*fsl/Fs,2*fsu/Fs];rp=0.1;rs=60;

数字信号处理上机作业

数字信号处理上机作业 学院:电子工程学院 班级:021215 组员:

实验一:信号、系统及系统响应 1、实验目的 (1) 熟悉连续信号经理想采样前后的频谱变化关系,加深对时域采样定理的理解。 (2) 熟悉时域离散系统的时域特性。 (3) 利用卷积方法观察分析系统的时域特性。 (4) 掌握序列傅里叶变换的计算机实现方法,利用序列的傅里叶变换对连续信号、离散信号及系统响应进行频域分析。 2、实验原理与方法 (1) 时域采样。 (2) LTI系统的输入输出关系。 3、实验内容及步骤 (1) 认真复习采样理论、离散信号与系统、线性卷积、序列的傅里叶变换及性质等有关内容,阅读本实验原理与方法。 (2) 编制实验用主程序及相应子程序。 ①信号产生子程序,用于产生实验中要用到的下列信号序列: a. xa(t)=A*e^-at *sin(Ω0t)u(t) b. 单位脉冲序列:xb(n)=δ(n) c. 矩形序列: xc(n)=RN(n), N=10 ②系统单位脉冲响应序列产生子程序。本实验要用到两种FIR系统。 a. ha(n)=R10(n); b. hb(n)=δ(n)+2.5δ(n-1)+2.5δ(n-2)+δ(n-3) ③有限长序列线性卷积子程序 用于完成两个给定长度的序列的卷积。可以直接调用MATLAB语言中的卷积函数conv。 conv 用于两个有限长度序列的卷积,它假定两个序列都从n=0 开始。调用格式如下: y=conv (x, h) 4、实验结果分析 ①分析采样序列的特性。 a. 取采样频率fs=1 kHz,,即T=1 ms。 b. 改变采样频率,fs=300 Hz,观察|X(e^jω)|的变化,并做记录(打印曲线);进一步降低采样频率,fs=200 Hz,观察频谱混叠是否明显存在,说明原因,并记录(打印)这时的|X(e^j ω)|曲线。 程序代码如下: close all;clear all;clc; A=50; a=50*sqrt(2)*pi; m=50*sqrt(2)*pi; fs1=1000; fs2=300; fs3=200; T1=1/fs1; T2=1/fs2; T3=1/fs3; N=100;

相关文档
相关文档 最新文档