添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
满身肌肉的包子  ·  e: gnupg, gnupg2 and ...·  2 月前    · 
纯真的脸盆  ·  南京市人民政府·  5 月前    · 
憨厚的芒果  ·  惠评文旅 | ...·  6 月前    · 

How to use scipy in micropython

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
as title. I am a newer of micropython, and I want to use scipy and numpy in pyboard. what can I do then?
thanks in advance.
Hi and welcome,
there is not much you can do as their is and will never be a port of numpy and scipy to Micropython. These are very huge libraries, which will never fit on a microcontroller, both in terms of memory and in terms of complexity.
The thing you can do, try to isolate what you want to do and see if this would be feasible to run on a microcontroller (e. g. does it use other libraries written in other languages like Fortran, does it use large amounts of memory?, will it perform reasonable fast enough on a 32 bit machine at around 80 MHz, etc.). If yes, use the numpy and scipy source code to understand the particular implementation, strip it down to the bare minimum and give it a test.
Thanks for your reply. Now I have to code my own array/fft/fir and so on. They are the keys of my job.
Thanks again.
Awesome MicroPython list
Pycopy - A better MicroPython https://github.com/pfalcon/micropython
MicroPython standard library for all ports and forks - https://github.com/pfalcon/micropython-lib
More up to date docs - http://pycopy.readthedocs.io/
mhwang1973 wrote: Thanks for your reply. Now I have to code my own array/fft/fir and so on. They are the keys of my job.
Thanks again.
MicropPython supports the array module. You might also like to look at my attempts at FFT https://github.com/peterhinch/micropython-fourier.git and FIR https://github.com/peterhinch/micropython-filters.git . They don't aim to compete with the big libraries - their aim is fast execution on the Pyboard.
Peter Hinch
Index to my micropython libraries .
FFT is so important for signal processing and many other usages, also ESP32 has ADC and DAC.
It will be very nice if FFT is built into MicroPython.
From initial tests the ESP32 ADC and DAC aren't as accurate as those on the Pyboard.
As a general point re FFT, a DFT routine in Python will be portable and examples abound on the web. To sate the obvious it may not be fast enough for realtime DSP even if you use the high performance code emitters. The solution is to use assembler. My Arm Thumb attempt is fairly fast, but could undoubtedly be optimised further, perhaps by up to a factor of two.
I doubt that the MicroPython maintainers will write an optimised DFT in assembler for each target arch. It's up to us, the users, to do this; it's more grunt-work than rocket science ;) Likewise FIR and IIR filters benefit hugely from asm.
I have no particular ambition to use an ESP32 for DSP.
Peter Hinch
Index to my micropython libraries .
  • ↳   Announcements and News
  • ↳   Newsletter archive
  • ↳   Kickstarter logistics for the Micro Python campaign
  • The MicroPython Language
  • ↳   General Discussion and Questions
  • ↳   Programs, Libraries and Tools
  • ↳   Development of MicroPython
  • Boards Running MicroPython
  • ↳   MicroPython pyboard
  • ↳   Pyboard D-series
  • ↳   WiPy and CC3200 boards
  • ↳   ESP8266 boards
  • ↳   ESP32 boards
  • ↳   micro:bit boards
  • ↳   Raspberry Pi microcontroller boards
  • ↳   Other Boards
  • Hardware Projects and Component Drivers
  • ↳   Hardware Projects
  • ↳   Drivers for External Components
  •