Code covered by the BSD License  

Highlights from
Decimal to Q15 format

5.0

5.0 | 1 rating Rate this file 10 Downloads (last 30 days) File Size: 1.16 KB File ID: #18558

Decimal to Q15 format

by Szymon Leja

 

31 Jan 2008 (Updated 01 Feb 2008)

Function that converts decimal value to Q15 format.

| Watch this File

File Information
Description

y = dec2q15( x , form )

Function that works with any decimal value (beacuse of saturation using). Available representation of Q15 format are binary or hexadecimal.

Input arguments of function:
x - decimal integer
form - form - dependent on representation of input argument (hexadecimal or binary) take 'hex' or 'bin'

Valu of function:
y - its hexadecimal or binary representation stored in a MATLAB string

EXAMPLE:
>> dec2q15(0.125,'hex')

ans =

1000

>> dec2q15(0.125,'bin')

ans =

0001000000000000

>> dec2q15(-0.775,'hex')

ans =

9ccd

>> dec2q15(-0.775,'bin')

ans =

1001110011001101

MATLAB release MATLAB 7.5 (R2007b)
Other requirements non
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Comments and Ratings (1)
11 Feb 2008 saroja siddamal  
Please login to add a comment or rating.
Tag Activity for this File
Tag Applied By Date/Time
dsp Szymon Leja 22 Oct 2008 09:45:47
dec decimal q15 to convert Szymon Leja 22 Oct 2008 09:45:47
dec decimal q15 to convert Onyekachi Acholem 22 Apr 2009 01:12:05

Contact us at files@mathworks.com