1 / 170

حل مثال های مخابراتی به کمک متلب

حل مثال های مخابراتی به کمک متلب. بخش اول كليات. What is Matlab ?. Matrix Libratory Matlab is a matrix-based programming tool. High-performance language User-friendly environment The standard matrix exhibits two dimensions n×m

chet
Download Presentation

حل مثال های مخابراتی به کمک متلب

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. حل مثال های مخابراتی به کمک متلب

  2. بخش اول كليات

  3. What is Matlab? • Matrix Libratory • Matlabis a matrix-based programming tool. • High-performance language • User-friendly environment • The standard matrix exhibits two dimensions n×m • Column vectors and row vectors are represented consistently by n × 1 and 1 × n matrices,

  4. MATLAB Working Environment • The Command Window • The Figure Window • Help and Online Documentation • Disk File Manipulation and Shell • Data Import/Export • Memory Utilization • Microsoft Windows Handbook • UNIX Handbook

  5. The Command Window The Command Window is the main window in which you communicate with MATLAB. The MATLAB interpreter displays a prompt (>>) indicating that it is ready to accept commands from you. For example, to enter a 3-by-3 matrix, you can type A = [1 2 3; 4 5 6; 7 8 10]

  6. When you press the Enter or Return key, MATLAB responds with A = 1 2 3 4 5 6 7 8 10

  7. Command Line Editing • Arrow and control keys on your keyboard allow you to recall, edit, and reuse commands you have typed earlier. For example, suppose you mistakenly enter • rho = (1+ sqt(5))/2 • You have misspelled sqrt. MATLAB responds with undefined function or variable ’sqt’. Instead of retyping the entire line, simply press the key. The misspelled command is redisplayed. Use the key to move the cursor over and insert the missing r. Repeated use of the key recalls earlier lines.

  8. Clearing the Command Window • Use clc to clear the Command Window. This does not clear the workspace, but only clears the view. After using clc, you still can use the up arrow key to see the history of the commands, one at a time.

  9. The format Command • The ‘format’ command controls the numeric format of the values displayed on the screen. The command affects only how numbers are displayed, not how MATLAB computes or saves them. • On Windows platforms, you can change the default format by selecting Preferencesfrom the File menu, and selecting the desired format from the General tab.

  10. Isinf,isnan,isfinit • این توابع روی یک ماتریس عمل نموده و مشخص می کند کدام عنصر یک آرایه دارای مقدار inf یا nan و یا -inf هستند.

  11. C=Max(A,B) • در دو ماتریس یا ابعاد یکسان نظیر به نظیر مقایسه را انجام می دهد. • C=max(A,[]-j)

  12. various formats and the output produced • x = [4/3 1.2345e–6] • format short • 1.3333 0.0000 • format short e • 1.3333e+000 1.2345e–006 • format short g • 1.3333 1.2345e–006 • format long • 1.33333333333333 0.00000123450000

  13. format long e • 1.333333333333333e+000 1.234500000000000e–006 • format long g • 1.33333333333333 1.2345e–006 • format bank • 1.33 0.00 • format rat • 4/3 1/810045 • format hex • 3ff5555555555555 3eb4b6231abfd271

  14. Suppressing Output • If you simply type a statement and press Return or Enter, MATLAB automatically displays the results on screen. However, if you end the line with a semicolon, MATLAB performs the computation but does not display any output. This is particularly useful when you generate large matrices. For example, • A = magic(100);

  15. Matlab Operations • Arithmetic and logical operations • Mathematical functions, • Graphical functions • Input/output operations

  16. The building blocks of expressions • Variables • Numbers • Operators • Functions

  17. Variables When a new variable name is introduced, it automatically creates the variable and allocates the appropriate amount of memory. Example: >> books = 10 creates a 1-by-1 matrix named books and stores the value 10 in its single element

  18. Variable names • Variable names consist of a string • Start with a letter • Followed by any number of letters, digits, or underscores • Matlabis case sensitive

  19. Numbers • Matlab uses the conventional decimal • Scientific notation uses the letter e to specify a power-of-ten scale • Imaginary numbers use either i or j as a suffix • Example: • 7 -55 0.0041 9.657838 6.10220e-10 7.03352e21 2i -2.71828j 2e3i 2.5+1.7jpi

  20. Operators Example: + Addition - Subtraction * Multiplication / Division ’ Complex conjugate transpose ( ) Brackets to specify the evaluation order.

  21. Functions Matlabprovides a large number of standard elementary mathematical functions- Subtraction Example: What is the result of square root or logarithm of a negative? See some more function with this command >> help elfun

  22. Functions Matlabprovides a large number of standard elementary mathematical functions- Subtraction Example: What is the result of square root or logarithm of a negative?

  23. Functions Some of the functions, like sqrt and sin are built-in. They are a fixed part of the Matlab core so they are very efficient. The drawback is that the computational details are not readily accessible. Other functions, like gamma and sinh, are implemented in so called M-files. You can see the code and even modify it if you want

  24. بخش دوم ماتریس ها

  25. 1- برنامه ای بنویسید که خروجی آن ماتریسی به شکل زیر باشد:

  26. 2- درایه سطر اول و ستون سوم این ماتریس را نشان دهید. 3- تمام درایه های واقع در ستون دوم را نشان دهید. 4- تمام درایه های واقع در سطر اول را نمایش دهید. 5- از سطر اول درایه ستون اول و سوم را نمایش دهد. 6- از سطر سوم درایه های ستون اول تا سوم را نمایش دهد.

  27. 7- ابعاد ماتریس فوق را تعیین کنید. 8- تعداد سطرها و ستونها را جداگانه مشاهده کنید. 9- بزرگترین مود سطر یا ستون را در ماتریس نمایش دهید. توضیح: دستور length(A) بین سطر یا ستون هر کد ام بزرگتر است را نمایش میدهد

  28. 11-بزرگترین و کوچکترین عدد هر ستون را نشان دهید 12-بزرگترین و کوچکترین عدد از هر سطر را نشان دهید 13-حاصل جمع تمام ستون ها را در یک بردار نشان دهید. 14-حاصلضرب تمام اعضای ستون ها را در یک بردار نشان دهید.

  29. 15- اعضای هر ستون را به ترتیب صعودی لیست کند. 16- اعضای هر ستون را به ترتیب نزولی لیست کند. 7- میانگین هر ستون را بدست آورد. 18-دستورهای 13 تا 17 را برای سطرها اجرا کنید راهنمایی: Mean(A,2)

  30. 19- دترمینان ماتریس (B)را حساب کنید. 20-معکوس ماتریس Bرا نمایش دهید 21– حاصلضرب ماتریس A*Bرا محاسبه کنید

  31. 22-سطر سوم و اول ماتریس A را حزف و نتیجه را در ماتریس C2 قرار دهید 23- سطر چهارم تا پنجم ماتریس A را حذف و نتیجه را در ماتریس C3 قرار دهید. 24- ستون دوم و سوم ماتریسA حذف شود 24-ماتریس C3 را عضو به عضو در ماتریس B ضرب کنید

  32. بخش سوم توابع کاربردی

  33. با استفاده از توابع موجود در متلب: 1- یک ماتریس تمام یک 5*3 تولید کنید 2- یک ماتریس تمام صفر 4*4 تولید کنید 3- یک ماتریس 3*3که قطر اصلی آن یک و سایر درایه های آن صفر است را تولید کنید(به دو روش)

  34. 4-نتیجه این دستور را مشاهده کنید eye(3,2) 5-استفاده از روش حلقه یک ماتریس با ابعاد 5*3 تمام یک درست کنید.

  35. 6-این دو دستور را با هم مقایسه و نتایج آن را ببینید. m1=1:10:100 m2=linspace(1,100,10) 7-سه عدد با فاصله مساوی بین 1 و 4ایجاد کنید و آن را در بردار d قرار دهید(کوچکترین عدد یک و بزرگترین آن 4 است). 8-حاصل ضرب ماتریس A را در معکوس d بدست آوریر.

  36. 9-لگاریتم در مبنای 2 عدد 2 ، لگاریتم در مبنای 10 عدد 10 و لگاریتم طبیعی عدد 4 را حساب کنید 10-5 عدد تصادفی با توزیع یکنواخت تولید کنید 11-یک ماتریس تصادفی با توزیع ندمال3*3 تولید کنید 12- یک عد تصادفی با توزیع نرمال با میانگین 2 و واریانس 3 تولید کنید.

  37. توان و انرژی Pمحدود توان (قدرت) سیگنال‌های پریودیک E نامحدود نتیجه کلی: سیگنال‌ها Eمحدود انرژی سیگنال‌ها با دوره زمانی محدود Pصفر (Time Limited signals)

  38. انرژي كل(انرژي بي نهايت و انرژي) سيگنال پيوسته زمان • سیگنال های انرژی (مانند سیگنال محدود در حوزه زمان) سیگنال های توان (قدرت مانند سیگنال کسینوسی)

  39. 16- توان و انرژی سیگنال های زیر را حساب کنید Y=t Y=cos(2100t) 17- مقدار تابع گاما به شکل زیر را حساب کنید:

  40. 13-x=a*exp(-a*t)را تشکیل و مقدار آن را به ازای a=8, t=1بدست آورید 14-حد مقدار فوق را وقتی t به سمت 2 میل می کند بدست آورید. 15- انرژی و توان سیگنال exp(-t) را تعیین و مشخص کنید

  41. تجزیه یک عبارت به کسرهای جزئی • با استفاده از دستور residue در نرم افزار MATLAB ميتوان يك عبارت را به كسرهاي جزئي تجزيه نمود . • مثال:

  42. num = [2]; % numerator coefficients • den = [1 12 36 0]; % denominator coefficients • [r,p,k] = residue(num,den), • با اجراي اين دستورات، نتايج زير به نمايش در مي آيد: • r = • -0.0556 • -0.3333 • 0.0556 • p = • -6 • -6 • 0 • k = • []

  43. تبدیل فوریه • با استفاده از دستور fourierدر نرم افزار MATLAB ميتوانتبديل فوريهي يك تابع نمادين را به دست آورد. • مثال: • تبدیل فوریه • توجه: توابع پله واحد و ضربه واحد در MATLABبه ترتيب با توابع dirac و heavisideمشخص ميشوند.

  44. FFT, IFFT • Discrete Fourier transform • Syntax • Y = fft(X)Y = fft(X,n)Y = fft(X,[],dim)Y = fft(X,n,dim)

  45. Definition

  46. Y = fft(X) returns the discrete Fourier transform (DFT) of vector X, computed with a fast Fourier transform (FFT) algorithm. • If X is a matrix, fft returns the Fourier transform of each column of the matrix. • Y = fft(X,n) returns the n-point DFT. If the length of X is less than n, X is padded with trailing zeros to length n. If the length of X is greater than n, the sequence X is truncated. When X is a matrix, the length of the columns are adjusted in the same manner. • Y = fft(X,[],dim) and Y = fft(X,n,dim) applies the FFT operation across the dimension dim.

  47. بررسی ماتریسی FFT

More Related