Search found 117 matches

by v923z
Thu Oct 03, 2019 10:11 am
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 62
Views: 6189

Re: FFT speed

Peter, On the other hand, the assembly code worked with 16-bit integers, didn't it? Which in itself is not necessarily a drawback, given that the results of the ADC are also integers. That was a very old version. It used 32 bit integers, and dated to a time when the inline assembler didn't support f...
by v923z
Wed Oct 02, 2019 1:35 pm
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 62
Views: 6189

Re: FFT speed

I'm astounded by these figures. I've just run my assembler solution on Pyboard D at 214MHz. A 1K DFT takes 3.5ms (on SF2W or SF6W). I never pretended my code was optimised, but the fact that a modern compiler running the same algorithm beats it by a factor of four is a revelation. Peter, @chuckbook...
by v923z
Thu Sep 26, 2019 5:39 pm
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 62
Views: 6189

Re: ulab, or what you will - numpy on bare metal

I think stijn's suggestion with the macros is going to be OK. Especially useful was the observation that the for loop should be the innermost statement. I believe, with that one can save a lot of time. Moreover, with the macro, one can get rid of the ndarray_get_float_value() function call, which sh...
by v923z
Thu Sep 26, 2019 2:16 pm
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 62
Views: 6189

Re: ulab, or what you will - numpy on bare metal

The other places where the same loop gets repeated for each typecode and operation is where C++ templates would really shine.. Personally I'd first investigate how to do that because I know it would shorten the code tremendously, but in C I'm not sure and YMMV. Probably a macro like ... Thanks, I t...
by v923z
Thu Sep 26, 2019 9:29 am
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 62
Views: 6189

Re: ulab, or what you will - numpy on bare metal

Agree with Damien: in order not to hinder adoption it should match numpy as closely as possible. In fact if you see it feasible, you could add the tests in the same way the MicroPython tests themselves are written (and hence also using it's run-tests): for supported features, write valid numpy code...
by v923z
Thu Sep 26, 2019 9:15 am
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 62
Views: 6189

Re: ulab, or what you will - numpy on bare metal

... @pythoncoder would surely like to know if an FFT costs a king's ransom. No, it doesn't. In fact, a 1024-point float transform can be gotten in less than 2 ms on the pyboard... I'm astounded. When I find time I'll study your code: are you using a better algorithm than my Cooley-Tukey code? Peter...
by v923z
Thu Sep 26, 2019 6:27 am
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 62
Views: 6189

Re: ulab, or what you will - numpy on bare metal

Hi all, First, thanks a lot for the encouraging words. Second, yesterday I uploaded the announcement in such a hurry that I managed to hide a couple of mistakes in the code examples. You have probably figured this out already, but in any case, uint8, float, etc., and functions should be preceded by ...
by v923z
Wed Sep 25, 2019 4:12 pm
Forum: Development of MicroPython
Topic: ulab, or what you will - numpy on bare metal
Replies: 62
Views: 6189

ulab, or what you will - numpy on bare metal

Hi all, As advertised in the first post of https://forum.micropython.org/viewtopic.php?f=3&t=6874, and also under https://micropython-usermod.readthedocs.io/en/latest/usermods_14.html, I am releasing a C module with a numpy-like interface. For a whooping 12 kB of extra flash space, you are going to ...
by v923z
Mon Sep 09, 2019 1:46 pm
Forum: Development of MicroPython
Topic: compiling C modules into loadable shared objects
Replies: 33
Views: 2918

Re: compiling C modules into loadable shared objects

Yes that's also possible, but then the calling code has to know exactly what the function is going to do and create a buffer of the correct size. Certainly doable, but more error prone and increases coupling of the code. Beyond what @jimmo has already pointed out in his last post, the situation is ...
by v923z
Mon Sep 09, 2019 9:48 am
Forum: Development of MicroPython
Topic: compiling C modules into loadable shared objects
Replies: 33
Views: 2918

Re: compiling C modules into loadable shared objects

From my understanding the C function that performs the fft doesn't need access to any of the MP modules (not sure how RAM allocation for the C functions works). Ok I get what you're saying. Such fft example indeed doesn't need much 'internal' things, but just returning a new buffer does mean having...