DSPRelated.com
Forums

Iinput with c6713

Started by sham...@yahoo.co.uk February 10, 2010
hi everybody,
i am having a problem when i am trying to input a pseudorandom sequence generated by the dsk itself, to a physical system and then output it. I am doing an identification of a physical system in real time.
Can anybody please help me,please...
infact, i am not sure if i have correctly written the code for this part.
part of my code:

int dly_fix[N+1]; //buffer samples of fixed UNKNOWN SYSTEM
/
/this part contains the code for my pseudorandom sequence generation
/
/

interrupt void c_int11() //ISR
{
int i;
int SYSTEM_out = 0; //init output of fixed UNKNOWN SYSTEM

for (i = 0; i < 60; i++)
{
dly_fix[i]) = prand(); //input noise to fixed UNKNOWN SYSTEM
SYSTEM_out = dly_fix[i];
dly_fix[i+1] = dly_fix[i]; //update samples
output_sample((short)SYSTEM_out ); //output of fixed UNKNOWN SYSTEM
return;
}

_____________________________________
sjameems,

The book by Rulph Chassaing has a complete working example of system identification.
You should be easily able to tweak it for your specific project.

BTW:
since ALL that is being done, irregardless of the intervening code, is
--at each interrupt event (what is driving the interrupt?)
--repeat the following two lines 60 times
--take self generated random sample
--output the random sample.

Due to the code, there is no delay being implemented.

'N' has to be 60 or higher or the code will be writing into memory past the end of the dly_fix[] array.

the code inside the loop is actually doing the following:
SYSTEM_out= prand(); //input noise to fixed UNKNOWN SYSTEM
output_sample((short)SYSTEM_out ); //output of fixed UNKNOWN SYSTEM

The setting/shifting of the dly_fix[] array values has no effect except to burn up cpu cycles.

The dly_fix[] array could be used in some other code, outside of the interrupt handler. However, that is not indicated in the code/comments.

The contents of the dly_fix[] array after one interrupt processing will be:
0 =1st prand() result
1 =2nd prand() result
2 =3rd prand() result
3 =4th prand() result
4 =5th prand() result.
...
59Yth prand() result
60Yth prand() result

Note:
most delay arrays used for system identification are a power of 2 or 4 in size
because the fourier transform (and related) algorithms require it.

R. Williams

---------- Original Message -----------
From: s...@yahoo.co.uk
To: c...
Sent: Tue, 09 Feb 2010 23:34:15 -0500
Subject: [c6x] Iinput with c6713

>
>
> hi everybody,
> i am having a problem when i am trying to input a pseudorandom sequence generated by the dsk itself, to a physical system and then output it. I am doing an identification of a physical system in real time.
> Can anybody please help me,please...
> infact, i am not sure if i have correctly written the code for this part.
> part of my code:
>
> int dly_fix[N+1]; //buffer samples of fixed UNKNOWN SYSTEM
> /
> /this part contains the code for my pseudorandom sequence generation
> /
> /
>
> interrupt void c_int11() //ISR
> {
> int i;
> int SYSTEM_out = 0; //init output of fixed UNKNOWN SYSTEM
>
> for (i = 0; i < 60; i++)
> {
> dly_fix[i]) = prand(); //input noise to fixed UNKNOWN SYSTEM
> SYSTEM_out = dly_fix[i];
> dly_fix[i+1] = dly_fix[i]; //update samples
> output_sample((short)SYSTEM_out ); //output of fixed UNKNOWN SYSTEM
> return;
> }