Digital Signal Processing Reference
In-Depth Information
Build and run this project as sin1500MATL . Verify that the output is a 1500-Hz
sine-wave signal. Within CCS, be careful when you view the header file sin1500.h
so as not to truncate it.
Example 2.14: Amplitude Modulation ( AM )
This example illustrates an amplitude modulation (AM) scheme. Figure 2.23 shows
a listing of the program AM.c , which generates an AM signal. The buffer baseband
contains 20 points and represents a baseband cosine signal with a frequency of
f
400 Hz. The buffer carrier also contains 20 points and represents a
carrier signal with a frequency of f
=
F s /20
=
=
F s (number of cycles)/(number of points)
=
F s /(number points per cycle)
2 kHz. The output equation shows the baseband
signal being modulated by the carrier signal. The variable amp is used to vary the
modulation. The polling-driven C source program AM.c implements this project.
Build and implement this project as AM . Verify that the output consists of the
2-kHz carrier signal and two sideband signals. The sideband signals are at the fre-
quency of the carrier signal
=
+
or
-
the frequency of the sideband signal, or at 1600
and 2400 Hz.
Load the GEL file AM.gel , increase the variable amp , and verify the baseband
signal being modulated (modulation index controlled by amp ,). Note that the
// AM.c AM using table for carrier and baseband signals
#include "DSK6713_AIC23.h"
//codec-dsk support file
Uint32 fs=DSK6713_AIC23_FREQ_8KHZ;
//set sampling rate
short amp = 1;
//index for modulation
void main()
{
short baseband[20]={1000,951,809,587,309,0,-309,-587,-809,-951,
-1000,-951,-809,-587,-309,0,309,587,809,951};//400Hz baseband
short carrier[20] ={1000,0,-1000,0,1000,0,-1000,0,1000,0,
-1000,0,1000,0,-1000,0,1000,0,-1000,0}; //2kHz carrier
short output[20];
short k;
comm_poll(); //init DSK, codec, McBSP
while(1) //infinite loop
{
for (k=0; k<20; k++)
{
output[k]= carrier[k] + ((amp*baseband[k]*carrier[k]/10)>>12);
output_sample(20*output[k]); //scale output
}
}
}
FIGURE 2.23. Amplitude modulation program ( AM.c ).
Search WWH ::




Custom Search