This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
matlab_guide [2015/08/11 14:53] graham [sound] |
matlab_guide [2016/05/09 09:29] (current) a_west [Interp] |
||
|---|---|---|---|
| Line 48: | Line 48: | ||
| * [[matlab_guide#Files| Files]] | * [[matlab_guide#Files| Files]] | ||
| * [[matlab_guide#fopen| fopen]] | * [[matlab_guide#fopen| fopen]] | ||
| - | * [[matlab_guide#fscan| fscan]] | + | * [[matlab_guide#fscanf| fscanf]] |
| * [[matlab_guide#fclose| fclose]] | * [[matlab_guide#fclose| fclose]] | ||
| * [[matlab_guide#Audio| Audio]] | * [[matlab_guide#Audio| Audio]] | ||
| Line 63: | Line 63: | ||
| ===== Matlab Basic Operations ===== | ===== Matlab Basic Operations ===== | ||
| - | |||
| === Introduction === | === Introduction === | ||
| - | MATLAB is a numeric computation computer software. All of the data types are matrices that can | + | MATLAB is a numerical computation computer software. All of the data types are matrices that can |
| - | either represent numeric or string variables. It is also case sensitive. i.e. a is not the same as B. | + | either represent numeric or string variables. It is also case sensitive (i.e. 'b' is not the same as 'B'). |
| === Basic setup === | === Basic setup === | ||
| - | When you open up MATLAB you have three basic windows available: Current Folder, Command Window, and Workspace. | + | When you open up MATLAB you have three basic windows available: Current Folder, Command Window, and Workspace. |
| + | |||
| The Current Folder window informs the user what folder MATLAB is currently working out of, and displays all of | The Current Folder window informs the user what folder MATLAB is currently working out of, and displays all of | ||
| the files located withing that folder. The Command Window prompts the user for input by the **>>** symbol. Once | the files located withing that folder. The Command Window prompts the user for input by the **>>** symbol. Once | ||
| Line 216: | Line 215: | ||
| </code> | </code> | ||
| - | Length returns the number size of the largest dimension. If row >> column then it will return the length of | + | Length returns the number size of the largest dimension. If row > column then it will return the length of |
| - | the row. If column >> row then it will return the length of the row. | + | the row. If column > row then it will return the length of the column. |
| <code> | <code> | ||
| Line 1482: | Line 1481: | ||
| Type //'help sound'// in the command window for more details | Type //'help sound'// in the command window for more details | ||
| - | ====== Interp ====== | + | ====== Interpolation ====== |
| == External Resources == | == External Resources == | ||
| == Description == | == Description == | ||
| Increases the Sample rate by an integer factor. | Increases the Sample rate by an integer factor. | ||
| + | |||
| + | **Syntax:**\\ | ||
| + | //y = interp(x,r);// This increases the sampling rate of x (input signal) by a factor of r. | ||
| + | |||
| + | **Example: **\\ | ||
| + | Create a sinusoidal signal that is sampled at 1kHz. Upsample by 6 | ||
| + | t = 0:0.01:1; | ||
| + | x = sin(2*pi*30*t) | ||
| + | y = interp(x,6); | ||
| + | | ||
| + | Type //'help interp'// in command window of matlab for more details. | ||