Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Floating point to Fixed point conversion

Status
Not open for further replies.

bloodemon

Junior Member level 2
Joined
Feb 16, 2005
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,442
floating point to fixed point conversion

Hi,

I want to do a small survey, and would be very glad to see some useful discussion.

What kind of flow are you guys using?

Matlab(floating) -> C (floating) -> C(fixed)-> C performance tuning

or

Matlab(floating) -> Matlab(fixed)->C(fixed)->C performance tuning

I realized that in Matlab 7.0 there is a fixed point simulink toolbox, and a couple of other tools available for this conversion.

What's the tool you are using? or just do the conversion manually?
 

zcg

Junior Member level 1
Joined
May 19, 2004
Messages
19
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,283
Activity points
155
float to fixed point conversion in q formats

used to :mathcad(floating) -> C(fixed)->RTL
now: simulink -> RTL
 

brmadhukar

Advanced Member level 3
Joined
Jun 21, 2002
Messages
840
Helped
42
Reputation
84
Reaction score
11
Trophy points
1,298
Location
India
Activity points
6,783
float to fixed conversion for dsp

Hi.
If you are just intersted in fixed point on PC it is OK for doing the same thing on the processors, you need to consider lot of other parameters. You need to see if the floating oint can be implemented and develop a library for fixed point routines.
brmadhukar
 

echo47

Advanced Member level 5
Joined
Apr 7, 2002
Messages
3,942
Helped
637
Reputation
1,272
Reaction score
88
Trophy points
1,328
Location
USA
Activity points
33,183
What is your target processor?

I sometimes use MATLAB to help design my DSP algorithms. Then I write a C program (if targeting a PC), or I write HDL (if targeting an FPGA). I don't use any conversion software.

When writing C for a PC (Intel or AMD CPU), I usually don't bother with fixed point, because floating point runs about as fast, and it's a lot more convenient.

When writing HDL for an FPGA, I simply use integer arithmetic, and keep track of the required scaling factors and shifts along the way.
 

ye.hui

Junior Member level 1
Joined
Dec 20, 2004
Messages
15
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
119
Matlab(floating) -> Matlab(fixed)-> RTL
 

dab

Newbie level 1
Joined
Feb 28, 2005
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,290
Matlab(floating) -> Matlab(fixed)->C(fixed)->C performance tuning

C GNU compiler itself provides lot of performance tuning, including architecture specific optimization.
 

bloodemon

Junior Member level 2
Joined
Feb 16, 2005
Messages
20
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,442
Hi Echo47,

Let's say, target for FPGA. When you saying use Matlab to help design your dsp algorithm, you mean algorithm verification that make sure the algorithm is working or use it to determine the scaling factors, etc.

bloodemon
 

echo47

Advanced Member level 5
Joined
Apr 7, 2002
Messages
3,942
Helped
637
Reputation
1,272
Reaction score
88
Trophy points
1,328
Location
USA
Activity points
33,183
I use MATLAB only for concept design in floating-point. I usually don't do any integer or fixed-point processing in MATLAB. When I code the design in C or HDL, I do the integer scaling at that time. That's just my style. I'm a better at writing C and HDL than MATLAB.
 

claint

Member level 5
Joined
May 21, 2004
Messages
94
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,288
Activity points
762
matlab float-> SPW (or simulink ) fixed-> RTL

How do you guys verify the RTL?

I compare the results of spw with RTL output.
It seems no hex or bin data formats of simulink output . so it is hard to compare the output of simulink and RTL.. How do you settle the problem?
 

jarodz

Full Member level 1
Joined
Mar 12, 2005
Messages
96
Helped
16
Reputation
32
Reaction score
3
Trophy points
1,288
Location
Taiwan
Activity points
2,147
Firstly, I develop algorithm in Matlab.
Then I do the precision simulation manually by parameter setting(don't need fixed point toolbox).
This work is like fixed c programing.
Finally, it is implementation of RTL.
 

Eric Lin

Newbie level 6
Joined
Mar 25, 2005
Messages
13
Helped
4
Reputation
8
Reaction score
2
Trophy points
1,283
Activity points
1,415
I usually used c environment except design the filter coefficients or simulate the system function.

For instance, Porting MP3 Decoder on DSProcessor using assembly language.
(1)Floating Point C
(2)Discriminating tables,gobal variables,local variables,buffer from floating point c.
(3)Transforming 2/3 dimension variables/tables to one dimension array or point.
(4)Observing the values of table,gobal variable,local variable to dfine
integer/fraction precision using Q format.
(5)Using "printf/fprintf" watchs the precision to avoid overflow.
(6)Rearranging Q format.
(7)Transforming fixed point c to DSP assembly language.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top