Digital Signal Processing Reference
In-Depth Information
// sin8_phase_shift.c Sine generation. Illustrates phase shift
#include "dsk6713_aic23.h" //codec-DSK support file
Uint32 fs=DSK6713_AIC23_FREQ_8KHZ; //set sampling rate
short loop = 0;
short sine_table[8]={0,707,1000,707,0,-707,-1000,-707};//sine values
short phase_change_idx = 0;
interrupt void c_int11() //interrupt service routine
{
output_sample(sine_table[loop]);
if (loop < 7) ++loop; //reinit index loop
else loop = 0;
if (phase_change_idx++ >= 50*8) //phase shift every 50 periods
{
if (loop == 7) loop = 0; //skip a value
else loop++;
phase_change_idx = 0;
}
return;
}
void main()
{
comm_intr(); while(1);
//init DSK/infinite loop
}
FIGURE 10.27. C program that generates a sine wave with eight unique phase shifts
( sine8_phase_shift.c ).
FIGURE 10.28. DSK output of a generated 1-kHz sine wave with a varying phase.
further adjust the indexing through the sine values to create a phase shift
showing four (or two) different amplitude values.
Figure 10.30 b shows a CCS plot of the PLL output buffer that receives only
one period of the sine wave. Use a starting address of r_symbol , an acquisi-
tion and display size of 16, and a 16-bit signed integer (not a 32-bit float, as
for phiBuf ).
Search WWH ::




Custom Search