DSPRelated.com
Forums

DSPF_sp_fir_gen???

Started by asim...@yahoo.de May 19, 2010
Hi everyone,

i've got a little problem here with the DSP Library Function "DSPF_sp_fir_gen" from TI. I am using the DSK6713 board. Here is the function prototype:

void DSPF_sp_fir_gen(const float *x, const float *h, float * restrict r
int nh, int nr)

I buffer some input samples into x and use filt coeff generated in matlab for h. Both are declared as "const float" but when i try to build i get an error that these values have to be set as const values!. So,

Q1: Can i actually declare "x" as const, eventhough they arent known at the time when i build , since x is first buffered with the function "input_sample()".

Q2: Why needs the function const values? I mean what if i want to filter some input in realtime? Then the input changes every sampling instance.

Br,

Burak

_____________________________________
asim,

You can declare pointers as constant without declaring the object pointed to as constant.
Mostly, it depends on where the 'const' modifier is placed in the declaration.

You might declare a couple of pointers as constant, and
set them to point to the actual arrays in the declaration.
Then pass those 'const' pointers to the function.

A few minutes of experimentation should reveal the correct syntax.

R. Williams

---------- Original Message -----------
From: a...@yahoo.de
To: c...
Sent: Wed, 19 May 2010 04:46:28 -0400
Subject: [c6x] DSPF_sp_fir_gen???

>
>
> Hi everyone,
>
> i've got a little problem here with the DSP Library Function "DSPF_sp_fir_gen" from TI. I am using the DSK6713 board. Here is the function prototype:
>
> void DSPF_sp_fir_gen(const float *x, const float *h, float * restrict r
> int nh, int nr)
>
> I buffer some input samples into x and use filt coeff generated in matlab for h. Both are declared as "const float" but when i try to build i get an error that these values have to be set as const values!. So,
>
> Q1: Can i actually declare "x" as const, eventhough they arent known at the time when i build , since x is first buffered with the function "input_sample()".
>
> Q2: Why needs the function const values? I mean what if i want to filter some input in realtime? Then the input changes every sampling instance.
>
> Br,
>
> Burak
------- End of Original Message -------
Hi,

thank u for ur answer. I understand what u mean. I will try to use some input pointers. I used as input to the function just the array name (as the name of the array points to the first element) and not some additional declared pointers.

br,

Burak

Hi everyone,
>
>i've got a little problem here with the DSP Library Function "DSPF_sp_fir_gen" from TI. I am using the DSK6713 board. Here is the function prototype:
>
>void DSPF_sp_fir_gen(const float *x, const float *h, float * restrict r
> int nh, int nr)
>
>I buffer some input samples into x and use filt coeff generated in matlab for h. Both are declared as "const float" but when i try to build i get an error that these values have to be set as const values!. So,
>
>Q1: Can i actually declare "x" as const, eventhough they arent known at the time when i build , since x is first buffered with the function "input_sample()".
>
>Q2: Why needs the function const values? I mean what if i want to filter some input in realtime? Then the input changes every sampling instance.
>
>Br,
>
>Burak
>
>_____________________________________

_____________________________________