[PIC] FFT input format for dsPIC30F

Status
Not open for further replies.

helmi_mjd

Member level 2
Joined
Feb 20, 2011
Messages
45
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Visit site
Activity points
1,668
Hi! I have one question about reading ADC value as FFT input. I'm using dspIC30F. I found the following definition of the FFT input as given by the Microchip CE018 example.

Code:
extern fractcomplex sigCmpx[NUMSAMP] 				 
__attribute__ ((section (".ydata, data, ymemory"),aligned (NUMSAMP * 2 *2)))

I'm not understand this part. I would like to read ADC value into this array, how could I do that?

Thanks in advance
 

it is some years since I used this but I seem to remember copying the ADC data into the .real component and zeroing the .imag component of the input arrays
 

it is some years since I used this but I seem to remember copying the ADC data into the .real component and zeroing the .imag component of the input arrays

Thanks for your reply. I have the following code, is this what you refer to?

Code:
//Acquire signal from ADC pin replace real part  
	//with ADC value, set imiginary part as 0	
        for (i=0;i<NUMSAMP;i++) {
	     sigCmpx[i].real = inputSignal[i];					
	     sigCmpx[i].imag = 0;							
	}
 

yes, I assume this is sample code from one of Microchip's application notes
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…