DSPRelated.com
Forums

FFT in BF-563

Started by Yame Asfia May 31, 2010
Dear AllI am having problem with the built in routine of cfft in BF-563 It aint producing the correct results. I checked the result by taking the ifft but the input and output arnt matching. Plz Help me ...
ThanksYame Asfia
Howdy Yame,

To debug you have to first find where the bug is. Can you isolate the
subroutine and feed it a pure sine wave of test data? If it's built in,
chances are good it's been debuged and feeding it a pure tone should give
a good pure output. Once you figure out the order of all the input data
to ensure the routine works correctly on a pure tone, you can begin to
add some of your own test data. Then put that code into your program.

There are lots of pointers that can get screwed up. By starting simple
you can find out which ones are most likely wrong.

Patience, persistence, truth,
Dr. mike

On Mon, 31 May 2010, Yame Asfia wrote:

> Dear AllI am having problem with the built in routine of cfft in BF-563 It aint producing the correct results. I checked the result by taking the ifft but the input and output arnt matching. Plz Help me ...
> ThanksYame Asfia
Hi,
Did you check what data type that it takes as input and gives as output?
I guess it has to fract16 format and not floating pt.
If it is fract16, you have to manually convert from floating pt to fract16
before you feed in as the input. For the conversion there is a library
available "flt2fr.h". And one more thing, the ifft output wont exactly match
with the fft input, rather the ifft output will be a scaled version of fft
input.
On Tue, Jun 1, 2010 at 2:45 AM, Mike Rosing wrote:

> Howdy Yame,
>
> To debug you have to first find where the bug is. Can you isolate the
> subroutine and feed it a pure sine wave of test data? If it's built in,
> chances are good it's been debuged and feeding it a pure tone should give
> a good pure output. Once you figure out the order of all the input data
> to ensure the routine works correctly on a pure tone, you can begin to
> add some of your own test data. Then put that code into your program.
>
> There are lots of pointers that can get screwed up. By starting simple
> you can find out which ones are most likely wrong.
>
> Patience, persistence, truth,
> Dr. mike
>
> On Mon, 31 May 2010, Yame Asfia wrote:
>
> > Dear AllI am having problem with the built in routine of cfft in BF-563
> It aint producing the correct results. I checked the result by taking the
> ifft but the input and output arnt matching. Plz Help me ...
> > ThanksYame Asfia
> >
> >
Dear Mike and Yegnesh
First of all thank you so much for your replies
Actually i have tried all what you guys r mentioning. Well!! I am attaching a test code here. Il be really obliged if u cud kindly have a look into it

Regards
Yame Asfia

________________________________
From: Mike Rosing
To: Yame Asfia
Cc: a...
Sent: Tuesday, June 1, 2010 2:15:16
Subject: Re: [adsp] FFT in BF-563

Howdy Yame,

To debug you have to first find where the bug is. Can you isolate the
subroutine and feed it a pure sine wave of test data? If it's built in,
chances are good it's been debuged and feeding it a pure tone should give
a good pure output. Once you figure out the order of all the input data
to ensure the routine works correctly on a pure tone, you can begin to
add some of your own test data. Then put that code into your program.

There are lots of pointers that can get screwed up. By starting simple
you can find out which ones are most likely wrong.

Patience, persistence, truth,
Dr. mike

On Mon, 31 May 2010, Yame Asfia wrote:

> Dear AllI am having problem with the built in routine of cfft in BF-563 It aint producing the correct results. I checked the result by taking the ifft but the input and output arnt matching. Plz Help me ...
> ThanksYame Asfia
Dear Yame,

The first thing that you need to check up is whether the function you are using for cfft and ifft have so many parameters.
Whatever function used in BF561 has only these parameters.

void cfft_fr16( const complex_fract16 input[],
const complex_fract16 output[],
const complex_fract16 twiddle_table[],
int fft_size,
int *block_exponent,
int scale_method);
Similar are the parameters for ifft function also.

You just need to change the function parameters and also try dynamic scaling on on the cftt function.

You can just declare a variable as blk_exp and use it for sendind as block_exponent. For the current scenario it is not that important.

Try varying the scaling methods and and find out a suitable value.

If still the problem exists, I will sned you the working code.
--- In a..., Yame Asfia wrote:
>
> Dear Mike and Yegnesh
> First of all thank you so much for your replies
> Actually i have tried all what you guys r mentioning. Well!! I am attaching a test code here. Il be really obliged if u cud kindly have a look into it
>
> Regards
> Yame Asfia
>
> ________________________________
> From: Mike Rosing
> To: Yame Asfia
> Cc: a...
> Sent: Tuesday, June 1, 2010 2:15:16
> Subject: Re: [adsp] FFT in BF-563
>
>
> Howdy Yame,
>
> To debug you have to first find where the bug is. Can you isolate the
> subroutine and feed it a pure sine wave of test data? If it's built in,
> chances are good it's been debuged and feeding it a pure tone should give
> a good pure output. Once you figure out the order of all the input data
> to ensure the routine works correctly on a pure tone, you can begin to
> add some of your own test data. Then put that code into your program.
>
> There are lots of pointers that can get screwed up. By starting simple
> you can find out which ones are most likely wrong.
>
> Patience, persistence, truth,
> Dr. mike
>
> On Mon, 31 May 2010, Yame Asfia wrote:
>
> > Dear AllI am having problem with the built in routine of cfft in BF-563 It aint producing the correct results. I checked the result by taking the ifft but the input and output arnt matching. Plz Help me ...
> > ThanksYame Asfia
> >
>
Dear AllI am having problem with the built in routine of cfft in BF-563 It aint producing the correct results. I checked the result by taking the ifft but the input and output arnt matching. Plz Help me ...
>ThanksYame Asfia
>

Dear Yame,

The first thing that you need to check up is whether the function you are using for cfft and ifft have so many parameters.
Whatever function used in BF561 has only these parameters.

void cfft_fr16( const complex_fract16 input[],
const complex_fract16 output[],
const complex_fract16 twiddle_table[],
int fft_size,
int *block_exponent,
int scale_method);
Similar are the parameters for ifft function also.

You just need to change the function parameters and also try dynamic scaling on on the cftt function.

You can just declare a variable as blk_exp and use it for sendind as block_exponent. For the current scenario it is not that important.

Try varying the scaling methods and and find out a suitable value.

If still the problem exists, I will sned you the working code.
On Mon, 31 May 2010, Yame Asfia wrote:

> Dear Mike and Yegnesh
> First of all thank you so much for your replies
> Actually i have tried all what you guys r mentioning. Well!! I am
>attaching a test code here. Il be really obliged if u cud kindly have a
>look into it

Howdy Yame,

First thing to try is to change your "in" test block to a simple ramp,
and don't use the value 1. That is usually saturation, and the algorithm
won't work. Go from 0.0 to 0.5 in 16 steps and see what happens.

Patience, persistence, truth,
Dr. mike