Code
Code
h>
#include "..\h\WM8510CodecDrv.h"
#include "..\h\sask.h"
#include <dsp.h>
#include <libpic30.h>
#define LOG2_BLOCK_LENGTH 7
#define FFT_BLOCK_LENGTH 128
#define IFFT_BLOCK_LENGTH 128
#define FRAME_SIZE 128 /* Each audio frame will
have these many samples */
int main(void)
{
/* Configure Oscillator to operate the device at 40MHz.
* Fosc= Fin*M/(N1*N2), Fcy=Fosc/2
* Fosc= 7.37M*40/(2*2)=80Mhz for 7.37M input clock */
PLLFBD=41; /* M=39 */
CLKDIVbits.PLLPOST=0; /* N1=2 */
CLKDIVbits.PLLPRE=0; /* N2=2 */
OSCTUN=0;
while(1)
{
int i = 0;
VectorWindow(FFT_BLOCK_LENGTH,&fft_input[FFT_BLOCK_LENGTH].real,&fft_input[FFT_BLOC
K_LENGTH].real,(fractional*)&window[0]);