Báo Cáo Tín Hiệu Và Hệ Thống

29 7 0
Báo Cáo Tín Hiệu Và Hệ Thống

Đ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

BÁO CÁO THÍ NGHIỆM TÍN HIỆU VÀ HỆ THỐNG Lab 1 : Introduction to Matlab Lab 2 : Some Fundamental Propertiles of Signals Lab 3 : Some Fundamental Properties of Systems Lab 4 : The Convolution Sum and Integral LAB 5 : Differental Equations LAB 6 : Fourier Series and Fourier Transform Representation

ĐẠI HỌC BÁCH KHOA – ĐẠI HỌC ĐÀ NẴNG KHOA ĐIỆN TỬ - VIỄN THÔNG  - -                      BÁO CÁO THÍ NGHIỆM TÍN HIỆU VÀ HỆ THỐNG     NHÓM 20.39 Giảng viên hướng dẫn: ThS Trần Văn Líc Sinh viên thực hiê ̣n : Lớp sinh hoa ̣t : Mã số sinh viên Đà Nẵng, năm 2022 MỤC LỤC Lab : Introduction to Matlab Practice myself Lab : Some Fundamental Propertiles of Signals Consider the discrete-time signal 2) Now consider the following signals .4 3) a) Define a MATLAB vector nx to be the time indices - ≤ n ≤ and the MATLAB vector x to be the values of the signal x[n] is given by b) For this part, you will define MATLAB vectors y1 through y4 to represent the following discrete-time signals Lab : Some Fundamental Properties of Systems Linearity Exercise Causality Exercise Stability 10 Invertible and Inverse 11 Exercise .11 Lab : The Convolution Sum and Integral .13 Exercise .13 Exercise .14 II Repeat part I using u[n+5] instead of u[n] 14 Exercise .15 LAB : Differental Equations 17 LTI Systems Described by Differential Equations .17 Exercise .17 Exercise .18 Exercise .19 LAB : Fourier Series and Fourier Transform Representation .21 6.1 Compute the DTFS with fft: 21 Exercise .21 LAB : INTRODUCTION TO MATLAB Practice myself LAB : SOME FUNDAMENTAL PROPERTIES OF SIGNALS 1.Consider the discrete-time signal and assume N=12 For M=4, 5, and 10, plot xM [n] on the interval ≤ n ≤ 2N -1 Use stem to create your plots, and be sure to appropriately label your axes What is the fundamental period of each signal? Trả Lời: %Nguyen Van Vinh Hoa code %Eg1 N=12; n=[0:2*N-1]; M=4 x_M=sin((2*pi*M*n)/N); figure(1) stem(n,x_M,'filled') title('x[n]=sin(2*pi*M*n/N)') xlabel('Time') ylabel('Amplitude') Thay M= 5,7,10 ta kết sau: M=4 M=5 M=7 M=10 2) Now consider the following signals: Assume N=6 for each signal Determine whether or not each signal periodic If a signal is periodic, plot the signal for two periods, starting at n=0 Plot the signal for ≤ n ≤7N and explain why it is periodic or not Remember to use stem and to appropriately label your axes Trả lời: %Nguyen Van Vinh Hoa code %Eg2 N=6; n=[0:7*N]; x2=2*cos(2*n/N)+cos(3*n/N); x3=cos(2*pi*n/N)+3*sin(5*(pi/2)*n/N); figure (5) subplot(2,1,1),stem(n,x2) title('x2[n]') subplot(2,1,2),stem(n,x3) title('x3[n]') Kết : 3) a) Define a MATLAB vector nx to be the time indices - ≤ n ≤ and the MATLAB vector x to be the values of the signal x[n] is given by If you have defined these vectors correctly, you should be able to plot this discrete time sequence by typing stem (nx,x) Trả lời: %Nguyen Van Vinh Hoa code nx=[-3:7]; x=[0 0 -1 0 0]; figure (8) stem(nx,x,'filled') title('x[n]') xlabel('n') ylabel('x[n]') Kết : b) For this part, you will define MATLAB vectors y1 through y4 to represent the following discrete-time signals: to this, you should define y1 through y4 to be equal to x The key is to define correctly the corresponding index vectors ny1 through ny4 First, you should figure out how the index of a given sample of x[n] changes when transforming to yi[ ] n The index vectors need not span the same of indices as nx, but they should all be at least 11samples long and include the indices of all nonzero samples of associated signal Trả lời: %Nguyen Van Vinh Hoa code %Eg3 n=[-3:7]; x=[2 -1 0]; nx=[0 0 x 0]; ny1=n+2; ny2=n-1; ny3=-n; ny4=-n+1; figure(6) subplot(2,1,1),stem(ny1,nx,'filled') xlabel('time') ylabel('x[n-2]') title('x[n-2]') subplot(2,1,2),stem(ny2,nx,'filled') xlabel('time') ylabel('x[n+1]') title('x[n+1]') figure(7) subplot(2,1,1),stem(ny3,nx,'filled') xlabel('time') ylabel('x[-n]') title('x[-n]') subplot(2,1,2),stem(ny4,nx,'filled') xlabel('time') ylabel('x[-n+1]') title('x[-n+1]') Kết : LAB : SOME FUNDAMENTAL PROPERTIES OF SYSTEMS Linearity: Exercise The system is not linear Show that it violates linearity by giving a counter example Agood example is the set of signals Write a MATLAB code to demonstrate this example This can be done as follows: - Define the domain of the two signals to be from -3 to and save it as a vector n - Define the signal x1 as a vector of the values [0 0 0 0] - Define the signal x2 =2x1 - Evaluate the output corresponding to the x1 input, and label it as y1 - Evaluate the output corresponding to the x2 input, and label it as y2 On the same graph window, plot the signals x1, x2, y1 and y2 using the commands (subplot) and (stem) Your results should be as depicted in Figure Trả lời : %Nguyen Van Vinh Hoa code %LAB3 %Exercise n=[-3:3]; x1 = [0 0 0 0]; x2 = 2*x1; y1=sin(pi/2*x1); y2=sin(pi/2*x2); figure (1) xlabel ('n') subplot(4,1,1),stem (n, x1, title ('x1[n]') xlabel ('n') subplot(4,1,2),stem (n, y1, title ('y[n]') xlabel ('n') subplot(4,1,3),stem (n, x2, title ('x2[n]') xlabel ('n') subplot(4,1,4),stem (n, y2, title ('y[n]') 'filled') 'filled') 'filled') 'filled') Kết : 10 Q: Comment on your result How does this result indicate that the system is unstable? Hê ̣ thố ng tăng dần từ -2 đến tới điểm tín hiê ̣u khơng tăng tăng từ 15 Invertible and Inverse Systems Exercise The system y[n] = sin(2πx[n]) where x[n]=[0 0] is not invertible Illustrate this by showing that the system is not one-to-one As follows: - Define a vector of n values of 0,1,2,3,4 and and label it as n - Define x[n] as a vector of the values 0,1,2,3,4 and - Define the output as y[n] = sin(2πx[n]) - Plot x[n] and y[n] using the commands (stem) and (subplot) Your result shouldbe as shown in Figure4 Trả lời : %Nguyen Van Vinh Hoa code %Exercise n=[0 5]; x=[0 0]; y=sin(2*pi*x); figure(4) xlabel ('n') subplot(2,1,1),stem (n, x, 'filled') title ('x[n]') xlabel ('n') subplot(2,1,2),stem (n, y, 'filled') title ('y[n]') Kết : 16 Q: Comment on the result justifying the claim that the system in not invertible Hê ̣ thớ ng đảo ngược ̣ đảo ngược ̣ mà từ tín hiê ̣u đầu ta xác định cách xác tín hiệu đầu vào 17 LAB : THE CONVOLUTION SUM AND INTEGRAL Exercise Use MATLAB to evaluate the convolution of x[n] with itself, where Procedure: - Define the signal x as a vector of values [ 1 1 1], using the (ones) command - Use the (conv) function to evaluate the convolution of x with itself, and name it as y - Define the index vector n to range from to 10 - Using the function (stem), plot y versus n - Label the vertical and horizontal axes as (Amplitude) and (Time), respectively - Title the figure as (y[n]) Trả lời: %Nguyen Van Vinh Hoa code %LAB4 %Exercise x=ones(1,6); y=conv(x,x); n=[0:10]; figure(1) stem(n, y, 'filled') xlabel('Time') ylabel('Amplitude') title ('y[n]') Q: Comment on the relationship between the length of y[n] and x[n] 18 Exercise I Consider the discrete time signals:  Define the signal x as a vector of values [0 5]  Define the signal u as a vector of values [ 1 1 1], using the (ones) command  Use the function (conv) function to evaluate the convolution of x with u, and name it as y  Define the index vector n to range from to 10  Using the function (stem), plot y versus n  Label the vertical and horizontal axes as (Amplitude) and (Time), respectively  Title the figure as (y[n]) Trả lời: x= [0:5]; u=ones(1,6); y=conv(x,u); n=[0:10]; figure(1) stem(n,y,'filled') ylabel('bien do') xlabel('thoi gian') title('y[n]') II Repeat part I using u[n+5] instead of u[n] Trả lời: 19 x=[0 5]; u=ones(1,6); y=conv(x,u); n=[-5:5]; figure(1) stem(n,y,'filled') xlabel('Thoi gian') ylabel('bien do') title('x[n]*u[n+5]') Q: Comment on the relationship between y[n] in part I, and y[n] of part II Trả lời: Biên độ y[n] phần bắt đầu khoảng thời gian kết thúc 10 biên độ tăng dần theo mố c thời gian đến bắt đầu giảm dần Biên độ y[n] phần bắt đầu khoảng thời gian -5 kết thúc biên độ tăng dần theo mố c thời gian -5 đên bắt đầu giảm dần Exercise In this part, continuous time convolution will be simulated in the discrete case Consider the continuous time signals x(t) and h(t) Generate these functions using a time step of 0.1 Procedure:  Define the domain of x as a vector ranging from to 5, with a time step of 0.1 Name it as tx  Define the domain of h as a vector ranging from to 7, with a time step of 0.1 Name it 20 as th  Define the signal x as a vector of ones over the index vector tx, using the (ones),(length) command,  Define the signal h as a vector of ones of the index vector th, using the (ones) ),(length) command  Declare the total time length of the convolution to range from to 12, with a 0.1 step Name it as ty  Use the function (conv) function to evaluate the convolution of x(t) with h(t), and name it as y Hint: Don’t forget to multiply the conv by Ts=0.1 (Ts step time)  Using the function (stem), plot y versus ny  Label the vertical and horizontal axes as (Amplitude) and (Time), respectively  Title the figure as (y(t)) Trả lời: tx=1:0.1:5; th=2:0.1:7; x=ones(1, length(tx)); h=ones(1, length(th)); ty=3:0.1:12; y=0.1*conv(x, h); stem(ty,y,'filled'); ylabel('bien do') xlabel('thoi gian') title('y(t)'); Q: Comment on the relationship between the time length of y(t)and that of x(t) and h(t) 21 LAB 5:DIFFERENTIAL EQUATIONS LTI Systems Described by Differential Equations: Exercise Consider the causal LTI system described by the first order differential equation: The latter equation can be rewritten as Write a MATLAB code to simulate the step response of this system This can be done as follows:  Define the system coefficient vectors(a) and (b)  Define the time vector t ranging from to 10, with a time increment  Define input as a row vector x of ones with the same length of t  Use the function (lsim) to evaluate the output y  Plot the output vector y versus time vector t with dashed lies (- -)  Label the axes as the (output), (time), respectively  Title the figure as (Simulated Output) To compare the simulated output to the actual one, plot the solution of the differential equation versus time as follows:  Define the time vector t ranging from to 10, with a time increment  Plot the function , versus time  Label the axes and title the figure as( Exact Output)  Your answer should be as indicated in Fig1 Trả lời: a = [1,1/2]; b = [1]; t = [0:1:10]; x=ones(1,length(t)); y=lsim(b,a,x,t); plot(t,y,' '); title('simulated output'); 22 Exercise Following a similar procedure to that of exercise 1, use (lsim) to compute the response of the system: To the input: Your answer should be as indicated in Fig2 b=1; a=[1, 2]; t= 0:0.01:10; x=t>=2; y= lsim(b, a, x, t); plot (t, y); xlabel('time'); ylabel('output'); title('Response of the System'); 23 Exercise Plot the step and impulse responses of the system described by: Proceed as follows:  Define the system coefficient vectors(a) and (b)  Define the time vector t ranging from to 10, with a 0.1 time increment  Define input as a row vector x of ones with the same length of t  Use the function (step) to evaluate the step response of the system, and name it as s  Use the function (impulse) to evaluate the step response of the system, and name it as i  Use the command (subplot) to plot the step impulse response(s) on the top, and impulse response (i) in the bottom of the same graph window  Label the axes and title the figures  Your answer should be as indicated in Fig2 Trả lời: b = 1; a = [1, 0.5]; t = 0:0.1:10; ys = step(b,a,t); yi = impulse(b,a,t); subplot(2,1,1); plot(t,ys); xlabel('time'); ylabel('output'); title('Step Response');%bước đáp ứng subplot(2,1,2); plot(t,yi); xlabel('time'); ylabel('output'); title('Impulse Response'); %đáp ứng xung 24 25 LAB FOURIER SERIES and FOURIER TRANSFORM REPRESENTATION 6.1 Compute the DTFS with fft: Exercise 1: Consider using MATLAB to solve Problem 3.3(a) in (Simon Haykin 2nd Edition) book For the DTFS coefficient, the signal: This signal has period N=24 Procedure:  Define the signal period N  Define the index vector n to range from to 23  Define the signal x as a vector of ones using the (ones) command plus sin valus Also plot the signal in figure using stem  Use the function (fft) function to evaluate the DTFS coefficients and store it in X  Plot the real and imaginary parts of fourier series coefficient x using subplot and stem on figure  Plot the absolute value and angles of fourier series coefficient x using subplot and stem on figure  Use the function (ifft) function to reconstruct the orginal time domain signal x and store it in x_recon Plot it on figure as real and imaginary part using subplot Q: Comment on the relationship between figures of x[n] and x_recon? Trả lời: N=24;n=0:23; x1=1+sin(((n*pi)/12)+((3*pi)/8)); figure(1) stem(n,x1,'filled') title('x[n]') x2=(1/N)*fft(x1); X1=real(x2); X2=imag(x2); figure(2) subplot(2,1,1),stem(n,X1,'filled') 26 title('do thi phan thuc va phan ao') subplot(2,1,2),stem(n,X2,'filled') figure(3) X3=abs(x2); X4=angle(x2); subplot(2,1,1),stem(n,X3,'filled') title('do thi gia tri tuyet doi va cac goc cua chuoi fourier x ') subplot(2,1,2),stem(n,X4,'filled') x_recon=N*ifft(x2); figure(4) X5=real(x_recon); X6=imag(x_recon); subplot(2,1,1),stem(n,X5,'filled') subplot(2,1,2),stem(n,X6,'filled') 6.1 Frequency Response Of LTI System From Impulse Response: For a causal LTI system described by a difference equation,  the command [H omega]=freqz (b,a,N) computes the frequency response at N evenly spaced frequencies between and π , i.e., ( ⁄ ) for ≤ k ≤ N -1  the command [H omega]=freqz (b,a,N,’whole’) computes the frequency 27 response at N evenly spaced frequencies between and 2π , i.e., ( ⁄ ) for ≤ k ≤ N -1  the coefficient vectors a and b specify the difference equation using the same format in lab  Freqz returns in H and the frequencies in omega Exercise 1: Consider the following difference equation: 1) Evaluate the Frequency Response at evenly spaced between and ? Procedure:  Define a and b to describe the previous causal LTI system as a vectors  Use freqz with the coefficients a and b define H1 to be the value of the frequency response at evenly spaced frequencies between and π and omega1 to be those frequencies 2) Evaluate the Frequency Response at evenly spaced between and ? Trả lời: b = [ -1]; a = [1 -0.75 0.6]; w=0:pi/4:pi; h=freqz(a,b,w); figure(1) plot(w/pi, 20*log10(abs(h)),'linewidth',3) ax=gca; ax.XTick= 0:.25:1; xlabel('tan so)') ylabel('kich co (dB)') grid on w=0:2*pi/4:2*pi; h=freqz(a,b,w); figure(2) plot(w/pi,20*log10(abs(h)),'Linewidth',3) ax=gca; ax.XTick=0:0.25:2; xlabel('tan so') ylabel('kic co (dB)') grid on 28 29

Ngày đăng: 09/11/2023, 23:16

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan