




已閱讀5頁(yè),還剩13頁(yè)未讀, 繼續(xù)免費(fèi)閱讀
版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
數(shù)字信號(hào)處理(DSP)實(shí)驗(yàn)報(bào)告 學(xué) 院 電子科學(xué)與工程學(xué)院 姓 名 學(xué) 號(hào) 指導(dǎo)教師 2016年6月2日實(shí)驗(yàn)一M2.1 Write a MATLAB program to the generate the conjugate-symmetric and conjugate-antisymmetric parts of a finite length complex sequence. Using this program verify the results of Example 2.8.Code:x = 0 1+4j -2+3j 4-2j -5-6j -2j 3;cs = 0.5*(x + conj(fliplr(x);ca = 0.5*(x - conj(fliplr(x);M2.2 (a) Using Program 2-2, generate the sequences shown in Figures 2.23 and 2.24. (b)Generate and plot the complex exponential sequence -2.7e(-0.4+j6)n for 0n82 using Program 2-2.Code:% Program 2_2% Generation of complex exponential sequence%a = input(Type in real exponent = );b = input(Type in imaginary exponent = );c = a + b*i;K = input(Type in the gain constant = );N = input (Type in length of sequence = );n = 1:N;x = K*exp(c*n);%Generate the sequencestem(n,real(x);%Plot the real partxlabel(Time index n);ylabel(Amplitude);title(Real part);disp(PRESS RETURN for imaginary part);pausestem(n,imag(x);%Plot the imaginary partxlabel(Time index n);ylabel(Amplitude);title(Imaginary part);Figure 2.23Figure 2.24Figure 2.2bM2.4 (a) Write a MATLAB program to generate a sinusoidal sequence xn=Asin(w0n+f), and plot the sequence using the stem function. The input data specified by the user the desired length L, amplitude A, the angular frequency w0, and the phase f where 0w0 and 0 2. Using this program, generate the sinusoidal sequences shown in Figure 2.22. (b) Generate sinusoidal sequences with the angular frequencies given in Problem 2.40. Determine the period of each sequence from the plot, and verify the result theoretically.Code:L = input(Desired length = );A = input(Amplitude = );omega = input(Angular frequency = );phi = input(Phase = );n = 0:L-1;x = A*cos(omega*n + phi);stem(n,x);xlabel(Time Index); ylabel(Amplitude);title(omega_o = ,num2str(omega/pi),pi);Figure 2.22M2.6 Write a MATLAB program to plot a continuous-time sinusoidal signal and its sampled version, and verify Figure 2.28. You need to the hold function to keep both plots.Code:t = 0:0.001:1;fo = input(Frequency of sinusoid in Hz = );FT = input(Sampling frequency in Hz = );g1 = cos(2*pi*fo*t);plot(t,g1,:);xlabel(time); ylabel(Amplitude); holdn = 0:1:FT;gs = cos(2*pi*fo*n/FT);plot(n/FT,gs,o); hold offM3.2 Using Program 3-1, determine and plot the real and imaginary parts and the magnitude and phase spectra of the DTFTs of the sequence of Problem 3.18 for N=10.,Code:% Program 3_1% Discrete-Time Fourier Transform Computation% Read in the desired number of frequency samplesk = input(Number of frequency points = );% Read in the numerator and denominator coefficientsnum = input(Numerator coefficients = );den = input(Denominator coefficients = );% Compute the frequency responsew = 0:pi/(k-1):pi;h = freqz(num, den, w);%h = h.*exp(1i*w*10);% Plot the frequency response%h=sin(21*w/2)./sin(w/2);%h=exp(-1i*w*5).*sin(w*11/2)./sin(w/2);subplot(2,2,1)plot(w/pi,real(h);gridtitle(Real part)xlabel(omega/pi); ylabel(Amplitude)subplot(2,2,2)plot(w/pi,imag(h);gridtitle(Imaginary part)xlabel(omega/pi); ylabel(Amplitude)subplot(2,2,3)plot(w/pi,abs(h);gridtitle(Magnitude Spectrum)xlabel(omega/pi); ylabel(Magnitude)subplot(2,2,4)plot(w/pi,angle(h);gridtitle(Phase Spectrum)xlabel(omega/pi); ylabel(Phase, radians)M3.3 Using Program 3-1, determine and plot the real and imaginary parts and the magnitude and phase spectra of the following DTFTs:(a)X(ej)=0.1323(1+0.1444e-j-0.4519e-j2+0.1444e-j3+e-j4)1+0.1386e-j+0.8258e-j2+0.1393e-j3+0.4153e-j4 ,(b) X(ej)=0.3192(1+0.1885e-j-0.1885e-j2-e-j3)1+0.7856e-j+1.4654e-j2-0.2346e-j3 .Code: % Program 3_1% Discrete-Time Fourier Transform Computation% Read in the desired number of frequency samplesk = input(Number of frequency points = );% Read in the numerator and denominator coefficientsnum = input(Numerator coefficients = );den = input(Denominator coefficients = );% Compute the frequency responsew = 0:pi/(k-1):pi;h = freqz(num, den, w);%h = h.*exp(1i*w*10);% Plot the frequency response%h=sin(21*w/2)./sin(w/2);%h=exp(-1i*w*5).*sin(w*11/2)./sin(w/2);subplot(2,2,1)plot(w/pi,real(h);gridtitle(Real part)xlabel(omega/pi); ylabel(Amplitude)subplot(2,2,2)plot(w/pi,imag(h);gridtitle(Imaginary part)xlabel(omega/pi); ylabel(Amplitude)subplot(2,2,3)plot(w/pi,abs(h);gridtitle(Magnitude Spectrum)xlabel(omega/pi); ylabel(Magnitude)subplot(2,2,4)plot(w/pi,angle(h);gridtitle(Phase Spectrum)xlabel(omega/pi); ylabel(Phase, radians)Figure aFigure bM3.4 Using MATLAB, verify the symmetry relations of the DTFT of a real sequence as listed in Table 3.1.Code:N = 8; % Number of samples in sequencegamma = 0.5; k = 0:N-1;x = 0.5.k;w = -3*pi:pi/1024:3*pi;X = freqz(x,1,w);subplot(2,2,1)plot(w/pi,real(X);gridtitle(Real part)xlabel(omega/pi); ylabel(Amplitude)subplot(2,2,2)plot(w/pi,imag(X);gridtitle(Imaginary part)xlabel(omega/pi); ylabel(Amplitude)subplot(2,2,3)plot(w/pi,abs(X);gridtitle(Magnitude Spectrum)xlabel(omega/pi); ylabel(Magnitude)subplot(2,2,4)plot(w/pi,angle(X);gridtitle(Phase Spectrum)xlabel(omega/pi); ylabel(Phase, radians)M4.1 Using Program 4-1(new), investigate the effect of signal smoothing by a moving-average filter of length 5, 7 and 9. Does the signal smoothing improve with an increase in the length? What is the effect of the length on the delay between the smoothing output and the noisy input?Code:% Program 4_1% Signal Smoothing by a Moving-Average FilterR = 50;d = rand(R,1)-0.5;m = 0:1:R-1;s = 2*m.*(0.9.m);x = s + d;plot(m,d,r-,m,s,b-,m,x,g:)xlabel(Time index n); ylabel(Amplitude)legend(dn,sn,xn);pauseM = input(Number of input samples = );b = ones(M,1)/M;y = filter(b,1,x);plot(m,s,r-,m,y,b-)legend(sn,yn);xlabel (Time index n);ylabel(Amplitude)實(shí)驗(yàn)二M5.1 Using MATLAB, compute the N-point DFTs the length-N sequences of Problem 3.18 for N=4,6,8 and 10. Compare your result with that obtained by evaluating the DTFTs computed in Problem 3.18 at =2kN,k=0,1.,N-1.Code:N = input(The value of N = );k = -N:N;y = ones(1,2*N+1);w = 0:2*pi/255:2*pi;Y = freqz(y, 1, w);Ydft = fft(y);n = 0:1:2*N;plot(w/pi,abs(Y),n*2/(2*N+1),abs(Ydft),o);xlabel(omega/pi),ylabel(Amplitude);N=4N=8N=10N=6M6.1 Using Program 6-1, determine the factored form of the following z-transforms:(a)G1=3z4-2.4z3+15.36z2+3.84z+95z4-8.5z3+17.6z2+4.7z-6 ,(b)G2=2z4+0.2z3+6.4z2+4.6z+2.45z4+z3+6.6z2+0.42z+24 .Code:% Program 6_1% Determination of the Factored Form% of a Rational z-Transform%num = input(Type in the numerator coefficients = );den = input(Type in the denominator coefficients = );K = num(1)/den(1);Numfactors = factorize(num);Denfactors = factorize(den);disp(Numerator factors);disp(Numfactors);disp(Denominator factors);disp(Denfactors);disp(Gain constant);disp(K);zplane(num,den);Figure aFigure bM8.1 Using MATLAB, develop a cascade realization of each of the following linear-phase FIR transfer function:(a)H1(z)=-0.3+0.16z-1+0.1z-2+1.2z-3+0.1z-4+0.16z-5-0.3z-6 ,(b) H2(z)=2-3.8z-1+1.5z-2-4.2z-3+1.5z-4-3.8z-5+2z-6 ,(c) H3(z)=-0.3+0.16z-1+0.1z-2-0.1z-4+0.16z-5-0.3z-6 ,(d) H4(z)=-2+3.8z-1-0.15z-2+0.15z-4-3.8z-5+2z-6 ,Code: num = input(Type in the numerator coefficients = );Numfactors = factorize(num);disp(Numerator factors);disp(Numfactors);Figure aFigure bFigure cFigure dM8.2 Consider the fourth-oder IIR transfer functionG(z)=0.1103-0.4413z-1+0.6619z-2-0.4413z-3+0.1103z-41-0.1510z-1+0.8042z-2+0.1618z-3+0.1872z-4 .(a)Using MATLAB, express G(z) in factored form.(b)Develop two different cascade realizations of G(z).(c)Develop two different parallel form realization of G(z).Realize each second-order section in direct from II.Code:% Program 8_2% Factorization of a Rational IIR Transfer Function%format shortnum = input(Numerator coefficients = );den = input(Denominator coefficients = );Numfactors = factorize(num);Denfactors = factorize(den);K = num(1)/den(1);disp(Numerator Factors),disp(Numfactors)disp(Denominator Factors),disp(Denfactors)disp(Gain constant);disp(K);Figure a實(shí)驗(yàn)三M9.1 Design a digital Butterworth lowpass filter operating at a sampling rate of 100kHz with a 0.3dB cutoff frequency at 15kHz and a minimum stopband attenuation of 45 dB at 25 kHz using the bilinear transformation method. Determine the order of the analog filter prototype using the formula given in Eq.(A.9), and then design the analog prototype filter using the M-file buttap of MATLAB. Transform the analog filter transform function to the desired digital transfer function using the M-file bilinear. Plot the gain and phase response using MATLAB. Show all step used in the design.Code:wp=2*1/4;ws=2*15/40;n1,wn1=buttord(wp,ws,3,35);B,A=butter(n1,wn1);h1,w=freqz(B,A);f=w/pi*20000;plot(f,20*log10(abs(h1),r);axis(0,20000,-80,10);grid;xlabel(Frequency/Hz);ylabel(Magnitude/dB);實(shí)驗(yàn)四M10.1 Plot the magnitude response of a linear-phase FIR highpass filter by truncating the impulse response hHPn of the ideal highpass filter of Eq.(10.17) to length N=2M+1 for two different values of M, and show that the truncated filter exhibits oscillatory behavior on both sides of the cutoff frequency.Code:M=800;n= -M:M;hn= -sin(0.4*pi*n)./(pi*n);%hn= -0.4*sinc(0.4*n);hn(M+1)=0.6;H,w = freqz(hn,1);plot(n,hn)figure,plot(
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 高墩施工防墜器速差技術(shù)專題
- 生態(tài)混凝土橋坡綠化工藝
- 2024年“巴渝工匠”杯競(jìng)賽負(fù)荷控制理論考試題庫(kù)大全-上(單選題)
- 高三年級(jí)下冊(cè)二??荚囌Z(yǔ)文試題(含答案)
- 防汛安全培訓(xùn)
- 中班走廊與樓梯健康安全
- 學(xué)校中層領(lǐng)導(dǎo)工作總結(jié)
- 實(shí)驗(yàn)小學(xué)教學(xué)常規(guī)培訓(xùn)
- 招聘面試培訓(xùn)
- 正畸口腔潰瘍護(hù)理常規(guī)
- 新高考數(shù)學(xué)題型全歸納之排列組合專題18環(huán)排問題含答案及解析
- 清算開始日清產(chǎn)核資報(bào)告
- 進(jìn)修匯報(bào)高壓氧艙治療
- 小區(qū)停車場(chǎng)管理方案
- 學(xué)校教學(xué)設(shè)備設(shè)施安全管理制度(3篇)
- 森林消防專業(yè)實(shí)習(xí)總結(jié)范文
- DB32T 2677-2014 公路涉路工程安全影響評(píng)價(jià)報(bào)告編制標(biāo)準(zhǔn)
- 軟件正版化培訓(xùn)
- 《電力電子技術(shù)(第二版) 》 課件 項(xiàng)目五 交流調(diào)壓電路-調(diào)試電風(fēng)扇無級(jí)調(diào)速器
- 無人駕駛汽車路測(cè)與數(shù)據(jù)收集服務(wù)合同
- 【碳足跡報(bào)告】新鄉(xiāng)市錦源化工對(duì)位脂產(chǎn)品碳足跡報(bào)告
評(píng)論
0/150
提交評(píng)論