06.02.2013 Views

DSP Signal Generator Implementation On C6713 DSK - ComLab

DSP Signal Generator Implementation On C6713 DSK - ComLab

DSP Signal Generator Implementation On C6713 DSK - ComLab

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure 3.15: Shift register architecture with feedback for noise sequence generation<br />

If we want to analyze the effect of superimposed noise on some external input signal, it can<br />

accomplished by the altering the ISR (line 13 and14) as shown in figure 3.16.<br />

1. interrupt void c_int11() //interrupt service routine<br />

2. {<br />

3. short prnseq; //for pseudo-random sequence<br />

4. sample_data = input_sample(); //input sample<br />

5. if(sreg.bt.b0) //sequence{1,-1}based on bit b0<br />

6. prnseq = -300; //scaled negative noise level<br />

7. else<br />

8. prnseq = 300; //scaled positive noise level<br />

9. fb =(sreg.bt.b0)^(sreg.bt.b1); //XOR bits 0,1<br />

10. fb ^=(sreg.bt.b11)^(sreg.bt.b13);//with bits 11,13 ->fb<br />

11. sreg.regval

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!