1. Trang chủ
  2. » Kỹ Thuật - Công Nghệ

Xử lý tín hiệu số bai5A

11 162 2

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Nội dung

Laboratory Exercise DIGITAL PROCESSING OF CONTINUOUS-TIME SIGNALS 5.1 THE SAMPLING PROCESS IN THE TIME-DOMAIN Project 5.1 Sampling of a Sinusoidal Signal A copy of Program P5_1 is given below: % Program P5_1 % Illustration of the Sampling Process % in the Time-Domain clf; t = 0:0.0005:1; f = 13; xa = cos(2*pi*f*t); subplot(2,1,1) plot(t,xa);grid xlabel('Time, msec');ylabel('Amplitude'); title('Continuous-time signal x_{a}(t)'); axis([0 -1.2 1.2]) subplot(2,1,2); T = 0.1; n = 0:T:1; xs = cos(2*pi*f*n); k = 0:length(n)-1; stem(k,xs);grid; xlabel('Time index n');ylabel('Amplitude'); title('Discrete-time signal x[n]'); axis([0 (length(n)-1) -1.2 1.2]) Answers: Q5.1 The plots of the continuous-time signal and its sampled version generated by running Program P5_1 are shown below: Continuous-time signal x (t) a Amplitude 0.5 -0.5 -1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Time, msec Discrete-time signal x[n] 0.8 0.9 10 Amplitude 0.5 -0.5 -1 Q5.2 Time index n The frequency of the sinusoidal signal in Hz is – 13Hz The sampling period in seconds is – 0.0005s Q5.3 The effects of the two axis commands are – axis([0 -1.2 1.2])- giới hạng khung hiển thị phần đồ thị x(0 1) Y(-1.2 1.2) axis([0 (length(n)-1) -1.2 1.2]) ])- giới hạng khung hiển thị đồ thị x(0 {chiều dài n -1 = 10}), y(-1.2 1.2) Q5.4 The plots of the continuous-time signal and its sampled version generated by running Program P5_1 for the following four values of the sampling period are shown below: T = 0.2 T = 0.4 Continuous-time signal x a(t) 0.5 Continuous-time signal x (t) a -0.5 Amplitude Amplitude -1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Time, msec Discrete-time signal x[n] 0.8 0.9 -0.5 -1 0.1 0.2 0.3 0.2 0.4 0.6 0.5 0.4 0.5 0.6 0.7 Time, msec Discrete-time signal x[n] 0.8 0.9 1.6 1.8 -0.5 Amplitude Amplitude 0.5 -1 0.5 1.5 2.5 Time index n 3.5 4.5 0.5 -0.5 -1 T = 0.01 0.8 1.2 Time index n 1.4 T = 0.001 Continuous-time signal x (t) a 0.5 Continuous-time signal x (t) a -0.5 Amplitude Amplitude -1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Time, msec Discrete-time signal x[n] 0.8 0.9 0.5 -0.5 -1 0.1 0.2 0.3 100 200 300 0.5 0.4 0.5 0.6 0.7 Time, msec Discrete-time signal x[n] 0.8 0.9 800 900 1000 -0.5 Amplitude Amplitude -1 10 20 30 40 50 60 Time index n 70 80 90 100 0.5 -0.5 -1 400 500 600 Time index n 700 Based on these results we make the following observations – Chu kỳ nhỏ số mẫu lớn, Chu kỳ nhỏ tín hiệu thu giống với tín hiệu hình sin đồ thị phía Continuous-time signal x (t) a The plots of the continuous-time sinusoidal signal of frequency Hz and its sampled version generated by running a modified Program P5_1 are shown below: Amplitude Q5.5 0.5 -0.5 -1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Time, msec Discrete-time signal x[n] 0.8 0.9 10 Amplitude 0.5 -0.5 -1 The plots of the continuous-time sinusoidal signal of frequency Hz and its sampled version generated by running a modified Program P5_1 are shown below: Time index n Continuous-time signal x (t) a Amplitude 0.5 -0.5 -1 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Time, msec Discrete-time signal x[n] 0.8 0.9 10 Amplitude 0.5 -0.5 -1 Time index n Based on these results we make the following observations – Tần số tin hiệu hình sin lớn số mẫu sinh nhiều tín hiệu liên tục hình sin sinh sai khác với tín hiệu khơng liên tục đồ thị phí Project 5.2 Aliasing Effect in the Time-Domain A copy of Program P5_2 is given below: % Program P5_2 % Illustration of Aliasing Effect in the Time-Domain % Program adapted from [Kra94] with permission from % The Mathworks, Inc., Natick, MA clf; T = 0.1;f = 13; n = (0:T:1)'; xs = cos(2*pi*f*n); t = linspace(-0.5,1.5,500)'; ya = sinc((1/T)*t(:,ones(size(n))) - (1/T)*n(:,ones(size(t)))')*xs; plot(n,xs,'o',t,ya);grid; xlabel('Time, msec');ylabel('Amplitude'); title('Reconstructed continuous-time signal y_{a}(t)'); axis([0 -1.2 1.2]); Reconstructed continuous-time signal y (t) a Answers: 0.8 0.6 The plots of the discrete-time signal and its continuous-time equivalent obtained by running Program P5_2 are shown below: 0.4 0.2 Amplitude Q5.6 -0.2 -0.4 -0.6 -0.8 -1 Q5.7 0.1 0.2 0.3 0.4 0.5 0.6 Time, msec 0.7 0.8 0.9 The range of t in the Program is – (-0.5 ; 1.5) Reconstructed continuous-time signal y (t) a The value of the time increment is - 0.1 0.8 The range of t in the plot is – (0 ;1) 0.6 0.4 0.2 Amplitude The plot generated by running Program P5_2 again with the range of t changed so as to display the full range of y a(t) is shown below: -0.2 -0.4 -0.6 -0.8 -1 -0.5 Based on these results we make the following observations - 0.5 Time, msec 1.5 Reconstructed continuous-time signal y (t) a 0.8 The plots of the discrete-time signal and its continuous-time equivalent obtained by running Program P5_2 with the original display range Amplitude Q5.8 0.6 0.4 0.2 -0.2 -0.4 -0.6 -0.8 -1 0.1 0.2 0.3 0.4 0.5 0.6 Time, msec 0.7 0.8 0.9 restored and with the frequency of the sinusoidal signal changed to Hz are shown below: Reconstructed continuous-time signal y a(t) Amplitude The plots of the discrete-time signal and its continuous-time equivalent obtained by running Program P5_2 with the original display range restored and with the frequency of the sinusoidal signal changed to Hz are shown below: 0.8 0.6 0.4 0.2 -0.2 -0.4 -0.6 Based on these results we make the following observations – Khi thay đổi tần số ta thấy thấy tín hiệu thu không thay đổi -0.8 -1 0.1 0.2 0.3 0.4 0.5 0.6 Time, msec 0.7 0.8 0.9 These results can be explained as follows – Tín hiệu thu không bị ảnh hưởng thành phần tần số 5.2 EFFECT OF SAMPLING IN THE FREQUENCY-DOMAIN Project 5.3 Aliasing Effect in the Frequency-Domain A copy of Program P5_3 is given below: % Program P5_3 axis([0 5/pi 2]); % Illustration of the Aliasing Effect subplot(2,2,3) % in the Frequency-Domain T = 1; clf; n = 0:T:10; t = 0:0.005:10; xs = 2*n.*exp(-n); xa = 2*t.*exp(-t); k = 0:length(n)-1; subplot(2,2,1) stem(k,xs);grid; plot(t,xa);grid xlabel('Time index xlabel('Time, n');ylabel('Amplitude'); msec');ylabel('Amplitude'); title('Discrete-time signal x[n]'); title('Continuous-time signal x_{a}(t)'); subplot(2,2,4) subplot(2,2,2) wd = 0:pi/255:pi; wa = 0:10/511:10; hd = freqz(xs,1,wd); = freqs(2,[1 1],wa); plot(wd/(T*pi), T*abs(hd));grid; plot(wa/(2*pi),abs(ha));grid; xlabel('Frequency, xlabel('Frequency, kHz');ylabel('Amplitude'); kHz');ylabel('Amplitude'); title('|X(e^{j\omega})|'); title('|X_{a}(j\Omega)|'); axis([0 1/T 2]) Answers: Q5.9 The continuous-time function x a(t) in Program P5_3 is – The CTFT of xa(t) is being computed by - Q5.10 The plots generated by running Program P5_3 are shown below: |Xa(jΩ )| 0.6 1.5 Amplitude Amplitude Continuous-time signal x a(t) 0.8 0.4 0.2 0 Time, msec 0.5 10 0.6 1.5 Amplitude Amplitude Discrete-time signal x[n] 0.4 0.2 Q5.11 Time index n 0.5 10 0.6 1.5 Amplitude Amplitude 0.4 0.2 Time, msec 0.5 10 0.6 1.5 Amplitude Amplitude Discrete-time signal x[n] 0.4 0.2 Time index n 0.5 Frequency, kHz 1.5 Based on these results we make the following observations – Khi tăng chu kỳ lấy mẫu số mẫu tín hiệu rời rạc theo thời gian ít, dẩn dến sai số miền tần số lớn |X(ejω)| 0.8 0.5 Frequency, kHz |Xa(jΩ )| Continuous-time signal x a(t) 0 The plots generated by running Program P5_3 with sampling period increased to 1.5 are shown below: 0.8 1.5 |X(ejω )| 0.8 0.5 Frequency, kHz Based on these results we make the following observations - Ta thấy tín hiệu rời rạc liên tục tương đối giống miền thời gian, nhiên miền tần số sai số lớn 0.5 0 0.2 0.4 Frequency, kHz 0.6 The modified Program P5_3 for the case of xa(t)= e–πt is given below: % Program P5_3 clf; % Illustration of the Aliasing Effect t = 0:0.005:10; % in the Frequency-Domain xa =1.*exp(-1*pi*(t.*t)); Q5.12 subplot(2,2,1) plot(t,xa);grid xlabel('Time, msec');ylabel('Amplitude'); title('Continuous-time signal x_{a}(t)'); subplot(2,2,2) wa = 0:10/511:10; = freqs(2,[1 1],wa); plot(wa/(2*pi),abs(ha));grid; xlabel('Frequency, kHz');ylabel('Amplitude'); title('|X_{a}(j\Omega)|'); axis([0 5/pi 2]); subplot(2,2,3) T = 1; n = 0:T:10; xs = 2*n.*exp(-n); k = 0:length(n)-1; stem(k,xs);grid; xlabel('Time index n');ylabel('Amplitude'); title('Discrete-time signal x[n]'); subplot(2,2,4) wd = 0:pi/255:pi; hd = freqz(xs,1,wd); plot(wd/(T*pi), T*abs(hd));grid; xlabel('Frequency, kHz');ylabel('Amplitude'); title('|X(e^{j\omega})|'); axis([0 1/T 2]) The plots generated by running the modified Program P5_3 are shown below: Based on these results we make the following observations – Ta thấy tín hiệu rời rạc liên tục tương đối giống miền thời gian, nhiên miền tần số sai số lớn The plots generated by running the modified Program P5_3 with sampling period increased to 1.5 are shown below: Based on these results we make the following observations – Tần số lớn số mẫu tín hiệu khơng liên tục dẩn đến sai số so với tín hiệu liên tục lớn 5.3 DESIGN OF ANALOG LOWPASS FILTERS Project 5.4 Design of Analog Lowpass Filters A copy of Program P5_4 is given below: % Program P5_4 % Design of Analog Lowpass Filter clf; Fp = 3500;Fs = 4500; Wp = 2*pi*Fp; Ws = 2*pi*Fs; [N, Wn] = buttord(Wp, Ws, 0.5, 30,'s'); [b,a] = butter(N, Wn, 's'); wa = 0:(3*Ws)/511:3*Ws; h = freqs(b,a,wa); plot(wa/(2*pi), 20*log10(abs(h)));grid xlabel('Frequency, Hz');ylabel('Gain, dB'); title('Gain response'); axis([0 3*Fs -60 5]); Answers: Q5.13 The passband ripple Rp in dB is – 0.5 The minimum stopband attenuation R s in dB is - 30 The passband edge frequency in Hz is – 3500 x The stopband edge frequency in Hz is - 4500 x Q5.14 The gain response obtained by running Program P5_4 is shown below: Gain response -10 Gain, dB -20 -30 -40 -50 -60 2000 4000 6000 8000 Frequency, Hz 10000 12000 Based on this plot we conclude that the filter designed _Thông thấp the given specifications The filter order N is - 18 The 3-dB cutoff frequency in Hz of the filter is – 3714Hz Q5.15 The required modifications to Program P5_4 to design a Type Chebyshev lowpass filter meeting the same specifications are given below: % Program P5_4 % Design of Analog Lowpass Filter clf; Fp = 3500;Fs = 4500; Wp = 2*pi*Fp; Ws = 2*pi*Fs; [N, Wn] = cheb1ord(Wp, Ws, 0.5, 30,'s'); [b,a] = cheby1(N,0.5,Wn, 's'); wa = 0:(3*Ws)/511:3*Ws; h = freqs(b,a,wa); plot(wa/(2*pi), 20*log10(abs(h)));grid xlabel('Frequency, Hz');ylabel('Gain, dB'); title('Gain response'); axis([0 3*Fs -60 5]); The gain response obtained by running the modified Program P5_4 is shown below: Gain response -10 Gain, dB -20 -30 -40 -50 -60 2000 4000 6000 8000 Frequency, Hz 10000 12000 Based on this plot we conclude that the filter designed _Thông dãi chebyshev loại the given specifications The filter order N is The passband edge frequency in Hz of the filter is 3500*2* Q5.16 The required modifications to Program P5_4 to design a Type Chebyshev lowpass filter meeting the same specifications are given below: % Program P5_4 % Design of Analog Lowpass Filter clf; Fp = 3500;Fs = 4500; Wp = 2*pi*Fp; Ws = 2*pi*Fs; [N, Wn] = cheb2ord(Wp, Ws, 0.5, 30,'s'); [b,a] = cheby2(N,30,Wn, 's'); wa = 0:(3*Ws)/511:3*Ws; h = freqs(b,a,wa); plot(wa/(2*pi), 20*log10(abs(h)));grid xlabel('Frequency, Hz');ylabel('Gain, dB'); title('Gain response'); axis([0 3*Fs -60 5]); The gain response obtained by running the modified Program P5_4 is shown below: Gain response -10 Gain, dB -20 -30 -40 -50 -60 2000 4000 6000 8000 Frequency, Hz 10000 12000 10 Based on this plot we conclude that the filter designed bọ lọc Chebyshev loại II _ the given specifications The filter order N is The stopband edge frequency in Hz of the filter is - 3500 Q5.17 The required modifications to Program P5_4 to design an elliptic lowpass filter meeting the same specifications are given below: % Program P5_4 % Design of Analog Lowpass Filter clf; Fp = 3500;Fs = 4500; Wp = 2*pi*Fp; Ws = 2*pi*Fs; [N, Wn] = ellipord(Wp, Ws, 0.5, 30,'s'); [b,a] = ellip(N,0.5,30,Wn, 's'); wa = 0:(3*Ws)/511:3*Ws; h = freqs(b,a,wa); plot(wa/(2*pi), 20*log10(abs(h)));grid xlabel('Frequency, Hz');ylabel('Gain, dB'); title('Gain response'); axis([0 3*Fs -60 5]); The gain response obtained by running the modified Program P5_4 is shown below: Gain response -10 Gain, dB -20 -30 -40 -50 -60 2000 4000 6000 8000 Frequency, Hz 10000 12000 Based on this plot we conclude that the filter designed lọc elliptic the given specifications The filter order N is The passband edge frequency in Hz of the filter is 3500 11 ... results we make the following observations – Tần số tin hiệu hình sin lớn số mẫu sinh nhiều tín hiệu liên tục hình sin sinh sai khác với tín hiệu khơng liên tục đồ thị phí Project 5.2 Aliasing... Based on these results we make the following observations – Tần số lớn số mẫu tín hiệu khơng liên tục dẩn đến sai số so với tín hiệu liên tục lớn 5.3 DESIGN OF ANALOG LOWPASS FILTERS Project 5.4... số ta thấy thấy tín hiệu thu khơng thay đổi -0.8 -1 0.1 0.2 0.3 0.4 0.5 0.6 Time, msec 0.7 0.8 0.9 These results can be explained as follows – Tín hiệu thu khơng bị ảnh hưởng thành phần tần số

Ngày đăng: 25/12/2017, 08:22

TỪ KHÓA LIÊN QUAN

w