Logo

Hawk Software

Programming, web design, and more

Recent Posts

Category

Archives

Meta

Floating point to fixed point code conversion – Part 3: Using macros to bridge the conversion process

Programming, Speech/Voice Compression 5 Comments

Be sure to read Part 1 for an introduction to fixed point math, and Part 2 for guidelines in preparing your floating point code for conversion to fixed point.

I begin the conversion process by adding these macros to the source files to emulate the fixed point math functions which will be used later:

#define fixed32         float
#define ftofix32(x)     ((float)(x))  /* float value to fixed */
#define itofix32(x)     ((float)(x))  /* integer value to fixed */ Read the rest of this entry »

What I’m Reading

Network, Programming, Speech/Voice Compression Comments Off

OK, so I needed a filler while I finalize changes to the next installment to the floating-to-fixed point series ;)   But hey, this is all good, if not varied, information.

Ask Phil – Where are unicode Winsock functions?

Network, Programming Comments Off

Many people have asked questions similar to this:

When I get into winsock in globalization, I found out winsock.h has a lot of different data structure if _UNICODE turned on. But, there is no function support those data types. such as gethostbyname(…) only take const char FAR * name. How could I call gethostbyname when _UNICODE turned on in Visual C++?

My reply: Read the rest of this entry »

Floating point to fixed point code conversion – Part 2: Preparing your code

Programming, Speech/Voice Compression 2 Comments

See Part 1 for an introduction to fixed point code, and the reasons you may need to use it.

Starting off with clean, fully debugged, fully functional, and stable floating point code is a must. Fixed point code can be harder to interpret, so you do not want to be modifying the converted code every time you correct or add a feature to the original code. It is even better to start off with code that has not been heavily hand-optimized since it will be easier to understand and convert. Of course, make sure your algorithms are efficient and you are not doing something stupid like scanning through arrays non-sequentially and getting a ton of cache misses ;) Read the rest of this entry »

Ask Phil – UDP datagram loss

Network, Programming Comments Off

Mike asked:

I have a question about the loss of UDP datagrams.  System setup like below:

 /-------------\    Crossover    /-------------\
 | System A    |  <------------> | System B    |
 | 192.168.0.1 |      Cable      | 192.168.0.2 |
 \-------------/      100MB/s    \-------------/

If I have a test program to send UPD datagrams across this connection, assuming I am not overloading the link, should I expect any datagram loss? Read the rest of this entry »