Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Waveform Generation Using TMS320C6745 DSP

2,095 views

Published on

Waveform Generation Using TMS320C6745 DSP

Published in: Education
  • Be the first to comment

Waveform Generation Using TMS320C6745 DSP

  1. 1. Waveform Generation Using TMS320C6745 DSP https://www.pantechsolutions.net/products/dsp- dsc-boards/tms320c6745-tyro
  2. 2. Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. List Of Waveforms • Sine Wave • Square Wave • Triangular Wave • Saw tooth Wave
  3. 3. Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Program for Sine Wave Generation #include<stdio.h> #include<math.h> #define PI 3.14 void main() { const float sampf = 1024000.0;// Sampling frquency is fixed const int inpf = 4000; // change the input frquency from 1khz to 8khz(1000 to 8000) float sampt; double teta; short value,*sinout; int i,count,nsamp,value1; sinout = (short *)0xc0000000; sampt = 1/sampf; nsamp = sampf/inpf; for(i=0;i<400;i++) *(sinout+i)=0; for(count=0;count<nsamp;count++) { teta = (2 * PI * inpf * sampt * count); value = sin(teta)*1024; value1 = value&0x0000FFFF; *sinout++ = value1; } }
  4. 4. Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Plot Settings for Sine Wave
  5. 5. Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Program for Square Wave Generation #include <stdio.h> #include <math.h> void main() { int *Square; int i; Square = (int *)0xC0000000; while(1) { for(i=0;i<50;i++) { *Square++ = 0x0000FFFF; } for(i=0;i<50;i++) { *Square++ = 0x0; } } }
  6. 6. Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Plot Settings for Square Wave
  7. 7. Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Program for Triangular Wave Generation #include <stdio.h> #include <math.h> void main() { int *Triangle; int i=0,j=0; Triangle = (int *)0xC0000000; while(1) { for(i=0;i<50;i++) { j=j+1; *Triangle++ = j; } for(i=50;i>0;i--) { j=j-1; *Triangle++ = j; } } }
  8. 8. Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Plot Settings for Triangular Wave
  9. 9. Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Program for Saw tooth Wave Generation #include <stdio.h> #include <math.h> void main() { int *Sawtooth; int i=0,j=0; Sawtooth = (int *)0xC0000000; while(1) { for(i=0;i<100;i++) { j=j+1; *Sawtooth++ = j; } j=0; i=0; *Sawtooth++ = j; } }
  10. 10. Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Plot Settings for Saw tooth Wave
  11. 11. Technology beyond the Dreams™ Copyright © 2014 Pantech Prolabs India Pvt Ltd. Thank You

×