This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: TMS320F28335
I am a newbie to TI's DSP. Working with TMS320F28335 to find Harmonics in 50 Hz signal and generate PWM accordingly. Tride example program _RFFT_ADC_RT in CCS6. Measured sampling period by toggling pin and it is coming 1.136 KHz(?). Also getting integer value in bin =258.221008.(?). The AC signal is shifted by 1.5 V DC and given to the ADC. If I plot waveform from the samples it is perfectly coming as a shifted sine wave.Need some suggestions what I am doing wrong?
Would it be possible to attach the graph plots of the sampled waveform and note what you expect vs what you are seeing?
Also, you mention you are measuring the ADC sample rate at 1.136kHz, is that what you expected or is this also incorrect?
Will look for your reply before suggesting the next step.
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
Attaching required details. FFT+TMS320F28335.docx
Dear Sir, here is the graph of input samples. I have toggled one of the I/O and measured time in ADC_ISR which I observed 0.886 msec for each samples.input sinewave.docx
In reply to Manish Girase:
I don't understand what you mean by "Measured sampling period by toggling pin ". Per the example project you reference, the ADC's sampling frequency is 48kHz. So unless you changed project settings, this should be the sampling frequency.
bin is the DC component of the signal in the spectral domain, so it will not have an obvious relationship to the DC offset of the input signal.
Think of the formula of the Discrete Fourier Transform. X(k) = Sigma n=0 to N-1 (x(n) exp(-j 2 pi k n / N)).
DC bin corresponds to X(0) = Sigma n=0 to N-1 (x(n)). Intuitively, you can see here that if you had a perfect sinusoid without a DC offset, this sum would be 0. With a DC offset, this sum would be the DC offset. However, that assumes there there are an exact number of sinusoidal cycles of the input within the FFT_SIZE chosen (N). This is true if the input frequency is an exact multiple of the FFT's spectral resolution, which is fs/2/N (where fs = sampling frequency).
So, assuming all the conditions above are met, then bin = DC offset. Then the question becomes, what is the DC offset? That has to do with the ADC range. So if you have a 12-bit ADC with values ranging from 0-4095, I believe a DC offset of 1.5V should correspond to 2048. Once again, this assumes 3V gets the ADC to saturate, and not 3.3V. You'll have to look at the ADC spec in our device datasheet to confirm this.
Let me know if this makes sense. Also, if you could, please try changing the FFT_SIZE and seeing if bin changes (and tracks FFT_SIZE in some way), or if it stays constant. This would be interesting to know. I don't expect it to change but if it does, I would need to dig into the library to find out why.
In reply to Sira Rao80:
Thank you Sira for your step by step explanation and guidance. After respective corrections in the program I got proper results. Please you can close this thread.
Good to know. Could you provide a brief explanation of what changes solved your problem, just so it provides the right context and closure to this thread?
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.