<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Edge Impulse Wrapper - without additional buffer</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/112642/edge-impulse-wrapper---without-additional-buffer</link><description>Hi, 
 we are currently trying to implement an edge impulse model (keyword spotting, 600 ms window @ 16kHz) on a nRF52832. 
 The problem is that the SoC&amp;#39;s RAM is already very full and barely fits our audio slab buffer, the library itself and the stuff</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 16 Aug 2024 07:20:01 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/112642/edge-impulse-wrapper---without-additional-buffer" /><item><title>RE: Edge Impulse Wrapper - without additional buffer</title><link>https://devzone.nordicsemi.com/thread/498553?ContentTypeID=1</link><pubDate>Fri, 16 Aug 2024 07:20:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0251a81a-af5b-444e-8b78-a3f038848e2c</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Heihei,&lt;/p&gt;
&lt;p&gt;Thanks for the heads up and I wish you the best of luck with your research moving forward.&lt;/p&gt;
&lt;p&gt;As always feel free to open new cases for any nRF/Nordic related questions or reach out if you have any questions regarding how to get access to a bigger chip.&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll mark this case as resolved/closed for now, but I won&amp;#39;t close the discussion so you can still comment to reopen the discussion&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Edge Impulse Wrapper - without additional buffer</title><link>https://devzone.nordicsemi.com/thread/498432?ContentTypeID=1</link><pubDate>Thu, 15 Aug 2024 10:35:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dfbec83a-a57d-4451-b1f0-7e620b88c779</guid><dc:creator>Nordix</dc:creator><description>&lt;p&gt;Hei Andreas,&lt;/p&gt;
&lt;p&gt;thank you very much for your input and I apologize for the late reply.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Unfortunately, after the holidays, we don&amp;#39;t have the resources anymore to continue our work on this and we have to omit running the NN at the edge on a nRF52. Maybe we&amp;#39;ll get a bigger chip at some point or more time for trying to implement the approach you explained above.&lt;/p&gt;
&lt;p&gt;Thank you very much again for your support.&lt;/p&gt;
&lt;p&gt;Best regards, Nordix&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Edge Impulse Wrapper - without additional buffer</title><link>https://devzone.nordicsemi.com/thread/492176?ContentTypeID=1</link><pubDate>Thu, 04 Jul 2024 07:20:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83d51c89-26d1-4659-b474-0b3bebbe0141</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi again,&lt;/p&gt;
&lt;p&gt;Here&amp;#39;s some input from one of our engineers who&amp;#39;s had a deeper dive into the EI SDK:&lt;/p&gt;
&lt;p&gt;---&lt;/p&gt;
&lt;p&gt;What should be happening is that they have a ping-pong buffer to store one window (20ms I think is EI&amp;#39;s default window size) of raw incoming audio samples at 16bit, another buffer also windows size padded out to the next power of 2 (for calculating MFCCs), and a 3rd buffer to accumulate MFCCs in.&lt;/p&gt;
&lt;p&gt;It appears that all of EI&amp;#39;s signal processing is done in f32, so the 2nd buffer will need to be f32, as well as possibly the 3rd if they don&amp;#39;t quantize on the fly.&lt;/p&gt;
&lt;p&gt;If by slab buffer the OP means a buffer to hold 600ms of audio, that is completely unnecessary(unless the CPU can&amp;#39;t keep up). But I don&amp;#39;t know EI well enough how to restructure this. I don&amp;#39;t think trying to re-do all the signal processing in int16 is going to work; the model is trained w/ the float implementation so it should be inferred with float as well.&lt;/p&gt;
&lt;p&gt;So the flow should be to:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;capture one window (20ms) of audio in ping buffer.&lt;/li&gt;
&lt;li&gt;Switch DMA to the pong buffer (if it&amp;#39;s a circular buffer, set the threshold interrupt to 50%).&lt;/li&gt;
&lt;li&gt;Extract MFCCs on ping buffer, save them to MFCC buffer.&lt;/li&gt;
&lt;li&gt;Repeat above, alternating ping/pong until 600ms is captured.&lt;/li&gt;
&lt;li&gt;Perform inference.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;This all depends on being able to calculate the MFCCs for a single window within a window&amp;#39;s frame of time.&lt;/p&gt;
&lt;p&gt;A short-cut could be use 8kfps audio. Cuts the audio buffers in half. Most voice is below 4K, and we&amp;#39;ve actually seen improvements using 8K audio, I think because the MFCCs comb filters are narrower. That&amp;#39;s just anecdotal though.&lt;/p&gt;
&lt;p&gt;---&lt;/p&gt;
&lt;p&gt;This will unfortunately be close to the limit of what we can offer of support for this, since our knowledge is somewhat limited w.r.t the EI SDK and how it works.&lt;/p&gt;
&lt;p&gt;Hope that this is helpful (not too obvious or abstract)&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Edge Impulse Wrapper - without additional buffer</title><link>https://devzone.nordicsemi.com/thread/491875?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2024 14:11:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cee245ac-9e2f-42d4-848d-1543459b3758</guid><dc:creator>Nordix</dc:creator><description>&lt;p&gt;Thank you. I opened a topic in&amp;nbsp;the Edge Impulse forum too:&lt;br /&gt;&lt;a href="https://forum.edgeimpulse.com/t/c-library-input-datatype-int16-float/11792/3"&gt;https://forum.edgeimpulse.com/t/c-library-input-datatype-int16-float/11792/3&lt;br /&gt;&lt;/a&gt;Looking forward to hearing back from you/your team!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Edge Impulse Wrapper - without additional buffer</title><link>https://devzone.nordicsemi.com/thread/491861?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2024 13:26:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:376f8d5e-41b4-42c7-94f8-2c2b646f97f8</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;It&amp;#39;s also worth mentioning that it may be worth investigating any suggestions/comments on the Zephyr discord forums as well as Edge Impulse forums as well while waiting for some input from us.&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Edge Impulse Wrapper - without additional buffer</title><link>https://devzone.nordicsemi.com/thread/491858?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2024 13:20:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44d9dae0-f5fa-486f-8dc3-eddee6e6965f</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;I see, that makes sense.&lt;/p&gt;
&lt;p&gt;I will check in with my colleagues and see they have any other thoughts regarding suggestions you could try investigate, but my thoughts are that your angle of attack seems sane. As long as the changes you make, such as modifying&amp;nbsp;&lt;span&gt;ei_wrapper_add_data to work with int16 instead of float, does not propagate into the rest of the api and/or library in any unexpected ways.&amp;nbsp;I can&amp;#39;t guarantee that it will work, but I can&amp;#39;t see why it should not as of now.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;ll let you know about a status later this week w.r.t input from the mentioned discussion.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kind regards,&lt;br /&gt;Andreas&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Edge Impulse Wrapper - without additional buffer</title><link>https://devzone.nordicsemi.com/thread/491827?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2024 12:07:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d0573cb-2504-45cf-b919-3d62962a69cd</guid><dc:creator>Nordix</dc:creator><description>&lt;p&gt;Hi,&lt;br /&gt;we have a custom development board available right now that has not been designed with AI applications in mind. Therefore the SoC is under-dimensioned for many tasks that include DSP+NN processing. However, since we need to work with this particular board right now, it would be great if we could still get the edge impulse running on it somehow.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Right now I am trying to change the wrapper to&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1. work with int16_t instead of floats&lt;br /&gt;2. Constructing the necessary input signal to the run_classifier function manually and calling it directly.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But I don&amp;#39;t know how promising this approach is.&lt;/p&gt;
&lt;p&gt;Best regards, Nordix&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Edge Impulse Wrapper - without additional buffer</title><link>https://devzone.nordicsemi.com/thread/491824?ContentTypeID=1</link><pubDate>Tue, 02 Jul 2024 11:57:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:33c6dbb5-c57e-4c26-923a-9d6c1e223dbe</guid><dc:creator>AHaug</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;The nRF52832 is as you say rather limited w.r.t flash and RAM so it is, as you say, required with some action to optimize either the load or the general footprint. The suggestions you make seems to be sound, albeit being brought down yet again by the available flash/RAM on the device.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m curious is the SoC choice something that comes from the scope of your project, i.e that you want to create this edge impulse application on a RAM limited device, or due to the availability of no other boards?&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;br /&gt;Andreas&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>