DSP FIR filter component coefficients

For general Flowcode discussion that does not belong in the other sections.
Oscar_T
Posts: 89
http://meble-kuchenne.info.pl
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Re: DSP FIR filter component coefficients

Post by Oscar_T »

Hi

I can't compile the program correctly, it gives me the following errors

"
../main/esp-project.c: In function 'FCD_0c101_Ref1__Prv_GetConsole':
../main/esp-project.c:497:25: error: 'FCL_DATA[<unknown>]' is used uninitialized in this function [-Werror=uninitialized]
FCR_RETVAL = FCL_DATA[FCL_BYTE] | (FCL_DATA[FCL_BYTE + 1] << 8);
~~~~~~~~^~~~~~~~~~
../main/esp-project.c:497:47: error: 'FCL_DATA[<unknown>]' is used uninitialized in this function [-Werror=uninitialized]
FCR_RETVAL = FCL_DATA[FCL_BYTE] | (FCL_DATA[FCL_BYTE + 1] << 8);
~~~~~~~~^~~~~~~~~~~~~~
../main/esp-project.c: In function 'FCD_09991_Buff1__Prv_GetConsole':
../main/esp-project.c:1141:25: error: 'FCL_DATA[<unknown>]' is used uninitialized in this function [-Werror=uninitialized]

^
../main/esp-project.c:1141:47: error: 'FCL_DATA[<unknown>]' is used uninitialized in this function [-Werror=uninitialized]

^
../main/esp-project.c: In function 'FCD_0c101_Ref1__Prv_PutPropStr':
../main/esp-project.c:247:16: error: 'FCL_RDSTR[<unknown>]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (FCL_RDSTR[FCL_RDIDX] == ',')
~~~~~~~~~^~~~~~~~~~~
../main/esp-project.c: In function 'FCD_0c101_Ref1__Prv_GetPropStr':
../main/esp-project.c:410:16: error: 'FCL_RDSTR[<unknown>]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (FCL_RDSTR[FCL_RDIDX] == ',')
~~~~~~~~~^~~~~~~~~~~
../main/esp-project.c:429:16: error: 'FCL_RDSTR[<unknown>]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
if (FCL_RDSTR[FCL_RDIDX] == ',')
~~~~~~~~~^~~~~~~~~~~
../main/esp-project.c: In function 'FCD_09991_Buff1__Prv_PutPropStr':
../main/esp-project.c:884:16: error: 'FCL_RDSTR[<unknown>]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
// } else {
~~~~~~~ ^
../main/esp-project.c: In function 'FCD_09991_Buff1__Prv_GetPropStr':
../main/esp-project.c:1054:16: error: 'FCL_RDSTR[<unknown>]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
// } else {
~~~~~~~ ^
../main/esp-project.c:1073:16: error: 'FCL_RDSTR[<unknown>]' may be used uninitialized in this function [-Werror=maybe-uninitialized]
} else {
~~~~ ^
"
instead if I remove the dsp components everything is ok

Oscar_T
Posts: 89
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Re: DSP FIR filter component coefficients

Post by Oscar_T »

Hi Ben

Did you find out why it can't compile when I insert the dspwavegenerator?

Regards

BenR
Matrix Staff
Posts: 1926
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 686 times

Re: DSP FIR filter component coefficients

Post by BenR »

Hi Oscar,

Yes I've found the cause of the problem now and am on with fixing it.

Edit, should be fixed for you now ;)

Oscar_T
Posts: 89
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Re: DSP FIR filter component coefficients

Post by Oscar_T »

Hi Ben

Hi, I would like to dedicate this week to debugging the interface to try to make it work. Now I am able to compile everything correctly but the i2s port does not work. I have a logic analyzer to see what the i2s port is pulling out.

The settings are as follows
FS 48Khz
16 bit
Stereo

I will not select other modes because I have seen anomalous behavior with some configurations so I will focus on this which is still very common the clocks, as mentioned some posts before are ok.

Next to the esp32 I have my dsp with which I can generate the signals and compare them. For example, if with my dsp I generate all 0's on the output signal, actually with the logic analyzer I display all 0's.

Instead with esp32 I set all the buffer to 0 in output I have values ​​other than 0

BenR
Matrix Staff
Posts: 1926
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 686 times

Re: DSP FIR filter component coefficients

Post by BenR »

Hi Oscar,

Brlliant hopefully together we can make this work correctly. Can you post your latest project so I can see exactly what you're doing and I'll have a play here and see if I can make sense of it. My logic analyser can parse I2S data so I'll try with that.

Oscar_T
Posts: 89
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Re: DSP FIR filter component coefficients

Post by Oscar_T »

Hi Ben

I am attaching both the program and an excel table of the logic analyzer
Attachments
esp32_i2s.xlsx
(20.99 KiB) Downloaded 618 times
esp32_I2S_Sine.fcfx
(8.89 KiB) Downloaded 576 times

BenR
Matrix Staff
Posts: 1926
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 686 times

Re: DSP FIR filter component coefficients

Post by BenR »

Thanks Oscar,

Just noticed in your code you are likely leaving AUDIO_BUFFER_1[0] uninitialised and probably overflowing the bounds of the buffer too.

AUDIO_BUFFER_1[a+1] = 0

should instead be.

AUDIO_BUFFER_1[a] = 0

Testing on hardware now to see what I get here.

Oscar_T
Posts: 89
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Re: DSP FIR filter component coefficients

Post by Oscar_T »

Hi Ben

Sorry for the stupid mistake!!! I have compiled again but continue to get values ​​other than 0 on the i2s signal

BenR
Matrix Staff
Posts: 1926
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 501 times
Been thanked: 686 times

Re: DSP FIR filter component coefficients

Post by BenR »

Yes there's something certainly up I cansee there is lots of random data appearing, not the data that is being written.

I'll keep playing with it and see if I can find a way to tame it.

Oscar_T
Posts: 89
Joined: Wed Dec 02, 2020 10:06 am
Location: Italy
Has thanked: 37 times
Been thanked: 10 times

Re: DSP FIR filter component coefficients

Post by Oscar_T »

ok

How are these parameters set by the driver?
channel_format = I2S_CHANNEL_FMT_RIGHT_LEFT,
.communication_format = I2S_COMM_FORMAT_I2S | I2S_COMM_FORMAT_I2S_MSB.

Because these parameters must also be set in order to communicate in I2S standard.

I don't know if this rtos based example can help you https://github.com/SuperHouse/esp-open- ... _example.c

Post Reply