it is giving as 31128 but i am expecting like answer like fdatool
i.e., 3891..
My second question is:
whether my code is not giving proper integer value or the tool?
Basically i am trying to convert fixed point to integer using MATLAB
code like FDAtool?
raj schrieb:
> I have one fixed point number generated using FDAtool
> =0.0593719482421875.
>
> FDAtool report equivalent of the above in 16-bit signed integer using
> const int16 data type as
> =3891 (using generate header file option)
>
> My first question is whether 0.0593719482421875 is equivalent to 3891?
16-bit fixed point means that your value (3891) is defined as
multiples of 1/(2^16) = 1/65536.
it is giving as 31128 but i am expecting like answer like fdatool
i.e., 3891..
how a.int will convert fixed point number to integer?will it not do
like fdatool?
what is the change i have to do in my code to achieve this task?
Can anyone help me in this issue.
regards,
raj.
On Jun 28, 6:03*pm, Hendrik van der Heijden <h...@gmx.de> wrote:
> raj schrieb:
>
> > I have one fixed point number generated using FDAtool
> > =0.0593719482421875.
>
> > FDAtool report equivalent of the above in 16-bit signed integer using
> > const int16 data type as
> > =3891 (using generate header file option)
>
> > My first question is whether 0.0593719482421875 is equivalent to 3891?
>
> 16-bit fixed point means that your value (3891) is defined as
> multiples of 1/(2^16) = 1/65536.
>
> 3891 * 1/65536 = 0.0593719482421875
>
> Hendrik vdH
raj wrote:
> Hai,
>
> FDAtool converts fixed point to integer as:
>
> 3891 * 1/65536 = 0.0593719482421875
>
> I also want to do the same using MATLAB code.For that I have written a
> MATLAB code:
>
> x1=[ 0.0593719482421875 ];
>
> a= fi(x1);
> outfile1 = fopen('samples_in.txt','w');
> result=a.int;
> fprintf( outfile1, '%d\n',result );
> fclose(outfile1);
>
> it is giving as 31128 but i am expecting like answer like fdatool
> i.e., 3891..
>
>
> how a.int will convert fixed point number to integer?will it not do
> like fdatool?
> what is the change i have to do in my code to achieve this task?
>
> Can anyone help me in this issue.
>
> regards,
> raj.
>
>
>
> On Jun 28, 6:03 pm, Hendrik van der Heijden <h...@gmx.de> wrote:
>> raj schrieb:
>>
>>> I have one fixed point number generated using FDAtool
>>> =0.0593719482421875.
>>> FDAtool report equivalent of the above in 16-bit signed integer using
>>> const int16 data type as
>>> =3891 (using generate header file option)
>>> My first question is whether 0.0593719482421875 is equivalent to 3891?
>> 16-bit fixed point means that your value (3891) is defined as
>> multiples of 1/(2^16) = 1/65536.
>>
>> 3891 * 1/65536 = 0.0593719482421875
>>
>> Hendrik vdH
You got a good answer and ignored it. Do we have some reason to suppose
that repeating that answer would be helpful?
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
hai,
You got a good answer and ignored it
I got the answer for my first question that FDAtool generation fixed
point and integer numbers are equal by
3891 * 1/65536 = 0.0593719482421875
But still no one answered how to get the same using MATLAB code "fi"
command and a.int..
pls clarify...
regards,
raj
On Jun 28, 10:41*pm, Jerry Avins <j...@ieee.org> wrote:
> raj wrote:
> > Hai,
>
> > FDAtool converts fixed point to integer as:
>
> > 3891 * 1/65536 = 0.0593719482421875
>
> > I also want to do the same using MATLAB code.For that I have written a
> > MATLAB code:
>
> > x1=[ 0.0593719482421875 ];
>
> > a= fi(x1);
> > outfile1 = fopen('samples_in.txt','w');
> > result=a.int;
> > fprintf( outfile1, '%d\n',result );
> > * fclose(outfile1);
>
> > it is giving as 31128 but i am expecting like answer like fdatool
> > i.e., 3891..
>
> > how a.int will convert fixed point number to integer?will it not do
> > like fdatool?
> > what is the change i have to do in my code to achieve this task?
>
> > Can anyone help me in this issue.
>
> > regards,
> > raj.
>
> > On Jun 28, 6:03 pm, Hendrik van der Heijden <h...@gmx.de> wrote:
> >> raj schrieb:
>
> >>> I have one fixed point number generated using FDAtool
> >>> =0.0593719482421875.
> >>> FDAtool report equivalent of the above in 16-bit signed integer using
> >>> const int16 data type as
> >>> =3891 (using generate header file option)
> >>> My first question is whether 0.0593719482421875 is equivalent to 3891?
> >> 16-bit fixed point means that your value (3891) is defined as
> >> multiples of 1/(2^16) = 1/65536.
>
> >> 3891 * 1/65536 = 0.0593719482421875
>
> >> Hendrik vdH
>
> You got a good answer and ignored it. Do we have some reason to suppose
> that repeating that answer would be helpful?
>
> Jerry
> --
> Engineering is the art of making what you want from things you can get.
> ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
On Jun 28, 1:41 pm, Jerry Avins <j...@ieee.org> wrote:
....
> >>> FDAtool report equivalent of the above in 16-bit signed integer using
> >>> const int16 data type as
> >>> =3891 (using generate header file option)
> >>> My first question is whether 0.0593719482421875 is equivalent to 3891?
> >> 16-bit fixed point means that your value (3891) is defined as
> >> multiples of 1/(2^16) = 1/65536.
>
> >> 3891 * 1/65536 = 0.0593719482421875
>
....
>
> You got a good answer and ignored it. Do we have some reason to suppose
> that repeating that answer would be helpful?
one thing wrong about the answer (and question) is that for 16-bit
*signed* fixed to integer conversion, it's not 1/(2^16) = 1/65536,
but 1/(2^15) = 1/32768 .
"raj" <[email protected]> wrote in message
news:[email protected]...
still i am waiting for the correct procedure to convert from fixed
point to integer..
Wow, what a demanding pitch. Do it yourself, imbecile.
VLV
On Jun 29, 12:17 am, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:
> robert bristow-johnson wrote:
> > one thing wrong about the answer (and question) is that for 16-bit
> > *signed* fixed to integer conversion, it's not 1/(2^16) = 1/65536,
> > but 1/(2^15) = 1/32768 .
>
> With integers, there is a problem with -32768 but +32767. For that
> matter, I prefer the scale factors of 2^N - 1.
>
> Vladimir Vassilevsky
> DSP and Mixed Signal Design Consultanthttp://www.abvolt.com
> one thing wrong about the answer (and question) is that for 16-bit
> *signed* fixed to integer conversion, it's not 1/(2^16) = 1/65536,
> but 1/(2^15) = 1/32768 .
With integers, there is a problem with -32768 but +32767. For that
matter, I prefer the scale factors of 2^N - 1.
still i am waiting for the correct procedure to convert from fixed
point to integer..
On Jun 29, 12:17*am, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:
> robert bristow-johnson wrote:
> > one thing wrong about the answer (and question) is that for 16-bit
> > *signed* fixed to integer conversion, it's not *1/(2^16) = 1/65536,
> > but *1/(2^15) = 1/32768 .
>
> With integers, there is a problem with -32768 but +32767. For that
> matter, I prefer the scale factors of 2^N - 1.
>
> Vladimir Vassilevsky
> DSP and Mixed Signal Design Consultanthttp://www.abvolt.com
> still i am waiting for the correct procedure to convert from fixed
> point to integer..
Multiply by 2^b, where b is your scaling factor. So, for your number,
b = 16, and
0.0593719482421875 * 2^16 = 3891.
--
% Randy Yates % "She tells me that she likes me very much,
%% Fuquay-Varina, NC % but when I try to touch, she makes it
%%% 919-577-9882 % all too clear."
%%%% <[email protected]> % 'Yours Truly, 2095', *Time*, ELO http://www.digitalsignallabs.com
Jerry
--
Engineering is the art of making what you want from things you can get.
ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ ŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻŻ
thanks for your clarification.My problem is i have the following sine
wave generation:
Fs =17;
fin1 = 5;
Ts=1/Fs;
t = 0 : Ts : 1-Ts;
n=length(t);
x1= 3.5 * sin(2*pi*fin1*t)
x1 =
0 -3.4122 1.5186 2.7364 -2.7364 -1.5186 3.4122
Now i am converting float to fixed data by
a=fi(x1) % quantized form of above (Is this
required?)
a =
0 -3.4122 1.5186 2.7365 -2.7365 -1.5186 3.4122
I want to convert the above fixed to integer.....what should i do
without loss of precision ?As It is not the multiple of 2^16 even if i
multiple the above values by 2^16 i will not get integers..
pls help for this challenging task
regards,
raj
On Jun 29, 12:44*am, Randy Yates <ya...@ieee.org> wrote:
> raj <rajesh.o...@gmail.com> writes:
> > still i am waiting for the correct procedure to convert from fixed
> > point to integer..
>
> Multiply by 2^b, where b is your scaling factor. So, for your number,
> b = 16, and
>
> * 0.0593719482421875 * 2^16 = 3891.
> --
> % *Randy Yates * * * * * * * * *% "She tells me that she likes me very much,
> %% Fuquay-Varina, NC * * * * * *% * * but when I try to touch, she makes it
> %%% 919-577-9882 * * * * * * * *% * * * * * ** * * * * * * *all too clear."
> %%%% <ya...@ieee.org> * * * * * % * * * *'Yours Truly, 2095', *Time*, ELO *http://www.digitalsignallabs.com
> a =
>
> 0 -3.4122 1.5186 2.7365 -2.7365 -1.5186 3.4122
>
> I want to convert the above fixed to integer.....what should i do
> without loss of precision ?As It is not the multiple of 2^16 even if i
> multiple the above values by 2^16 i will not get integers..
Then multiply by 10000 (10^4) and you'll get the integers.
> a =
>
> 0 -3.4122 1.5186 2.7365 -2.7365 -1.5186 3.4122
>
> even if i multiple the above values by 2^16 i will not get integers..
raj,
what is the result of a*65536? (do it in the Matlab command window)
> pls help for this challenging task
raj, if this is challenging, you're in the wrong field.
--
% Randy Yates % "Bird, on the wing,
%% Fuquay-Varina, NC % goes floating by
%%% 919-577-9882 % but there's a teardrop in his eye..."
%%%% <[email protected]> % 'One Summer Dream', *Face The Music*, ELO http://www.digitalsignallabs.com
> raj <[email protected]> writes:
>
>> a =
>>
>> 0 -3.4122 1.5186 2.7365 -2.7365 -1.5186 3.4122
>>
>> even if i multiple the above values by 2^16 i will not get integers..
>
> raj,
>
> what is the result of a*65536? (do it in the Matlab command window)
I found it actually a=fi(x1) by default taking the wordlength=16 and
fraction=13..
so for a.int
so i should do -3.4122*8192..am i correct..??
regards,
fazal
On Jun 29, 2:11*am, Randy Yates <ya...@ieee.org> wrote:
> Randy Yates <ya...@ieee.org> writes:
> > raj <rajesh.o...@gmail.com> writes:
>
> >> a =
>
> >> * * * * *0 * -3.4122 * *1.5186 * *2.7365 * -2.7365 * -1.5186 * *3.4122
>
> >> even if i multiple the above values by 2^16 i will not get integers..
>
> > raj,
>
> > what is the result of a*65536? (do it in the Matlab command window)
>
> Also, read this:
>
> *http://www.mathworks.com/access/help...ixedpoint/inde....
> --
> % *Randy Yates * * * * * * * * *% "How's life on earth?
> %% Fuquay-Varina, NC * * * * * *% *... What is it worth?"
> %%% 919-577-9882 * * * * * * * *% 'Mission (A World Record)',
> %%%% <ya...@ieee.org> * * * * * % *A New World Record*, ELOhttp://www.digitalsignallabs.com
On Jun 28, 3:17 pm, Vladimir Vassilevsky <antispam_bo...@hotmail.com>
wrote:
> robert bristow-johnson wrote:
> > one thing wrong about the answer (and question) is that for 16-bit
> > *signed* fixed to integer conversion, it's not 1/(2^16) = 1/65536,
> > but 1/(2^15) = 1/32768 .
>
> With integers, there is a problem with -32768 but +32767. For that
> matter, I prefer the scale factors of 2^N - 1.
that'll make fixed-point multiplication a snap. how do you shift
right by log2(2^N-1) bits?
> Hai,
>
> I found it actually a=fi(x1) by default taking the wordlength=16 and
> fraction=13..
The default constructor creates a 16-bit integer, but "best-precision
fraction length" [1]. So the fraction length depends on the value you're
converting.
> so for a.int
a.int should return the very integer(s) you are seeking. In other
words, this whole thread is for naught if you would have simply
read the documentation.
> so i should do -3.4122*8192..am i correct..??
Read the documentation. If there's something specific you don't
understand in the manual, come back and ask here, or better, ask in
comp.soft-sys.matlab.
--
% Randy Yates % "How's life on earth?
%% Fuquay-Varina, NC % ... What is it worth?"
%%% 919-577-9882 % 'Mission (A World Record)',
%%%% <[email protected]> % *A New World Record*, ELO http://www.digitalsignallabs.com
Is the above correct procedure to convert to integer.
regards,
raj
On Jun 29, 7:04*am, Randy Yates <ya...@ieee.org> wrote:
> raj <rajesh.o...@gmail.com> writes:
> > Hai,
>
> > I found it actually a=fi(x1) by default taking the wordlength=16 and
> > fraction=13..
>
> The default constructor creates a 16-bit integer, but "best-precision
> fraction length" [1]. So the fraction length depends on the value you're
> converting.
>
> > so for a.int
>
> a.int should return the very integer(s) you are seeking. In other
> words, this whole thread is for naught if you would have simply
> read the documentation.
>
> > so i should do *-3.4122*8192..am i correct..??
>
> Read the documentation. If there's something specific you don't
> understand in the manual, come back and ask here, or better, ask in
> comp.soft-sys.matlab.
> --
> % *Randy Yates * * * * * * * * *% "How's life on earth?
> %% Fuquay-Varina, NC * * * * * *% *... What is it worth?"
> %%% 919-577-9882 * * * * * * * *% 'Mission (A World Record)',
> %%%% <ya...@ieee.org> * * * * * % *A New World Record*, ELOhttp://www.digitalsignallabs.com
> hai,
>
> a=fi(x1)
>
> a =
>
> 0 -3.4122 1.5186 2.7365 -2.7365 -1.5186
> 3.4122
>
> DataTypeMode: Fixed-point: binary point scaling
> Signed: true
> WordLength: 16
> FractionLength: 13
>
> RoundMode: nearest
> OverflowMode: saturate
> ProductMode: FullPrecision
> MaxProductWordLength: 128
> SumMode: FullPrecision
> MaxSumWordLength: 128
> CastBeforeSum: true
>
> a.int
>
> ans =
>
> 0 27577 -15094 -19316 25666 5268 -28550 10358 22881 -22881
>
>
> so to verify the above 3.4122*2^13=27576.7296
>
> Is the above correct procedure to convert to integer.
There's something wrong with your information. The first "a" vector you
print out has 7 scalar values, while the second (a.int) has 10. Without
having the vector lengths match, I can't take the scalar values themselves
seriously and thus can't help you.
--
% Randy Yates % "Maybe one day I'll feel her cold embrace,
%% Fuquay-Varina, NC % and kiss her interface,
%%% 919-577-9882 % til then, I'll leave her alone."
%%%% <[email protected]> % 'Yours Truly, 2095', *Time*, ELO http://www.digitalsignallabs.com
I think now u can able to help me...whether the above conversion is
proper?I am finding mismatch here between wordlength and fraction
length....
so 3.3663*8192=27,576.7296(rounded to nearest as 27577)
As it is rounding to nearest value.. it means some information is
lost..this will ultimately affect the frequency response of the
sinewave which i am trying to generate?I am i correct?can i conclude
that it is not advisable to use integers to represent a signal?But
fixed point is tedious to implement in hardware?any alternative?
regards,
raj.
On Jun 29, 1:05*pm, Mikolaj
<sterowanie_komputer...@hahapoczta.onet.pl> wrote:
> On 28-06-2008 at 23:11:42 Randy Yates <ya...@ieee.org> wrote:
>
> > Randy Yates <ya...@ieee.org> writes:
>
> (...)
>
> > *http://www.mathworks.com/access/help...ixedpoint/inde...
>
> Here is a helpful websitehttp://tinyurl.com/.
>
> http://tinyurl.com/3lv43u
>
> --
> Mikolaj
> Hai randy ,
>
> Sorry for the mistake pls see the following:
>
> x1= 3.5 * sin(2*pi*fin1*t)
> a= fi(x1)
> a*8192
> a.int
>
>
> x1 =
>
>
>
> 0 3.3664 -1.8425 -2.3579 3.1331 0.6431 -3.4851
>
> a =
>
>
> 0 3.3663 -1.8425 -2.3579 3.1331 0.6431 -3.4851
>
> DataTypeMode: Fixed-point: binary point scaling
> Signed: true
> WordLength: 16
> FractionLength: 13
>
> RoundMode: nearest
> OverflowMode: saturate
> ProductMode: FullPrecision
> MaxProductWordLength: 128
> SumMode: FullPrecision
> MaxSumWordLength: 128
> CastBeforeSum: true
>
> ans =
>
>
> 0 27577 -15094 -19316 25666
> 5268 -28550
>
>
> DataTypeMode: Fixed-point: binary point scaling
> Signed: true
> WordLength: 32
> FractionLength: 14
>
> RoundMode: nearest
> OverflowMode: saturate
> ProductMode: FullPrecision
> MaxProductWordLength: 128
> SumMode: FullPrecision
> MaxSumWordLength: 128
> CastBeforeSum: true
>
>
> ans =
>
>
> 0 27577 -15094 -19316 25666 5268 -28550
>
>
> I think now u can able to help me...whether the above conversion is
> proper?I am finding mismatch here between wordlength and fraction
> length....
>
> so 3.3663*8192=27,576.7296(rounded to nearest as 27577)
Matlab represents numbers internally as 8-byte floating point
values. However, when displaying a number in the user interface (for
example, when you type "a" at the Matlab command line prompt, which,
since it doesn't end in a semicolon, will print the contents of "a" to
the screen), it uses a format that can be much more coarse. The format
can be changed with the "format" function. See the help on this
function.
So the internal value of a[2] is not really 3.3663, but something more
like
3.366333008...
That's why I asked you in an earlier post to see what you get when you
compute "a[2]*8192" on the command line - let Matlab compute the result
using the full resolution of the internal data representation. I think
you'll find that the result is almost exactly an integer.
Also, you're looking at things the wrong way. Don't try to compute
the "integer" value from the fi object's output. You have the integer
value available exactly as the .int property. Rather, compare the
values in your x1 vector with those in the a vector.
> As it is rounding to nearest value.. it means some information is
> lost..
With the correction I made above regarding the integer values, yes,
the a values have lost information from the x1 values. Welcome to
quantization. This is what quantizing a value does - it throws
away information.
> this will ultimately affect the frequency response of the
> sinewave which i am trying to generate?I am i correct?
Yes. Under certain assumptions it can be shown that quantizing
a value results in a wideband noise being added to it.
> can i conclude that it is not advisable to use integers to represent a
> signal?But fixed point is tedious to implement in hardware?any
> alternative?
No. The longer you make your integers (the long the word length is),
the less wideband noise that results.
I'm not sure what you mean by "tedios to implement." Generally,
fixed-point hardware implementations are simpler than floating point.
>
>
> regards,
> raj.
>
>
>
> On Jun 29, 1:05*pm, Mikolaj
> <sterowanie_komputer...@hahapoczta.onet.pl> wrote:
>> On 28-06-2008 at 23:11:42 Randy Yates <ya...@ieee.org> wrote:
>>
>> > Randy Yates <ya...@ieee.org> writes:
>>
>> (...)
>>
>> > *http://www.mathworks.com/access/help...ixedpoint/inde...
>>
>> Here is a helpful websitehttp://tinyurl.com/.
>>
>> http://tinyurl.com/3lv43u
>>
>> --
>> Mikolaj
>
--
% Randy Yates % "Maybe one day I'll feel her cold embrace,
%% Fuquay-Varina, NC % and kiss her interface,
%%% 919-577-9882 % til then, I'll leave her alone."
%%%% <[email protected]> % 'Yours Truly, 2095', *Time*, ELO http://www.digitalsignallabs.com
I tried with the following as per your suggestions:
x1= 3.5 * sin(2*pi*fin1*t)
x1*8192
x1.int (error:Attempt to reference field of non-structure array.)
x1 =
1.0e-013 *
0 0.0815 0.1630 0.6175
ans =
1.0e-009 *
0 0.0668 0.1335 0.5058
why it is scaling here by 1.0e-013 * and 1.0e-009 *?
I dont know how to use .int without fixed..pls clarify....
regards,
raj
On Jul 1, 4:51*am, Randy Yates <ya...@ieee.org> wrote:
> raj <rajesh.o...@gmail.com> writes:
> > Hai randy ,
>
> > Sorry for the mistake pls see the following:
>
> > x1= 3.5 * sin(2*pi*fin1*t)
> > a= fi(x1)
> > a*8192
> > a.int
>
> > x1 =
>
> > * * * * *0 * *3.3664 * -1.8425 * -2.3579 * *3.1331* *0.6431 * -3.4851
>
> > a =
>
> > * * * * *0 * *3.3663 * -1.8425 * -2.3579 * *3.1331* *0.6431 * -3.4851
>
> > * *DataTypeMode: Fixed-point: binary point scaling
> > * * * * * * * * Signed: true
> > * * * * * * WordLength: 16
> > * * * * FractionLength: 13
>
> > * * * * * * *RoundMode: nearest
> > * * * * * OverflowMode: saturate
> > * * * * * *ProductMode: FullPrecision
> > * MaxProductWordLength: 128
> > * * * * * * * *SumMode: FullPrecision
> > * * * MaxSumWordLength: 128
> > * * * * *CastBeforeSum: true
>
> > ans =
>
> > * * * * * *0 * * * 27577 * * *-15094 * * *-19316 * * * 25666
> > 5268 *-28550
>
> > * DataTypeMode: Fixed-point: binary point scaling
> > * * * * * * * * Signed: true
> > * * * * * * WordLength: 32
> > * * * * FractionLength: 14
>
> > * * * * * * *RoundMode: nearest
> > * * * * * OverflowMode: saturate
> > * * * * * *ProductMode: FullPrecision
> > * MaxProductWordLength: 128
> > * * * * * * * *SumMode: FullPrecision
> > * * * MaxSumWordLength: 128
> > * * * * *CastBeforeSum: true
>
> > ans =
>
> > * * * 0 *27577 -15094 -19316 *25666 * 5268 -28550
>
> > I think now u can able to help me...whether the above conversion is
> > proper?I am finding mismatch here between wordlength and fraction
> > length....
>
> > so 3.3663*8192=27,576.7296(rounded to nearest as 27577)
>
> Matlab represents numbers internally as 8-byte floating point
> values. However, when displaying a number in the user interface (for
> example, when you type "a" at the Matlab command line prompt, which,
> since it doesn't end in a semicolon, will print the contents of "a" to
> the screen), it uses a format that can be much more coarse. The format
> can be changed with the "format" function. See the help on this
> function.
>
> So the internal value of a[2] is not really 3.3663, but something more
> like
>
> * 3.366333008...
>
> That's why I asked you in an earlier post to see what you get when you
> compute "a[2]*8192" on the command line - let Matlab compute the result
> using the full resolution of the internal data representation. I think
> you'll find that the result is almost exactly an integer.
>
> Also, you're looking at things the wrong way. Don't try to compute
> the "integer" value from the fi object's output. You have the integer
> value available exactly as the .int property. Rather, compare the
> values in your x1 vector with those in the a vector.
>
> > As it is rounding to nearest value.. it means some information is
> > lost..
>
> With the correction I made above regarding the integer values, yes,
> the a values have lost information from the x1 values. Welcome to
> quantization. This is what quantizing a value does - it throws
> away information.
>
> > this will ultimately affect the frequency response of the
> > sinewave which i am trying to generate?I am i correct?
>
> Yes. Under certain assumptions it can be shown that quantizing
> a value results in a wideband noise being added to it.
>
> > can i conclude that it is not advisable to use integers to represent a
> > signal?But fixed point is tedious to implement in hardware?any
> > alternative?
>
> No. The longer you make your integers (the long the word length is),
> the less wideband noise that results.
>
> I'm not sure what you mean by "tedios to implement." Generally,
> fixed-point hardware implementations are simpler than floating point.
>
>
>
>
>
> > regards,
> > raj.
>
> > On Jun 29, 1:05*pm, Mikolaj
> > <sterowanie_komputer...@hahapoczta.onet.pl> wrote:
> >> On 28-06-2008 at 23:11:42 Randy Yates <ya...@ieee.org> wrote:
>
> >> > Randy Yates <ya...@ieee.org> writes:
>
> >> (...)
>
> >> > *http://www.mathworks.com/access/help...ixedpoint/inde...
>
> >> Here is a helpful websitehttp://tinyurl.com/.
>
> >>http://tinyurl.com/3lv43u
>
> >> --
> >> Mikolaj
>
> --
> % *Randy Yates * * * * * * * * *% "Maybe one day I'll feel her cold embrace,
> %% Fuquay-Varina, NC * * * * * *% * * * * * * * * * *and kiss her interface,
> %%% 919-577-9882 * * * * * * * *% * * * * * *til then, I'll leave her alone."
> %%%% <ya...@ieee.org> * * * * * % * * * *'Yours Truly, 2095', *Time*, ELO *http://www.digitalsignallabs.com