# DSPʵ���Solution_lab5

Name: Section:

Laboratory Exercise 5
LINEAR, TIME-INVARIANT DISCRETE-TIME SYSTEMS: FREQUENCY-DOMAIN REPRESENTATIONS
5.1 TRANSFER FUNCTION AND FREQUENCY RESPONSE Transfer Function Analysis

Project 5.1 Answers: Q5.2

The plot of the frequency response of the causal LTI discrete-time system of Question Q5.2 obtained using the modified program is given below:

The type of filter represented by this transfer function is - BF

5.2

TYPES OF TRANSFER FUNCTIONS Filters

Project 5.2

According to Programme P4_1. Answers: Q5.8 The required modifications to Program P4_1 to compute and plot the impulse response of the FIR lowpass filter of Project 4.2 with a length of 20 and a cutoff frequency of ��c = 0.45 are as indicated below: clf; fc = 0.45; n = [-10:1:10]; y = 2*fc*sinc(2*fc*n);k = n+10; stem(k,y);title('N = 20');axis([0 20 -0.2 0.6]); xlabel('Time index n');ylabel('Amplitude');grid; The plot generated by running the modified program is given below:

Q5.20

The plots of the impulse responses of the four FIR filters generated by running Program P4_3 are given below:

From the plots we make the following observations: Filter #1 is of length ____9___ with a __ symmetrical____ impulse response and is therefore a Type _1_ linear-phase FIR filter. Filter #2 is of length ____10__ with a __ antisymmetric____ impulse response and is therefore a Type _2_ linear-phase FIR filter. Filter #3 is of length ___9_____ with a ___ symmetrical ____ impulse response and is therefore a Type _3_ linear-phase FIR filter. Filter #4 is of length __10_____ with a __ antisymmetric___ impulse response and is therefore a Type _4_ linear-phase FIR filter. From the zeros of these filters generated by Program P4_3 we observe that: Filter #1 has zeros at z = 2.3273 + 2.0140i

2.3273 - 2.0140i -1.2659 - 2.0135i -0.2238 - 0.3559i 0.2457 - 0.2126i 2.5270 - 2.0392i

-1.2659 + 2.0135i -0.2238 + 0.3559i 0.2457 + 0.2126i
Filter #2 has zeros at z

= 2.5270 + 2.0392i

-1.0101 + 2.1930i -1.0000

-1.0101 - 2.1930i

-0.1733 + 0.3762i 0.2397 + 0.1934i
Filter #3 has zeros at z

-0.1733 - 0.3762i 0.2397 - 0.1934i 0.2602 + 1.2263i 1.0000 0.6576 - 0.7534i 0.1655 - 0.7803i 2.0841 - 2.0565i

= -1.0000

0.2602 - 1.2263i 0.6576 + 0.7534i 0.1655 + 0.7803i
Filter #4 has zeros at z

= 2.0841 + 2.0565i

-1.5032 + 1.9960i 1.0000 -0.2408 + 0.3197i 0.2431 + 0.2399i

-1.5032 - 1.9960i

-0.2408 - 0.3197i 0.2431 - 0.2399i

Plots of the phase response of each of these filters obtained using MATLAB are shown below:

From these plots we conclude that each of these filters have ____ linear ___ phase.

The group delay of Filter # 1 is - 4 The group delay of Filter # 2 is �C 4.5 The group delay of Filter # 3 is - 4 The group delay of Filter # 4 is �C 4.5

5.3

STABILITY TEST According to Programme P4_4.

Answers: Q5.23 The pole-zero plots of H1(z) and H2(z) obtained using zplane are shown below:

From the above pole-zero plots we observe that Q5.24 Using Program P4_4 we tested the stability of H1(z) and arrive at the following stability test parameters {ki}: -0.9989 0.8500 From these parameters we conclude that H1(z) is _____stable________ . Using Program P4_4 we tested the stability of H2(z) and arrive at the following stability test parameters {ki}: -1.0005 0.8500 From these parameters we conclude that H2(z) is

____unstable_________ .

5.4

spectrograms

Background: A spectrogram of a time signal is a two-dimension representation that displays time in its horizontal axis and frequency in its vertical axis. A gray scale is typically used to indicate the energy at each point. ��white��: low energy, ��black��: high energy.
Tasks: Produce a spectrogram in Matlab and then compare it with specgram.m in Matlab to assure what you did is right. Outline: To produce a spectrogram, you will need to assemble many individual spectral slices produced via the Fourier transform - from successive segments of a speech signal. The

basic operations required are ? loading a speech signal ? selecting individual time segments of the speech signal ? using the FFT to transform from the time domain to the frequency domain ? extracting the log magnitude spectrum ? assembling the sequence of spectra into a 2D time-frequency matrix ? displaying the matrix as an image

You will learn how to write MATLAB scripts and functions to produce spectrograms from signals. You will also use MATLAB's plotting facilities to display signals as a means of checking that your code is doing the right thing. Q 5.25 a. Load the supplied speech signal into MATLAB using the command: [y,fs,nbits] = wavread('oilyrag.wav');
b. Design a programme to divide this speech into several frames, and compare it with the

command ��buffer��.
x=wavread('oilyrag.wav'); %�����Լ��ķ�֡���� w=256; ov=128; y=fenzhen(x,w,ov); %����matlab�ķ�֡���� z=buffer(x,w,ov);

function y=fenzhen(x,w,ov) %===��֡���� if (size(x,1) > size(x,2)) x = x';

end s = length(x); if nargin < 2 w = 256; end if nargin < 3 ov = w/2; end h=w-ov; c=1; ncols=1+fix((s-w)/h); d=zeros(w,ncols); for b=0:h:(s-w) d(:,c)=x((b+1):(b+w))'; c=c+1; end y=d;

c. Design a programme to synthesize the framed speech to a section of speech.
function y=hecheng(x,ov) %==�ϳ����� [framleng framnum] = size(x); if nargin < 2 ov = framleng/2; end h=framleng-ov; sigleng=h*(framnum-1)+framleng; d=zeros(1,sigleng); for i=1:framnum d(((i-1)*h+1):((i-1)*h+framleng))= d(((i-1)*h+1):((i-1)*h+framleng))+x(:,i)';

end y=d; d. Design a programme to represent the spectrogram of a section of speech, and compare it with the command ��specgram��.

[x,sr]=wavread('Tea_10kHz_16bit.wav'); %�����Լ������׳��� y=my_specgram(x,sr,256,128); %����matlab�����׳��� figure��

specgram(x)

function y=my_specgram(x,sr,w,ov) %====���׳��� if (size(x,1) > size(x,2)) x = x'; end s = length(x); if nargin < 2 sr = 1; end if nargin < 3 w = 256; end if nargin < 4 ov = w/2; end h=w-ov; win=hanning(w)'; c=1; ncols=1+fix((s-w)/h); d=zeros(1+w/2,ncols); for b=0:h:(s-w) u=win.*x((b+1):(b+w)); t=fft(u); %???��???? d(:,c)=t(1:(1+w/2))'; c=c+1; end tt=[0:h:(s-w)]/sr; ff=[0:(w/2)]*sr/w; if nargout < 1 axis xy xlabel('Time/s'); ylabel('Frequency/Hz') ; else y = d; imagesc(tt,ff,20*log10(abs(d))); axis xy xlabel('Time/s'); ylabel('Frequency/Hz') end imagesc(tt,ff,20*log10(abs(d)));

Date:

Signature:

�������:
DSPʵ���Solution_lab5(��)_ͼ��.doc
DSPʵ���Solution_lab5(��) - Name : Section
DSPʵ���Solution_lab6.pdf
DSPʵ���Solution_lab6_��Ϣ��ͨ��_���̿Ƽ�_רҵ���ϡ��人��
DSPʵ���Solution_lab4.pdf
DSPʵ���Solution_lab4_��Ϣ��ͨ��_���̿Ƽ�_רҵ���ϡ��人��
DSPʵ���Solution_lab3.pdf
DSPʵ���Solution_lab3_��Ϣ��ͨ��_���̿Ƽ�_רҵ���ϡ��人��
DSPʵ���Solution_lab8.pdf
DSPʵ���Solution_lab8_��Ϣ��ͨ��_���̿Ƽ�_רҵ���ϡ��人��
DSPʵ���Solution_lab1.pdf
DSPʵ���Solution_lab1_��Ϣ��ͨ��_���̿Ƽ�_רҵ���ϡ��人��
DSPʵ���Solution_lab2.pdf
DSPʵ���Solution_lab2_��Ϣ��ͨ��_���̿Ƽ�_רҵ���ϡ��人��
dspʵ��5_ͼ��.doc
��.ʵ�鲽�蹤���ļ�:Lab308-EPWM\lab0307-pwm Ŀ¼�еġ�Example_2833xEPwmUp...DSPʵ��1-5 �������� 3ҳ 1����ȯ DSPʵ���Solution_la... 11ҳ ���...
lab7�ο���_ͼ��.pdf
lab7 Open Shortest Pat... 12ҳ ��� C_lab7-2_�ṹ�� 5ҳ 1����ȯ Lab7 ����OSPF���� 28ҳ 1����ȯ ϲ�����ĵ��Ļ�ϲ�� DSPʵ���Solution_la...
DSPʵ�鱨��ָʾ��.doc
,���ҵ� C:\ DSP281x_examples\ Lab02-UseCMD Ŀ¼, ���ļ����͸�Ϊ��...ʵ�� 5.3 :���ٸ���Ҷ�任(FFT)�㷨�������: 64 �� ����: �˲�: ���: ...
DSPʵ�鱨�� .doc
4 DSP ����Ӧ��ʵ������ ͼ 5 CCS3.3 ƽ̨������ 2���������� (1) ʵ��׼��:��ʵ����ӵ�,���� CCS,�򿪹���,����Ŀ��塣 (2) ͨ���������������źš� ...
DSPʵ�鱨�涨ʱ��2.doc
DSPʵ�����涨ʱ��2_����/��·_���̿Ƽ�_רҵ���ϡ��й�DSP��ʵ��,������
DSPLab4ʵ�鱨��.pdf
DSPLab4ʵ������_��ѧ_�ߵȽ���_����ר���������źŴ���ʵ������ ...0
DSPʵ�鱨��(������)_ͼ��.doc
8 5.ʵ����� ͨ������ʵ��,���˽��� DSP ����ϵͳ����ɺͽṹ,��Ϥ�� DSP ����ϵ ͳ������,��Ϥ�� DSP �Ŀ�������,�˽��� C54x ���õ�Ѱַ��ʽ,�˽��� ...
DSPʵ�鱨��.doc
�򿪹���,�������,����Ŀ¼Ϊ C:\ICETEK\VC5416AES61\VC5416AES61\Lab0502-...DSPʵ������ (5) 4ҳ 2����ȯ DSP�ڶ���ʵ�鱨�� 9ҳ ��� ...
dspʵ�鱨�� 3.doc
dspʵ������ 3_��ѧ_��Ȼ��ѧ_רҵ���ϡ�ʵ���� PWM ʵ��:һ��ʵ��Ŀ���˽� ...����,���ļ� lab24-PWM �¼��� Debug Ŀ¼�µ�.out ��ִ���ļ�; (5) �� ...
dspʵ�鱨��4.doc
2.�򿪹����ļ�: C:\ICETEK\VC5509AES60\VC5509AE\Lab0304-XINT\v60\XINT....DSPʵ������1 14ҳ ��� DSPʵ������8 5ҳ ��� ���ӿƴ�ͨ��ѧԺDSP����....
DSPʵ��.doc
DSP ԭ����Ӧ�� ʵ��������ר��ѧ����:ҵ:��:��:��: 2013 �� 5 �� 13 ...��,ѡ�� D:\2407EDULab\Lab6-IOPin Ŀ¼�е� IOPin.out �ļ�,ͨ����������...
���ϴ�ѧDSPʵ�鱨��..doc
���ϴ�ѧDSPʵ������._ְҵ������ѵ_ְҵ����_����ר���������� DSP оƬϵͳ...C:\ICETEK-F2812-A-EDUlab\DSP281x_examples\Lab0201-Memory\Memory.pjt 5....
DSPʵ�鱨��6.doc
DSP_CCS\\Labs\\09lab\\lab56\\DSP54X-28-T...DSPʵ����ʵ�鱨�� �������� 5ҳ 5����ȯ DSP...���޶Դ�֮��,���ǻ�ɸѡ��������ı������...