Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Electronic Equipment > Digital Signal Processing (DSP) > Re: Implementin...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 3 of 4 Topic 13256 of 14332
Post > Topic >>

Re: Implementing FFT on Microchip DSPIC

by "bwake" <pietrofili@[EMAIL PROTECTED] > Jul 30, 2008 at 04:18 AM

>Hi Filippo,
>It’s clear that you need to understand the DFT/FFT better, and I have
>provided some links below. Here are some ideas that might get you
started
>in the right direction.  
>
>If you want to look at the harmonics of 50 Hz, up to the 50th harmonic,
>you should probably sample at 50 Hz x 128 = 6,400 samples per second. 
This
>would require you to provide an anti-alias filter that p*****
frequencies
>up to 2,500 Hz (i.e., 50 Hz x 50), and blocks all frequencies above
3,200
>Hz (i.e., one-half the sampling rate).    
>
>Then, take the FFT with N=128, convert the output from rectangular to
>polar form, and discard the phase.  This will give you 65 data points,
>providing the amplitudes of the sinusoids: DC, 50Hz, 100 Hz, 150Hz, 200
Hz,
>... 3,200 Hz. 
>
>Good luck!
>Steve
>
>http://www.dspguide.com/ch3/2.htm
  
>http://www.dspguide.com/ch3/4.htm
>http://www.dspguide.com/ch8/2.htm
  and forward
>http://www.dspguide.com/ch12.htm
   and forward
>

Thanks for your precious help.
By now my code can acquire data, apply a hanning window and digital filter
the sequence as you suggested. I still have some questions, though.
When applying the windowing on the acquired signal I noticed that it is
better to have more than one period in the window to preserve the shape of
the waveform. Should I increase the number of samples and/or the sampling
frequency to preserve the frequency resolution?
Say, for example, that my original intent was to calculate a 256 points
FFT on one period of the signal. According to your suggestion I should
take
a sampling frequency Fs = 256 * 50 = 12800 S/s and with a FIR filter I
should block all frequencies above 6400 Hz. If I want to acquire a longer
sequence  with three or four periods in it, how should I change the
parameters?

Another question: I implemented the conversion to polar form by simply
applying the formula: Magx[i] = sqrt(pow(Rex[i],2)+pow(Imx[i],2)). I
expected the first sample to be the fundamental harmonic but I found that
the 50 Hz peak is on a further index of the array. Where I got wrong?

Thanks,
Filippo
 




 4 Posts in Topic:
Implementing FFT on Microchip DSPIC
"bwake" <pie  2008-06-29 08:35:43 
Re: Implementing FFT on Microchip DSPIC
"SteveSmith" &l  2008-06-29 14:10:51 
Re: Implementing FFT on Microchip DSPIC
"bwake" <pie  2008-07-30 04:18:56 
Re: Implementing FFT on Microchip DSPIC
stevepierson <gkicompu  2008-06-29 15:54:10 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Tue Dec 2 4:11:51 CST 2008.