Maxime Guyon
2016-06-16 17:12:04 UTC
Hello,
I've tested the Codec2 on a TIVA TM4C129 which is a TexasInstrument
CORTEX-M4F cadenced at 120MHz.
I checkedout the 0.5 TAG version on SVN and take the configuration of your
STM32 (running codec at CODEC2_MODE_1300)
It looks like that FPU is enabled on my device.
I've tested with maximum optimization O3 and also O4 and optimize speed.
Here are my profilling code which only add IO toggle on "c2demo.c" file
example available in src folder
The file input is "hts1a.wav"
I only added IO toggling for capturing time encoding and decoding:
* while(fread(buf, sizeof(short), nsam, fin) == (size_t)nsam) {*
-Encoding time is between *25ms *and* 42ms*
-Decoding time is between *39ms *and *56ms*
Example seem to read buffer of 320 sample, so if I take the worst case for
each functions:
-Encoding : 320 sample are encoded in 42ms so in 1second I can encode
7619samples.
-Decoding: 320 sample are decoded in 56ms so in 1second I can encode
5714samples.
So as you can see I'm not able to do realtime encoding and decoding since I
need to be able to encode at least 8000sample for do real time things (8KHz
sampling rate)
Do you have any suggestion/hint about this?
What is your encoding and decoding time on your STM32F4 board running at
168MHz?
Regards,
Max
I've tested the Codec2 on a TIVA TM4C129 which is a TexasInstrument
CORTEX-M4F cadenced at 120MHz.
I checkedout the 0.5 TAG version on SVN and take the configuration of your
STM32 (running codec at CODEC2_MODE_1300)
It looks like that FPU is enabled on my device.
I've tested with maximum optimization O3 and also O4 and optimize speed.
Here are my profilling code which only add IO toggle on "c2demo.c" file
example available in src folder
The file input is "hts1a.wav"
I only added IO toggling for capturing time encoding and decoding:
* while(fread(buf, sizeof(short), nsam, fin) == (size_t)nsam) {*
* GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_4, GPIO_PIN_4);*
* codec2_encode(codec2, bits, buf);** GPIOPinWrite(GPIO_PORTF_BASE,
GPIO_PIN_4, 0);*
* GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_5, GPIO_PIN_5);*
* codec2_decode(codec2, buf, bits);** GPIOPinWrite(GPIO_PORTF_BASE,
GPIO_PIN_5, 0);*
* fwrite(buf, sizeof(short), nsam, fout);** }*
On my scope I've read the time for IO to toggle and here are my result:* codec2_encode(codec2, bits, buf);** GPIOPinWrite(GPIO_PORTF_BASE,
GPIO_PIN_4, 0);*
* GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_5, GPIO_PIN_5);*
* codec2_decode(codec2, buf, bits);** GPIOPinWrite(GPIO_PORTF_BASE,
GPIO_PIN_5, 0);*
* fwrite(buf, sizeof(short), nsam, fout);** }*
-Encoding time is between *25ms *and* 42ms*
-Decoding time is between *39ms *and *56ms*
Example seem to read buffer of 320 sample, so if I take the worst case for
each functions:
-Encoding : 320 sample are encoded in 42ms so in 1second I can encode
7619samples.
-Decoding: 320 sample are decoded in 56ms so in 1second I can encode
5714samples.
So as you can see I'm not able to do realtime encoding and decoding since I
need to be able to encode at least 8000sample for do real time things (8KHz
sampling rate)
Do you have any suggestion/hint about this?
What is your encoding and decoding time on your STM32F4 board running at
168MHz?
Regards,
Max