- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have generated a sinus signal with the Megacore-NCO in Quartus. My question is:
How can I convert the signed binary output to a fixed-point representation?? I want to do this, because I have a low pass filter generated with the Matlab filterbuilder and it will only work with fixed-point signals. Thanks for help! TobiasLink Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Tobias,
--- Quote Start --- How can I convert the signed binary output to a fixed-point representation?? --- Quote End --- do you mean: how to convert a signed binary "fixed-point" number to a two's complement "fixed-point" number? Or do you mean: how to convert a floating-point number to a fixed-point number?- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
First I don't know in which representation the signal comes out of the NCO.....is it already a "fixed-point" number ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In fact, a signed binary number can be interpreted as a fixed point number. It depends on how many fractional bits are assumed.
If the NCO output word width is 16 bits it ranges from -32768 to 32767, considering that sine signal amplitude ranges from -1 to 1, the width of fractional part is 15 bits. (-32768)>>15 = -1 --->Sine signal minimum value. (32767)>>15 = 0.999969482421875 ---> Sine signal maximum value.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Does it mean, that if my Nco generates a 14-bit signed output the signal has a fraction length of 13 bits ??
The low pass filter design from Matlab asks a Input "word length" and "fraction length". So it would be "14" and "13" ? Thanks for your quick help parrado!- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I mean....If the signal with 14 bits should have a range from -8192...8191 it would have no fraction length ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
In case of the filter design, the most important parameter is the fractional bits used for coefficients. You can assume either a 14 bits input with 0 fractional bits or a 14 bits input with 13 fractional bits, it should not matter.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What word and fraction length would you suggest ? Does it make sense to use a higher word length than the signal input is?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you going to use a FIR or a IIR filter?
IIR filters could become unstable if using a small word size. In any case a fixed-point filter will experiment a desviation from desired frequency response. Altera FIR Compiler gives an estimation of frequency response desviation when using fixed point.- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am going to use an elliptic IIR Filter in order mode 6.
There is an estimation in the matlab filterbuilder too. I have tried several word sizes but there is no output signal. I think there is an interpretation problem with fixed-point....- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
--- Quote Start --- What word and fraction length would you suggest ? Does it make sense to use a higher word length than the signal input is? --- Quote End --- I would suggest you use as many fractional bits as you need, no more. Its best to work out what range you require and what precision you need to do this (often, this is done in something like matlab first) Also, keep in mind tricks you can do with hardware multipliers. If you have a number in the range -256 to 255 (9 bit signed) and you need to multiply it by a number in the range -1 to 1-1/256 (this is also 9 bit signed) you can use a 9 bit multiplier for this, instead of zero padding and using an 18 bit multiplier, because all 0s are always implied, giving you a 2^n bias on each number. Therefore your 18 bit output will have 10 bits magnutude (with 2 sign bits) and 8 bits fractional.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page