DSPRelated.com
Forums

DSP/BIOS Float[] Vs float[]

Started by rockall_rebel January 26, 2004
Hi all,

I'm new to the C6711DSK and have a question regarding DSP/BIOS data
types. I'm outputting a 100Hz sin wave from my 88.2kHz DAC. To
produce this signal, I've filled a buffer of size 882, as follows -

Float sig[100];

Void main()
{
Int i;

for(i=0;i<882;i++)
sig[i] = cos(2*PI*100*i/(Float)(SR));

McBSP_Init();
EDMA_Init();

return;
}

With this code I get a load of about 70%, but when I change my
declaration to -

float sig[882];

and change nothing else, the load drops to 15% or so. Why is this?

I've also noticed that if I set the frequency of the output signal to
400Hz, with the same buffer size, my output has a slight distortion.
This glitch appears as if one of the samples is being outputted
incorrectly for every cycle of the signal. Its as if, a value is
being writen to the sig buffer which shouldn't be there. This glitch
occurs if I declare sig as -

float sig[100];

but disappears if I use -

Float sig[100];

If I declare the following -

float sig1[100]; //not used
float sig[100];

the glitch again disappears. When should I use DSP/BIOS data types
and when should I not?

I plan to write a PC application which allows the user to specify the
frequency they wish to output. To do this I was going to create a
memory segment of size 882, at base 0x20. I have the DSP set for 3
way cache. The PC would then write in the samples to this buffer for
outputting. The available frequencies would be multiples of 100Hz. Is
this the best approach?

Thanks,

Fran.




Rockall-

There is a lot work in your e-mail explanation so maybe I'm missing something by
asking this, but why would u ever declare the size of sig[] to be less than 882,
if
your loop length is always 882?

-Jeff > I'm new to the C6711DSK and have a question regarding DSP/BIOS data
> types. I'm outputting a 100Hz sin wave from my 88.2kHz DAC. To
> produce this signal, I've filled a buffer of size 882, as follows -
>
> Float sig[100];
>
> Void main()
> {
> Int i;
>
> for(i=0;i<882;i++)
> sig[i] = cos(2*PI*100*i/(Float)(SR));
>
> McBSP_Init();
> EDMA_Init();
>
> return;
> }
>
> With this code I get a load of about 70%, but when I change my
> declaration to -
>
> float sig[882];
>
> and change nothing else, the load drops to 15% or so. Why is this?
>
> I've also noticed that if I set the frequency of the output signal to
> 400Hz, with the same buffer size, my output has a slight distortion.
> This glitch appears as if one of the samples is being outputted
> incorrectly for every cycle of the signal. Its as if, a value is
> being writen to the sig buffer which shouldn't be there. This glitch
> occurs if I declare sig as -
>
> float sig[100];
>
> but disappears if I use -
>
> Float sig[100];
>
> If I declare the following -
>
> float sig1[100]; //not used
> float sig[100];
>
> the glitch again disappears. When should I use DSP/BIOS data types
> and when should I not?
>
> I plan to write a PC application which allows the user to specify the
> frequency they wish to output. To do this I was going to create a
> memory segment of size 882, at base 0x20. I have the DSP set for 3
> way cache. The PC would then write in the samples to this buffer for
> outputting. The available frequencies would be multiples of 100Hz. Is
> this the best approach?
>
> Thanks,
>
> Fran.
>
> _____________________________________
> Note: If you do a simple "reply" with your email client, only the author of
this message will receive your answer. You need to do a "reply all" if you want
your answer to be distributed to the entire group.
>
> _____________________________________
> About this discussion group:
>
> To Join: Send an email to
>
> To Post: Send an email to
>
> To Leave: Send an email to
>
> Archives: http://www.yahoogroups.com/group/c6x
>
> Other Groups: http://www.dsprelated.com >