CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

FFT for L3GD20 Gyro

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
eabir



Joined: 16 Aug 2010
Posts: 19

View user's profile Send private message

FFT for L3GD20 Gyro
PostPosted: Thu Mar 13, 2014 5:16 am     Reply with quote

Hello,

Assume using CCS fft.h :

I would like to sample an axis of the L3GD20 Gyro and output the fft result.

My question is: what is the sample rate Fs which i should use,(then i can calculate each frequency range for each bin by Fs/(2*N).)

In the L3GD20 datasheet there is 'ODR' = Digital output data rate, is it the Fs i'm looking for?

Thanks
RF_Developer



Joined: 07 Feb 2011
Posts: 839

View user's profile Send private message

PostPosted: Thu Mar 13, 2014 9:01 am     Reply with quote

Yes. With any device that samples data for you at a constant rate, it determines the sample rate. With any device that has an analogue signal that you sample in your own ADC, you decide what rate to sample at, but PICs are not very good at precise, regular sampling.

Also the sensor may sample all three axes simultaneously, which PICs can't do by themselves.

So, you have to set up the sensor to sample at the rate that best suits your application. The FFT range will be half the sample rate. By the looks of it, the sensor has the filters to avoid aliasing built-in, which is also something the PIC can't really do.

Most PICs are not well suited to FFT analysis, even more so with floating point FFTs. Nost have very limited data memory, are slow and have few adaptions for DSP work, such as single instruction 16bit multiply/accumulate, DMA for memory to memory data transfer, and flexible address stepping for interleaved data access such as required for FFTs, barrel shifter etc. Of course the dsPICs are targeted at such applications, and presumably should have such things. I don't know for sure as I've never used one.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group