This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | |||
resources:tools-software:sharc-audio-module:baremetal:matlab_volume_control [19 Aug 2019 22:11] – [Generating C Code with Matlab Coder] Chad Wentworth | resources:tools-software:sharc-audio-module:baremetal:matlab_volume_control [19 Aug 2019 22:26] (current) – Chad Wentworth | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | =====Using a Matlab | + | =====Using a MATLAB |
- | Matlab | + | MATLAB |
<WRAP round 60% important> | <WRAP round 60% important> | ||
- | All Matlab | + | All MATLAB |
</ | </ | ||
- | ====Creating a Function in Matlab==== | + | ====Creating a Function in MATLAB==== |
From the **Home** tab choose **New:: | From the **Home** tab choose **New:: | ||
< | < | ||
Line 18: | Line 18: | ||
This function takes an input audio channel, multiplies it by vol_ctrl_factor and stores the result in the output audio channel. It simply changes the volume. Notice that we don't use a for loop because MATLAB has built in implicit expansion for scalar * vector multiplication. The file name should match the function name so name the file volume_control. | This function takes an input audio channel, multiplies it by vol_ctrl_factor and stores the result in the output audio channel. It simply changes the volume. Notice that we don't use a for loop because MATLAB has built in implicit expansion for scalar * vector multiplication. The file name should match the function name so name the file volume_control. | ||
- | ====Testing the Newly Created Function in Matlab==== | + | ====Testing the Newly Created Function in MATLAB==== |
- | In order for Matlab | + | In order for MATLAB |
< | < | ||
Line 31: | Line 31: | ||
- | ====Generating C Code with Matlab | + | ====Generating C Code with MATLAB |
<WRAP round 60% important> | <WRAP round 60% important> | ||
Line 54: | Line 54: | ||
- Now the code can be generated | - Now the code can be generated | ||
- **Build type** should be set to **Source Code** | - **Build type** should be set to **Source Code** | ||
- | - **Language** should be **C plus plus** | + | - **Language** should be **C plus plus*** |
- Change **Hardware Board** to **None - Select device below** | - Change **Hardware Board** to **None - Select device below** | ||
- **Device vendor** should be **Analog Devices** | - **Device vendor** should be **Analog Devices** |