Professional Documents
Culture Documents
Bai 8
Bai 8
TP.HCM – 2022
1. Phân tích giải thuật chương trình chính (lab_2)
//Sine8_LED.c Sine generation with DIP switch control
#include "dsk6416_aic23.h" //support file for codec,DSK
Uint32 fs = DSK6416_AIC23_FREQ_8KHZ;//set sampling rate
short loop = 0;
short i=0; //table index
short gain = 10; //gain factor
short sine_table[8]={0,707,1000,707,0,-707,-1000,-707};//sine values
#define BUFFSIZE 128
// Global Variables
short gBuffer[BUFFSIZE];
void main()
{
//comm_poll(); //init DSK,codec,McBSP
c6416_dsk_init(); //khoi tao DSK,codec,McBSP
phổ:
tần số 4kHz
sóng sin:
Phổ:
5. Giữ nguyên khai báo Uint32 fs =DSK6416_AIC23_FREQ_48KHZ , thay đổi Sampling rate trong FFT
magnitude của cửa sổ Graphic bằng 16000, xem phổ, và nhận xét