Thí nghiệm Tín Hiệu Hệ Thống

36 449 0
Thí nghiệm Tín Hiệu 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

Whether a storm is a tropical depression, tropical storm, or hurricane is determined by the average sustained wind speed. In miles per hour, a storm is a tropical depression if the winds are less than 38 mph. It is a tropical storm if the winds are between 39 and 73 mph, and it is a hurricane if the wind speeds are

MỤC LỤC: LAB 1: MATLAB A: NỘI DUNG LÝ THUYẾT 1.1 Giới thiệu về matlab: 1.2 Toán tử 1.3 Vecto và Ma trận 1.4 Đồ thị và chú thích 1.5 Câu lệnh lựa chọn 1.6 Câu lệnh lựa chọn B:BÀI TẬP VÀ MÔ PHỎNG LAB 2:FOURIER SERIES & FOURIER TRTRANSFORMS A:NỘI DUNG LÝ THUYẾT 1.Chuỗi Fourier 2.Biến đổi fourier B:BÀI TẬP VÀ MÔ PHỎNG LAB 3:FILTERING PERIODIC SIGNALS A:NỘI DUNG LÝ THUYẾT I. Chuyển tín hiệu sang miền tần số và ngược lại: II. Bộ lọc thông thấp III:Bộ lọc thông cao B:BÀI TẬP VÀ MÔ PHỎNG 1 LAB 1: MATLAB A: NỘI DUNG LÝ THUYẾT 1.1 Giới thiệu về matlab: Matlab là phần mềm cung cấp môi trường tính toán số và lập trình, do công ty MathWorks thiết kế. MATLAB cho phép tính toán số với ma trận, vẽ đồ thị hàm số hay biểu đồ thông tin, thực hiện thuật toán, tạo các giao diện người dùng và liên kết với những chương trình máy tính viết trên nhiều ngôn ngữ lập trình khác. 1.2 Toán tử + Cộng – Trừ * Nhân / Chia ^ Mũ 1.3 Vecto và Ma trận 1.3.1 Tạo vecto hàng >> v = [1 2 3 4] v = 1 2 3 4 >> v = [1,2,3,4] v = 1 2 3 4 +Sử dụng Colon: >> vec = 1:5 vec = 1 2 3 4 5 >> nv = 1:2:9 nv = 1 3 5 7 9 + Sử dụng linspace: tạo ra một vecto khoảng cách tuyến tính, 2 linspace(x,y,n) tạo ra 1 vecto với n giá trị trong phạm vi bao gồm từ x đến y. Ví dụ: >> ls = linspace(3,15,5) ls = 3 6 9 12 15 Vecto biến tạo ra bằng cách sử dụng các biến hiện tại. Ví dụ: >> newvec = [nv ls] newvec = 1 3 5 7 9 3 6 9 12 15 1.3.2 Tạo vecto cột Các số trong một cột cách nhau bở dấu ; >> c = [1; 2; 3; 4] c = 1 2 3 4 >> r = 1:3; >> c = r’ c = 1 2 3 1.3.3 Tạo biến ma trận >> mat = [4 3 1; 2 5 6] mat = 4 3 1 2 5 6 >> mat = [2:4; 3:5] mat = 2 3 4 3 4 5 >> newmat = [2 6 88 33 5 2] 3 newmat = 2 6 88 33 5 2 Ma trận không zeros(3) ans = 0 0 0 0 0 0 0 0 0 1.4 Đồ thị và chú thích Dùng lệnh plot để vẽ đồ thị Ví dụ :plot(t,y) %vẻ đồ thị hàm y theo thời gian t Chú thích: title(' ‘) % Tên đồ thị xlable(‘ ‘) % Chú thích trên trục x ylabel(‘ ‘) % Chú thích trên trục y grid on % Chia ô trên đồ thị subplot(m,n,p) % Chia vị trí của đồ thị:m là số hàng, n là số cột và p là vị trí trong cửa sổ. 1.5 Câu lệnh lựa chọn 1.5.1 Biểu thức quan hệ >,<,>=,<=,==,~=,||,&&,~ 1.5.2 Lệnh IF if condition action end 1.5.3 Lệnh IF –ELSE *if if condition action1 else action2 end *Switch switch switch_expression 4 case caseexp1 action1 case caseexp2 action2 case caseexp3 action3 % etc: there can be many of these otherwise actionn end 1.6 Lệnh FOR for loopvar = range action end B:BÀI TẬP VÀ MÔ PHỎNG Exercises 1: Create a variable ftemp to store a temperature in degrees Fahrenheit (F). Convert this to degrees Celsius and store the result in a 5 variable ctemp. The conversion factor is C = (F – 32) * 5/9.  Exercises 2: Using the colon operator, create the following vectors 3 4 5 6 1.0000 1.5000 2.0000 2.5000 3.0000 5 4 3 2 6  Exercises 3: Using the linspace function, create the following vectors: 4 6 8 –3 –6 –9 –12 –15 9 7 5 7 Exercises 4: Using colon operators for the rows, create the matrix: 7 6 5 3 5 7  Exercises 5: Plot exp(x) for values of x ranging from –2 to 2 in steps of 0.1. Put an appropriate title on the plot, and label the axes. 8  Exercises 6: Plot sin (x) for x values ranging from 0 to (in separate Figure Windows): - using 10 points in this range - using 100 points in this range Nhận xét:Đồ thị là tập hợp của nhiều điểm,khi ta chọn càng nhiều điểm để vẻ thì đồ thị sẽ chính xác hơn. Exercises 7: Whether a storm is a tropical depression, tropical storm, or hurricane is determined by the average sustained wind speed. In miles per hour, a storm is a tropical depression if the winds are less than 38 mph. It is a tropical storm if the winds are between 39 and 73 mph, and it is a hurricane if the wind speeds are > = 74 mph. Write a script that will prompt the user for the wind speed of the storm, and will print which type of storm it is. 9  Exercises 8: Create a 3 × 5 matrix. Perform each of the following two ways: using built-in functions, and also using loops (with if statements if necessary): § Find the maximum value in each column. § Find the maximum value in each row. § Find the maximum value in the entire matrix 10 . Fahrenheit (F). Convert this to degrees Celsius and store the result in a 5 variable ctemp. The conversion factor is C = (F – 32) * 5/9.  Exercises 2: Using the colon operator, create the following. tropical storm if the winds are between 39 and 73 mph, and it is a hurricane if the wind speeds are > = 74 mph. Write a script that will prompt the user for the wind speed of the storm, and will. title on the plot, and label the axes. 8  Exercises 6: Plot sin (x) for x values ranging from 0 to (in separate Figure Windows): - using 10 points in this range - using 100 points in this range

Ngày đăng: 23/05/2015, 01:05

Từ khóa liên quan

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

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

Tài liệu liên quan